/[RomCheater]/trunk/deps/WeifenLuo.WinFormsUI.Docking/DockSample/Customization/Extender.cs
ViewVC logotype

Contents of /trunk/deps/WeifenLuo.WinFormsUI.Docking/DockSample/Customization/Extender.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 140 - (show annotations) (download)
Fri May 11 11:29:29 2012 UTC (9 years, 4 months ago) by william
File size: 1840 byte(s)


1 using System;
2 using System.Drawing;
3 using WeifenLuo.WinFormsUI.Docking;
4
5 namespace DockSample.Customization
6 {
7 public class Extender
8 {
9 public enum Schema
10 {
11 VS2005,
12 VS2003
13 }
14
15 private class VS2003DockPaneStripFactory : DockPanelExtender.IDockPaneStripFactory
16 {
17 public DockPaneStripBase CreateDockPaneStrip(DockPane pane)
18 {
19 return new VS2003DockPaneStrip(pane);
20 }
21 }
22
23 private class VS2003AutoHideStripFactory : DockPanelExtender.IAutoHideStripFactory
24 {
25 public AutoHideStripBase CreateAutoHideStrip(DockPanel panel)
26 {
27 return new VS2003AutoHideStrip(panel);
28 }
29 }
30
31 private class VS2003DockPaneCaptionFactory : DockPanelExtender.IDockPaneCaptionFactory
32 {
33 public DockPaneCaptionBase CreateDockPaneCaption(DockPane pane)
34 {
35 return new VS2003DockPaneCaption(pane);
36 }
37 }
38
39 public static void SetSchema(DockPanel dockPanel, Extender.Schema schema)
40 {
41 if (schema == Extender.Schema.VS2005)
42 {
43 dockPanel.Extender.AutoHideStripFactory = null;
44 dockPanel.Extender.DockPaneCaptionFactory = null;
45 dockPanel.Extender.DockPaneStripFactory = null;
46 }
47 else if (schema == Extender.Schema.VS2003)
48 {
49 dockPanel.Extender.DockPaneCaptionFactory = new VS2003DockPaneCaptionFactory();
50 dockPanel.Extender.AutoHideStripFactory = new VS2003AutoHideStripFactory();
51 dockPanel.Extender.DockPaneStripFactory = new VS2003DockPaneStripFactory();
52 }
53 }
54 }
55 }

  ViewVC Help
Powered by ViewVC 1.1.22