1 | using System;
|
---|
2 | using System.Windows.Forms;
|
---|
3 | using System.Drawing;
|
---|
4 | using System.ComponentModel;
|
---|
5 | using System.Diagnostics.CodeAnalysis;
|
---|
6 |
|
---|
7 | namespace WeifenLuo.WinFormsUI.Docking
|
---|
8 | {
|
---|
9 | public delegate string GetPersistStringCallback();
|
---|
10 |
|
---|
11 | public class DockContentHandler : IDisposable, IDockDragSource
|
---|
12 | {
|
---|
13 | public DockContentHandler(Form form) : this(form, null)
|
---|
14 | {
|
---|
15 | }
|
---|
16 |
|
---|
17 | public DockContentHandler(Form form, GetPersistStringCallback getPersistStringCallback)
|
---|
18 | {
|
---|
19 | if (!(form is IDockContent))
|
---|
20 | throw new ArgumentException(Strings.DockContent_Constructor_InvalidForm, "form");
|
---|
21 |
|
---|
22 | m_form = form;
|
---|
23 | m_getPersistStringCallback = getPersistStringCallback;
|
---|
24 |
|
---|
25 | m_events = new EventHandlerList();
|
---|
26 | Form.Disposed +=new EventHandler(Form_Disposed);
|
---|
27 | Form.TextChanged += new EventHandler(Form_TextChanged);
|
---|
28 | }
|
---|
29 |
|
---|
30 | public void Dispose()
|
---|
31 | {
|
---|
32 | Dispose(true);
|
---|
33 | GC.SuppressFinalize(this);
|
---|
34 | }
|
---|
35 |
|
---|
36 | protected virtual void Dispose(bool disposing)
|
---|
37 | {
|
---|
38 | if(disposing)
|
---|
39 | {
|
---|
40 | lock(this)
|
---|
41 | {
|
---|
42 | DockPanel = null;
|
---|
43 | if (m_autoHideTab != null)
|
---|
44 | m_autoHideTab.Dispose();
|
---|
45 | if (m_tab != null)
|
---|
46 | m_tab.Dispose();
|
---|
47 |
|
---|
48 | Form.Disposed -= new EventHandler(Form_Disposed);
|
---|
49 | Form.TextChanged -= new EventHandler(Form_TextChanged);
|
---|
50 | m_events.Dispose();
|
---|
51 | }
|
---|
52 | }
|
---|
53 | }
|
---|
54 |
|
---|
55 | private Form m_form;
|
---|
56 | public Form Form
|
---|
57 | {
|
---|
58 | get { return m_form; }
|
---|
59 | }
|
---|
60 |
|
---|
61 | public IDockContent Content
|
---|
62 | {
|
---|
63 | get { return Form as IDockContent; }
|
---|
64 | }
|
---|
65 |
|
---|
66 | private IDockContent m_previousActive = null;
|
---|
67 | public IDockContent PreviousActive
|
---|
68 | {
|
---|
69 | get { return m_previousActive; }
|
---|
70 | internal set { m_previousActive = value; }
|
---|
71 | }
|
---|
72 |
|
---|
73 | private IDockContent m_nextActive = null;
|
---|
74 | public IDockContent NextActive
|
---|
75 | {
|
---|
76 | get { return m_nextActive; }
|
---|
77 | internal set { m_nextActive = value; }
|
---|
78 | }
|
---|
79 |
|
---|
80 | private EventHandlerList m_events;
|
---|
81 | private EventHandlerList Events
|
---|
82 | {
|
---|
83 | get { return m_events; }
|
---|
84 | }
|
---|
85 |
|
---|
86 | private bool m_allowEndUserDocking = true;
|
---|
87 | public bool AllowEndUserDocking
|
---|
88 | {
|
---|
89 | get { return m_allowEndUserDocking; }
|
---|
90 | set { m_allowEndUserDocking = value; }
|
---|
91 | }
|
---|
92 |
|
---|
93 | private double m_autoHidePortion = 0.25;
|
---|
94 | public double AutoHidePortion
|
---|
95 | {
|
---|
96 | get { return m_autoHidePortion; }
|
---|
97 | set
|
---|
98 | {
|
---|
99 | if (value <= 0)
|
---|
100 | throw(new ArgumentOutOfRangeException(Strings.DockContentHandler_AutoHidePortion_OutOfRange));
|
---|
101 |
|
---|
102 | if (m_autoHidePortion == value)
|
---|
103 | return;
|
---|
104 |
|
---|
105 | m_autoHidePortion = value;
|
---|
106 |
|
---|
107 | if (DockPanel == null)
|
---|
108 | return;
|
---|
109 |
|
---|
110 | if (DockPanel.ActiveAutoHideContent == Content)
|
---|
111 | DockPanel.PerformLayout();
|
---|
112 | }
|
---|
113 | }
|
---|
114 |
|
---|
115 | private bool m_closeButton = true;
|
---|
116 | public bool CloseButton
|
---|
117 | {
|
---|
118 | get { return m_closeButton; }
|
---|
119 | set
|
---|
120 | {
|
---|
121 | if (m_closeButton == value)
|
---|
122 | return;
|
---|
123 |
|
---|
124 | m_closeButton = value;
|
---|
125 | if (Pane != null)
|
---|
126 | if (Pane.ActiveContent.DockHandler == this)
|
---|
127 | Pane.RefreshChanges();
|
---|
128 | }
|
---|
129 | }
|
---|
130 |
|
---|
131 | private bool m_closeButtonVisible = true;
|
---|
132 | /// <summary>
|
---|
133 | /// Determines whether the close button is visible on the content
|
---|
134 | /// </summary>
|
---|
135 | public bool CloseButtonVisible
|
---|
136 | {
|
---|
137 | get { return m_closeButtonVisible; }
|
---|
138 | set { m_closeButtonVisible = value; }
|
---|
139 | }
|
---|
140 |
|
---|
141 | private DockState DefaultDockState
|
---|
142 | {
|
---|
143 | get
|
---|
144 | {
|
---|
145 | if (ShowHint != DockState.Unknown && ShowHint != DockState.Hidden)
|
---|
146 | return ShowHint;
|
---|
147 |
|
---|
148 | if ((DockAreas & DockAreas.Document) != 0)
|
---|
149 | return DockState.Document;
|
---|
150 | if ((DockAreas & DockAreas.DockRight) != 0)
|
---|
151 | return DockState.DockRight;
|
---|
152 | if ((DockAreas & DockAreas.DockLeft) != 0)
|
---|
153 | return DockState.DockLeft;
|
---|
154 | if ((DockAreas & DockAreas.DockBottom) != 0)
|
---|
155 | return DockState.DockBottom;
|
---|
156 | if ((DockAreas & DockAreas.DockTop) != 0)
|
---|
157 | return DockState.DockTop;
|
---|
158 |
|
---|
159 | return DockState.Unknown;
|
---|
160 | }
|
---|
161 | }
|
---|
162 |
|
---|
163 | private DockState DefaultShowState
|
---|
164 | {
|
---|
165 | get
|
---|
166 | {
|
---|
167 | if (ShowHint != DockState.Unknown)
|
---|
168 | return ShowHint;
|
---|
169 |
|
---|
170 | if ((DockAreas & DockAreas.Document) != 0)
|
---|
171 | return DockState.Document;
|
---|
172 | if ((DockAreas & DockAreas.DockRight) != 0)
|
---|
173 | return DockState.DockRight;
|
---|
174 | if ((DockAreas & DockAreas.DockLeft) != 0)
|
---|
175 | return DockState.DockLeft;
|
---|
176 | if ((DockAreas & DockAreas.DockBottom) != 0)
|
---|
177 | return DockState.DockBottom;
|
---|
178 | if ((DockAreas & DockAreas.DockTop) != 0)
|
---|
179 | return DockState.DockTop;
|
---|
180 | if ((DockAreas & DockAreas.Float) != 0)
|
---|
181 | return DockState.Float;
|
---|
182 |
|
---|
183 | return DockState.Unknown;
|
---|
184 | }
|
---|
185 | }
|
---|
186 |
|
---|
187 | private DockAreas m_allowedAreas = DockAreas.DockLeft | DockAreas.DockRight | DockAreas.DockTop | DockAreas.DockBottom | DockAreas.Document | DockAreas.Float;
|
---|
188 | public DockAreas DockAreas
|
---|
189 | {
|
---|
190 | get { return m_allowedAreas; }
|
---|
191 | set
|
---|
192 | {
|
---|
193 | if (m_allowedAreas == value)
|
---|
194 | return;
|
---|
195 |
|
---|
196 | if (!DockHelper.IsDockStateValid(DockState, value))
|
---|
197 | throw(new InvalidOperationException(Strings.DockContentHandler_DockAreas_InvalidValue));
|
---|
198 |
|
---|
199 | m_allowedAreas = value;
|
---|
200 |
|
---|
201 | if (!DockHelper.IsDockStateValid(ShowHint, m_allowedAreas))
|
---|
202 | ShowHint = DockState.Unknown;
|
---|
203 | }
|
---|
204 | }
|
---|
205 |
|
---|
206 | private DockState m_dockState = DockState.Unknown;
|
---|
207 | public DockState DockState
|
---|
208 | {
|
---|
209 | get { return m_dockState; }
|
---|
210 | set
|
---|
211 | {
|
---|
212 | if (m_dockState == value)
|
---|
213 | return;
|
---|
214 |
|
---|
215 | DockPanel.SuspendLayout(true);
|
---|
216 |
|
---|
217 | if (value == DockState.Hidden)
|
---|
218 | IsHidden = true;
|
---|
219 | else
|
---|
220 | SetDockState(false, value, Pane);
|
---|
221 |
|
---|
222 | DockPanel.ResumeLayout(true, true);
|
---|
223 | }
|
---|
224 | }
|
---|
225 |
|
---|
226 | private DockPanel m_dockPanel = null;
|
---|
227 | public DockPanel DockPanel
|
---|
228 | {
|
---|
229 | get { return m_dockPanel; }
|
---|
230 | set
|
---|
231 | {
|
---|
232 | if (m_dockPanel == value)
|
---|
233 | return;
|
---|
234 |
|
---|
235 | Pane = null;
|
---|
236 |
|
---|
237 | if (m_dockPanel != null)
|
---|
238 | m_dockPanel.RemoveContent(Content);
|
---|
239 |
|
---|
240 | if (m_tab != null)
|
---|
241 | {
|
---|
242 | m_tab.Dispose();
|
---|
243 | m_tab = null;
|
---|
244 | }
|
---|
245 |
|
---|
246 | if (m_autoHideTab != null)
|
---|
247 | {
|
---|
248 | m_autoHideTab.Dispose();
|
---|
249 | m_autoHideTab = null;
|
---|
250 | }
|
---|
251 |
|
---|
252 | m_dockPanel = value;
|
---|
253 |
|
---|
254 | if (m_dockPanel != null)
|
---|
255 | {
|
---|
256 | m_dockPanel.AddContent(Content);
|
---|
257 | Form.TopLevel = false;
|
---|
258 | Form.FormBorderStyle = FormBorderStyle.None;
|
---|
259 | Form.ShowInTaskbar = false;
|
---|
260 | Form.WindowState = FormWindowState.Normal;
|
---|
261 | if (!Win32Helper.IsRunningOnMono)
|
---|
262 | NativeMethods.SetWindowPos(Form.Handle, IntPtr.Zero, 0, 0, 0, 0,
|
---|
263 | Win32.FlagsSetWindowPos.SWP_NOACTIVATE |
|
---|
264 | Win32.FlagsSetWindowPos.SWP_NOMOVE |
|
---|
265 | Win32.FlagsSetWindowPos.SWP_NOSIZE |
|
---|
266 | Win32.FlagsSetWindowPos.SWP_NOZORDER |
|
---|
267 | Win32.FlagsSetWindowPos.SWP_NOOWNERZORDER |
|
---|
268 | Win32.FlagsSetWindowPos.SWP_FRAMECHANGED);
|
---|
269 | }
|
---|
270 | }
|
---|
271 | }
|
---|
272 |
|
---|
273 | public Icon Icon
|
---|
274 | {
|
---|
275 | get { return Form.Icon; }
|
---|
276 | }
|
---|
277 |
|
---|
278 | public DockPane Pane
|
---|
279 | {
|
---|
280 | get { return IsFloat ? FloatPane : PanelPane; }
|
---|
281 | set
|
---|
282 | {
|
---|
283 | if (Pane == value)
|
---|
284 | return;
|
---|
285 |
|
---|
286 | DockPanel.SuspendLayout(true);
|
---|
287 |
|
---|
288 | DockPane oldPane = Pane;
|
---|
289 |
|
---|
290 | SuspendSetDockState();
|
---|
291 | FloatPane = (value == null ? null : (value.IsFloat ? value : FloatPane));
|
---|
292 | PanelPane = (value == null ? null : (value.IsFloat ? PanelPane : value));
|
---|
293 | ResumeSetDockState(IsHidden, value != null ? value.DockState : DockState.Unknown, oldPane);
|
---|
294 |
|
---|
295 | DockPanel.ResumeLayout(true, true);
|
---|
296 | }
|
---|
297 | }
|
---|
298 |
|
---|
299 | private bool m_isHidden = true;
|
---|
300 | public bool IsHidden
|
---|
301 | {
|
---|
302 | get { return m_isHidden; }
|
---|
303 | set
|
---|
304 | {
|
---|
305 | if (m_isHidden == value)
|
---|
306 | return;
|
---|
307 |
|
---|
308 | SetDockState(value, VisibleState, Pane);
|
---|
309 | }
|
---|
310 | }
|
---|
311 |
|
---|
312 | private string m_tabText = null;
|
---|
313 | public string TabText
|
---|
314 | {
|
---|
315 | get { return m_tabText == null || m_tabText == "" ? Form.Text : m_tabText; }
|
---|
316 | set
|
---|
317 | {
|
---|
318 | if (m_tabText == value)
|
---|
319 | return;
|
---|
320 |
|
---|
321 | m_tabText = value;
|
---|
322 | if (Pane != null)
|
---|
323 | Pane.RefreshChanges();
|
---|
324 | }
|
---|
325 | }
|
---|
326 |
|
---|
327 | private DockState m_visibleState = DockState.Unknown;
|
---|
328 | public DockState VisibleState
|
---|
329 | {
|
---|
330 | get { return m_visibleState; }
|
---|
331 | set
|
---|
332 | {
|
---|
333 | if (m_visibleState == value)
|
---|
334 | return;
|
---|
335 |
|
---|
336 | SetDockState(IsHidden, value, Pane);
|
---|
337 | }
|
---|
338 | }
|
---|
339 |
|
---|
340 | private bool m_isFloat = false;
|
---|
341 | public bool IsFloat
|
---|
342 | {
|
---|
343 | get { return m_isFloat; }
|
---|
344 | set
|
---|
345 | {
|
---|
346 | if (m_isFloat == value)
|
---|
347 | return;
|
---|
348 |
|
---|
349 | DockState visibleState = CheckDockState(value);
|
---|
350 |
|
---|
351 | if (visibleState == DockState.Unknown)
|
---|
352 | throw new InvalidOperationException(Strings.DockContentHandler_IsFloat_InvalidValue);
|
---|
353 |
|
---|
354 | SetDockState(IsHidden, visibleState, Pane);
|
---|
355 | }
|
---|
356 | }
|
---|
357 |
|
---|
358 | [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters")]
|
---|
359 | public DockState CheckDockState(bool isFloat)
|
---|
360 | {
|
---|
361 | DockState dockState;
|
---|
362 |
|
---|
363 | if (isFloat)
|
---|
364 | {
|
---|
365 | if (!IsDockStateValid(DockState.Float))
|
---|
366 | dockState = DockState.Unknown;
|
---|
367 | else
|
---|
368 | dockState = DockState.Float;
|
---|
369 | }
|
---|
370 | else
|
---|
371 | {
|
---|
372 | dockState = (PanelPane != null) ? PanelPane.DockState : DefaultDockState;
|
---|
373 | if (dockState != DockState.Unknown && !IsDockStateValid(dockState))
|
---|
374 | dockState = DockState.Unknown;
|
---|
375 | }
|
---|
376 |
|
---|
377 | return dockState;
|
---|
378 | }
|
---|
379 |
|
---|
380 | private DockPane m_panelPane = null;
|
---|
381 | public DockPane PanelPane
|
---|
382 | {
|
---|
383 | get { return m_panelPane; }
|
---|
384 | set
|
---|
385 | {
|
---|
386 | if (m_panelPane == value)
|
---|
387 | return;
|
---|
388 |
|
---|
389 | if (value != null)
|
---|
390 | {
|
---|
391 | if (value.IsFloat || value.DockPanel != DockPanel)
|
---|
392 | throw new InvalidOperationException(Strings.DockContentHandler_DockPane_InvalidValue);
|
---|
393 | }
|
---|
394 |
|
---|
395 | DockPane oldPane = Pane;
|
---|
396 |
|
---|
397 | if (m_panelPane != null)
|
---|
398 | RemoveFromPane(m_panelPane);
|
---|
399 | m_panelPane = value;
|
---|
400 | if (m_panelPane != null)
|
---|
401 | {
|
---|
402 | m_panelPane.AddContent(Content);
|
---|
403 | SetDockState(IsHidden, IsFloat ? DockState.Float : m_panelPane.DockState, oldPane);
|
---|
404 | }
|
---|
405 | else
|
---|
406 | SetDockState(IsHidden, DockState.Unknown, oldPane);
|
---|
407 | }
|
---|
408 | }
|
---|
409 |
|
---|
410 | private void RemoveFromPane(DockPane pane)
|
---|
411 | {
|
---|
412 | pane.RemoveContent(Content);
|
---|
413 | SetPane(null);
|
---|
414 | if (pane.Contents.Count == 0)
|
---|
415 | pane.Dispose();
|
---|
416 | }
|
---|
417 |
|
---|
418 | private DockPane m_floatPane = null;
|
---|
419 | public DockPane FloatPane
|
---|
420 | {
|
---|
421 | get { return m_floatPane; }
|
---|
422 | set
|
---|
423 | {
|
---|
424 | if (m_floatPane == value)
|
---|
425 | return;
|
---|
426 |
|
---|
427 | if (value != null)
|
---|
428 | {
|
---|
429 | if (!value.IsFloat || value.DockPanel != DockPanel)
|
---|
430 | throw new InvalidOperationException(Strings.DockContentHandler_FloatPane_InvalidValue);
|
---|
431 | }
|
---|
432 |
|
---|
433 | DockPane oldPane = Pane;
|
---|
434 |
|
---|
435 | if (m_floatPane != null)
|
---|
436 | RemoveFromPane(m_floatPane);
|
---|
437 | m_floatPane = value;
|
---|
438 | if (m_floatPane != null)
|
---|
439 | {
|
---|
440 | m_floatPane.AddContent(Content);
|
---|
441 | SetDockState(IsHidden, IsFloat ? DockState.Float : VisibleState, oldPane);
|
---|
442 | }
|
---|
443 | else
|
---|
444 | SetDockState(IsHidden, DockState.Unknown, oldPane);
|
---|
445 | }
|
---|
446 | }
|
---|
447 |
|
---|
448 | private int m_countSetDockState = 0;
|
---|
449 | private void SuspendSetDockState()
|
---|
450 | {
|
---|
451 | m_countSetDockState ++;
|
---|
452 | }
|
---|
453 |
|
---|
454 | private void ResumeSetDockState()
|
---|
455 | {
|
---|
456 | m_countSetDockState --;
|
---|
457 | if (m_countSetDockState < 0)
|
---|
458 | m_countSetDockState = 0;
|
---|
459 | }
|
---|
460 |
|
---|
461 | internal bool IsSuspendSetDockState
|
---|
462 | {
|
---|
463 | get { return m_countSetDockState != 0; }
|
---|
464 | }
|
---|
465 |
|
---|
466 | private void ResumeSetDockState(bool isHidden, DockState visibleState, DockPane oldPane)
|
---|
467 | {
|
---|
468 | ResumeSetDockState();
|
---|
469 | SetDockState(isHidden, visibleState, oldPane);
|
---|
470 | }
|
---|
471 |
|
---|
472 | internal void SetDockState(bool isHidden, DockState visibleState, DockPane oldPane)
|
---|
473 | {
|
---|
474 | if (IsSuspendSetDockState)
|
---|
475 | return;
|
---|
476 |
|
---|
477 | if (DockPanel == null && visibleState != DockState.Unknown)
|
---|
478 | throw new InvalidOperationException(Strings.DockContentHandler_SetDockState_NullPanel);
|
---|
479 |
|
---|
480 | if (visibleState == DockState.Hidden || (visibleState != DockState.Unknown && !IsDockStateValid(visibleState)))
|
---|
481 | throw new InvalidOperationException(Strings.DockContentHandler_SetDockState_InvalidState);
|
---|
482 |
|
---|
483 | DockPanel dockPanel = DockPanel;
|
---|
484 | if (dockPanel != null)
|
---|
485 | dockPanel.SuspendLayout(true);
|
---|
486 |
|
---|
487 | SuspendSetDockState();
|
---|
488 |
|
---|
489 | DockState oldDockState = DockState;
|
---|
490 |
|
---|
491 | if (m_isHidden != isHidden || oldDockState == DockState.Unknown)
|
---|
492 | {
|
---|
493 | m_isHidden = isHidden;
|
---|
494 | }
|
---|
495 | m_visibleState = visibleState;
|
---|
496 | m_dockState = isHidden ? DockState.Hidden : visibleState;
|
---|
497 |
|
---|
498 | if (visibleState == DockState.Unknown)
|
---|
499 | Pane = null;
|
---|
500 | else
|
---|
501 | {
|
---|
502 | m_isFloat = (m_visibleState == DockState.Float);
|
---|
503 |
|
---|
504 | if (Pane == null)
|
---|
505 | Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, visibleState, true);
|
---|
506 | else if (Pane.DockState != visibleState)
|
---|
507 | {
|
---|
508 | if (Pane.Contents.Count == 1)
|
---|
509 | Pane.SetDockState(visibleState);
|
---|
510 | else
|
---|
511 | Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, visibleState, true);
|
---|
512 | }
|
---|
513 | }
|
---|
514 |
|
---|
515 | if (Form.ContainsFocus)
|
---|
516 | if (DockState == DockState.Hidden || DockState == DockState.Unknown)
|
---|
517 | if (!Win32Helper.IsRunningOnMono)
|
---|
518 | DockPanel.ContentFocusManager.GiveUpFocus(Content);
|
---|
519 |
|
---|
520 | SetPaneAndVisible(Pane);
|
---|
521 |
|
---|
522 | if (oldPane != null && !oldPane.IsDisposed && oldDockState == oldPane.DockState)
|
---|
523 | RefreshDockPane(oldPane);
|
---|
524 |
|
---|
525 | if (Pane != null && DockState == Pane.DockState)
|
---|
526 | {
|
---|
527 | if ((Pane != oldPane) ||
|
---|
528 | (Pane == oldPane && oldDockState != oldPane.DockState))
|
---|
529 | // Avoid early refresh of hidden AutoHide panes
|
---|
530 | if ((Pane.DockWindow == null || Pane.DockWindow.Visible || Pane.IsHidden) && !Pane.IsAutoHide)
|
---|
531 | RefreshDockPane(Pane);
|
---|
532 | }
|
---|
533 |
|
---|
534 | if (oldDockState != DockState)
|
---|
535 | {
|
---|
536 | if (DockState == DockState.Hidden || DockState == DockState.Unknown ||
|
---|
537 | DockHelper.IsDockStateAutoHide(DockState))
|
---|
538 | if (!Win32Helper.IsRunningOnMono)
|
---|
539 | DockPanel.ContentFocusManager.RemoveFromList(Content);
|
---|
540 | else
|
---|
541 | if (!Win32Helper.IsRunningOnMono)
|
---|
542 | DockPanel.ContentFocusManager.AddToList(Content);
|
---|
543 |
|
---|
544 | OnDockStateChanged(EventArgs.Empty);
|
---|
545 | }
|
---|
546 | ResumeSetDockState();
|
---|
547 |
|
---|
548 | if (dockPanel != null)
|
---|
549 | dockPanel.ResumeLayout(true, true);
|
---|
550 | }
|
---|
551 |
|
---|
552 | private static void RefreshDockPane(DockPane pane)
|
---|
553 | {
|
---|
554 | pane.RefreshChanges();
|
---|
555 | pane.ValidateActiveContent();
|
---|
556 | }
|
---|
557 |
|
---|
558 | internal string PersistString
|
---|
559 | {
|
---|
560 | get { return GetPersistStringCallback == null ? Form.GetType().ToString() : GetPersistStringCallback(); }
|
---|
561 | }
|
---|
562 |
|
---|
563 | private GetPersistStringCallback m_getPersistStringCallback = null;
|
---|
564 | public GetPersistStringCallback GetPersistStringCallback
|
---|
565 | {
|
---|
566 | get { return m_getPersistStringCallback; }
|
---|
567 | set { m_getPersistStringCallback = value; }
|
---|
568 | }
|
---|
569 |
|
---|
570 |
|
---|
571 | private bool m_hideOnClose = false;
|
---|
572 | public bool HideOnClose
|
---|
573 | {
|
---|
574 | get { return m_hideOnClose; }
|
---|
575 | set { m_hideOnClose = value; }
|
---|
576 | }
|
---|
577 |
|
---|
578 | private DockState m_showHint = DockState.Unknown;
|
---|
579 | public DockState ShowHint
|
---|
580 | {
|
---|
581 | get { return m_showHint; }
|
---|
582 | set
|
---|
583 | {
|
---|
584 | if (!DockHelper.IsDockStateValid(value, DockAreas))
|
---|
585 | throw (new InvalidOperationException(Strings.DockContentHandler_ShowHint_InvalidValue));
|
---|
586 |
|
---|
587 | if (m_showHint == value)
|
---|
588 | return;
|
---|
589 |
|
---|
590 | m_showHint = value;
|
---|
591 | }
|
---|
592 | }
|
---|
593 |
|
---|
594 | private bool m_isActivated = false;
|
---|
595 | public bool IsActivated
|
---|
596 | {
|
---|
597 | get { return m_isActivated; }
|
---|
598 | internal set
|
---|
599 | {
|
---|
600 | if (m_isActivated == value)
|
---|
601 | return;
|
---|
602 |
|
---|
603 | m_isActivated = value;
|
---|
604 | }
|
---|
605 | }
|
---|
606 |
|
---|
607 | public bool IsDockStateValid(DockState dockState)
|
---|
608 | {
|
---|
609 | if (DockPanel != null && dockState == DockState.Document && DockPanel.DocumentStyle == DocumentStyle.SystemMdi)
|
---|
610 | return false;
|
---|
611 | else
|
---|
612 | return DockHelper.IsDockStateValid(dockState, DockAreas);
|
---|
613 | }
|
---|
614 |
|
---|
615 | private ContextMenu m_tabPageContextMenu = null;
|
---|
616 | public ContextMenu TabPageContextMenu
|
---|
617 | {
|
---|
618 | get { return m_tabPageContextMenu; }
|
---|
619 | set { m_tabPageContextMenu = value; }
|
---|
620 | }
|
---|
621 |
|
---|
622 | private string m_toolTipText = null;
|
---|
623 | public string ToolTipText
|
---|
624 | {
|
---|
625 | get { return m_toolTipText; }
|
---|
626 | set { m_toolTipText = value; }
|
---|
627 | }
|
---|
628 |
|
---|
629 | public void Activate()
|
---|
630 | {
|
---|
631 | if (DockPanel == null)
|
---|
632 | Form.Activate();
|
---|
633 | else if (Pane == null)
|
---|
634 | Show(DockPanel);
|
---|
635 | else
|
---|
636 | {
|
---|
637 | IsHidden = false;
|
---|
638 | Pane.ActiveContent = Content;
|
---|
639 | if (DockState == DockState.Document && DockPanel.DocumentStyle == DocumentStyle.SystemMdi)
|
---|
640 | {
|
---|
641 | Form.Activate();
|
---|
642 | return;
|
---|
643 | }
|
---|
644 | else if (DockHelper.IsDockStateAutoHide(DockState))
|
---|
645 | {
|
---|
646 | if (DockPanel.ActiveAutoHideContent != Content)
|
---|
647 | {
|
---|
648 | DockPanel.ActiveAutoHideContent = null;
|
---|
649 | return;
|
---|
650 | }
|
---|
651 | }
|
---|
652 |
|
---|
653 | if (!Form.ContainsFocus)
|
---|
654 | if (!Win32Helper.IsRunningOnMono)
|
---|
655 | DockPanel.ContentFocusManager.Activate(Content);
|
---|
656 | }
|
---|
657 | }
|
---|
658 |
|
---|
659 | public void GiveUpFocus()
|
---|
660 | {
|
---|
661 | if (!Win32Helper.IsRunningOnMono)
|
---|
662 | DockPanel.ContentFocusManager.GiveUpFocus(Content);
|
---|
663 | }
|
---|
664 |
|
---|
665 | private IntPtr m_activeWindowHandle = IntPtr.Zero;
|
---|
666 | internal IntPtr ActiveWindowHandle
|
---|
667 | {
|
---|
668 | get { return m_activeWindowHandle; }
|
---|
669 | set { m_activeWindowHandle = value; }
|
---|
670 | }
|
---|
671 |
|
---|
672 | public void Hide()
|
---|
673 | {
|
---|
674 | IsHidden = true;
|
---|
675 | }
|
---|
676 |
|
---|
677 | internal void SetPaneAndVisible(DockPane pane)
|
---|
678 | {
|
---|
679 | SetPane(pane);
|
---|
680 | SetVisible();
|
---|
681 | }
|
---|
682 |
|
---|
683 | private void SetPane(DockPane pane)
|
---|
684 | {
|
---|
685 | if (pane != null && pane.DockState == DockState.Document && DockPanel.DocumentStyle == DocumentStyle.DockingMdi)
|
---|
686 | {
|
---|
687 | if (Form.Parent is DockPane)
|
---|
688 | SetParent(null);
|
---|
689 | if (Form.MdiParent != DockPanel.ParentForm)
|
---|
690 | {
|
---|
691 | FlagClipWindow = true;
|
---|
692 | Form.MdiParent = DockPanel.ParentForm;
|
---|
693 | }
|
---|
694 | }
|
---|
695 | else
|
---|
696 | {
|
---|
697 | FlagClipWindow = true;
|
---|
698 | if (Form.MdiParent != null)
|
---|
699 | Form.MdiParent = null;
|
---|
700 | if (Form.TopLevel)
|
---|
701 | Form.TopLevel = false;
|
---|
702 | SetParent(pane);
|
---|
703 | }
|
---|
704 | }
|
---|
705 |
|
---|
706 | internal void SetVisible()
|
---|
707 | {
|
---|
708 | bool visible;
|
---|
709 |
|
---|
710 | if (IsHidden)
|
---|
711 | visible = false;
|
---|
712 | else if (Pane != null && Pane.DockState == DockState.Document && DockPanel.DocumentStyle == DocumentStyle.DockingMdi)
|
---|
713 | visible = true;
|
---|
714 | else if (Pane != null && Pane.ActiveContent == Content)
|
---|
715 | visible = true;
|
---|
716 | else if (Pane != null && Pane.ActiveContent != Content)
|
---|
717 | visible = false;
|
---|
718 | else
|
---|
719 | visible = Form.Visible;
|
---|
720 |
|
---|
721 | if (Form.Visible != visible)
|
---|
722 | Form.Visible = visible;
|
---|
723 | }
|
---|
724 |
|
---|
725 | private void SetParent(Control value)
|
---|
726 | {
|
---|
727 | if (Form.Parent == value)
|
---|
728 | return;
|
---|
729 |
|
---|
730 | //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
---|
731 | // Workaround of .Net Framework bug:
|
---|
732 | // Change the parent of a control with focus may result in the first
|
---|
733 | // MDI child form get activated.
|
---|
734 | //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
---|
735 | bool bRestoreFocus = false;
|
---|
736 | if (Form.ContainsFocus)
|
---|
737 | {
|
---|
738 | //Suggested as a fix for a memory leak by bugreports
|
---|
739 | if (value == null && !IsFloat)
|
---|
740 | if (!Win32Helper.IsRunningOnMono)
|
---|
741 | DockPanel.ContentFocusManager.GiveUpFocus(this.Content);
|
---|
742 | else
|
---|
743 | {
|
---|
744 | DockPanel.SaveFocus();
|
---|
745 | bRestoreFocus = true;
|
---|
746 | }
|
---|
747 | }
|
---|
748 | //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
---|
749 |
|
---|
750 | Form.Parent = value;
|
---|
751 |
|
---|
752 | //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
---|
753 | // Workaround of .Net Framework bug:
|
---|
754 | // Change the parent of a control with focus may result in the first
|
---|
755 | // MDI child form get activated.
|
---|
756 | //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
---|
757 | if (bRestoreFocus)
|
---|
758 | Activate();
|
---|
759 | //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
---|
760 | }
|
---|
761 |
|
---|
762 | public void Show()
|
---|
763 | {
|
---|
764 | if (DockPanel == null)
|
---|
765 | Form.Show();
|
---|
766 | else
|
---|
767 | Show(DockPanel);
|
---|
768 | }
|
---|
769 |
|
---|
770 | public void Show(DockPanel dockPanel)
|
---|
771 | {
|
---|
772 | if (dockPanel == null)
|
---|
773 | throw(new ArgumentNullException(Strings.DockContentHandler_Show_NullDockPanel));
|
---|
774 |
|
---|
775 | if (DockState == DockState.Unknown)
|
---|
776 | Show(dockPanel, DefaultShowState);
|
---|
777 | else
|
---|
778 | Activate();
|
---|
779 | }
|
---|
780 |
|
---|
781 | public void Show(DockPanel dockPanel, DockState dockState)
|
---|
782 | {
|
---|
783 | if (dockPanel == null)
|
---|
784 | throw(new ArgumentNullException(Strings.DockContentHandler_Show_NullDockPanel));
|
---|
785 |
|
---|
786 | if (dockState == DockState.Unknown || dockState == DockState.Hidden)
|
---|
787 | throw(new ArgumentException(Strings.DockContentHandler_Show_InvalidDockState));
|
---|
788 |
|
---|
789 | dockPanel.SuspendLayout(true);
|
---|
790 |
|
---|
791 | DockPanel = dockPanel;
|
---|
792 |
|
---|
793 | if (dockState == DockState.Float && FloatPane == null)
|
---|
794 | Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.Float, true);
|
---|
795 | else if (PanelPane == null)
|
---|
796 | {
|
---|
797 | DockPane paneExisting = null;
|
---|
798 | foreach (DockPane pane in DockPanel.Panes)
|
---|
799 | if (pane.DockState == dockState)
|
---|
800 | {
|
---|
801 | paneExisting = pane;
|
---|
802 | break;
|
---|
803 | }
|
---|
804 |
|
---|
805 | if (paneExisting == null)
|
---|
806 | Pane = DockPanel.DockPaneFactory.CreateDockPane(Content, dockState, true);
|
---|
807 | else
|
---|
808 | Pane = paneExisting;
|
---|
809 | }
|
---|
810 |
|
---|
811 | DockState = dockState;
|
---|
812 | dockPanel.ResumeLayout(true, true); //we'll resume the layout before activating to ensure that the position
|
---|
813 | Activate(); //and size of the form are finally processed before the form is shown
|
---|
814 | }
|
---|
815 |
|
---|
816 | [SuppressMessage("Microsoft.Naming", "CA1720:AvoidTypeNamesInParameters")]
|
---|
817 | public void Show(DockPanel dockPanel, Rectangle floatWindowBounds)
|
---|
818 | {
|
---|
819 | if (dockPanel == null)
|
---|
820 | throw(new ArgumentNullException(Strings.DockContentHandler_Show_NullDockPanel));
|
---|
821 |
|
---|
822 | dockPanel.SuspendLayout(true);
|
---|
823 |
|
---|
824 | DockPanel = dockPanel;
|
---|
825 | if (FloatPane == null)
|
---|
826 | {
|
---|
827 | IsHidden = true; // to reduce the screen flicker
|
---|
828 | FloatPane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.Float, false);
|
---|
829 | FloatPane.FloatWindow.StartPosition = FormStartPosition.Manual;
|
---|
830 | }
|
---|
831 |
|
---|
832 | FloatPane.FloatWindow.Bounds = floatWindowBounds;
|
---|
833 |
|
---|
834 | Show(dockPanel, DockState.Float);
|
---|
835 | Activate();
|
---|
836 |
|
---|
837 | dockPanel.ResumeLayout(true, true);
|
---|
838 | }
|
---|
839 |
|
---|
840 | public void Show(DockPane pane, IDockContent beforeContent)
|
---|
841 | {
|
---|
842 | if (pane == null)
|
---|
843 | throw(new ArgumentNullException(Strings.DockContentHandler_Show_NullPane));
|
---|
844 |
|
---|
845 | if (beforeContent != null && pane.Contents.IndexOf(beforeContent) == -1)
|
---|
846 | throw(new ArgumentException(Strings.DockContentHandler_Show_InvalidBeforeContent));
|
---|
847 |
|
---|
848 | pane.DockPanel.SuspendLayout(true);
|
---|
849 |
|
---|
850 | DockPanel = pane.DockPanel;
|
---|
851 | Pane = pane;
|
---|
852 | pane.SetContentIndex(Content, pane.Contents.IndexOf(beforeContent));
|
---|
853 | Show();
|
---|
854 |
|
---|
855 | pane.DockPanel.ResumeLayout(true, true);
|
---|
856 | }
|
---|
857 |
|
---|
858 | public void Show(DockPane previousPane, DockAlignment alignment, double proportion)
|
---|
859 | {
|
---|
860 | if (previousPane == null)
|
---|
861 | throw(new ArgumentException(Strings.DockContentHandler_Show_InvalidPrevPane));
|
---|
862 |
|
---|
863 | if (DockHelper.IsDockStateAutoHide(previousPane.DockState))
|
---|
864 | throw(new ArgumentException(Strings.DockContentHandler_Show_InvalidPrevPane));
|
---|
865 |
|
---|
866 | previousPane.DockPanel.SuspendLayout(true);
|
---|
867 |
|
---|
868 | DockPanel = previousPane.DockPanel;
|
---|
869 | DockPanel.DockPaneFactory.CreateDockPane(Content, previousPane, alignment, proportion, true);
|
---|
870 | Show();
|
---|
871 |
|
---|
872 | previousPane.DockPanel.ResumeLayout(true, true);
|
---|
873 | }
|
---|
874 |
|
---|
875 | public void Close()
|
---|
876 | {
|
---|
877 | DockPanel dockPanel = DockPanel;
|
---|
878 | if (dockPanel != null)
|
---|
879 | dockPanel.SuspendLayout(true);
|
---|
880 | Form.Close();
|
---|
881 | if (dockPanel != null)
|
---|
882 | dockPanel.ResumeLayout(true, true);
|
---|
883 |
|
---|
884 | }
|
---|
885 |
|
---|
886 | private DockPaneStripBase.Tab m_tab = null;
|
---|
887 | internal DockPaneStripBase.Tab GetTab(DockPaneStripBase dockPaneStrip)
|
---|
888 | {
|
---|
889 | if (m_tab == null)
|
---|
890 | m_tab = dockPaneStrip.CreateTab(Content);
|
---|
891 |
|
---|
892 | return m_tab;
|
---|
893 | }
|
---|
894 |
|
---|
895 | private IDisposable m_autoHideTab = null;
|
---|
896 | internal IDisposable AutoHideTab
|
---|
897 | {
|
---|
898 | get { return m_autoHideTab; }
|
---|
899 | set { m_autoHideTab = value; }
|
---|
900 | }
|
---|
901 |
|
---|
902 | #region Events
|
---|
903 | private static readonly object DockStateChangedEvent = new object();
|
---|
904 | public event EventHandler DockStateChanged
|
---|
905 | {
|
---|
906 | add { Events.AddHandler(DockStateChangedEvent, value); }
|
---|
907 | remove { Events.RemoveHandler(DockStateChangedEvent, value); }
|
---|
908 | }
|
---|
909 | protected virtual void OnDockStateChanged(EventArgs e)
|
---|
910 | {
|
---|
911 | EventHandler handler = (EventHandler)Events[DockStateChangedEvent];
|
---|
912 | if (handler != null)
|
---|
913 | handler(this, e);
|
---|
914 | }
|
---|
915 | #endregion
|
---|
916 |
|
---|
917 | private void Form_Disposed(object sender, EventArgs e)
|
---|
918 | {
|
---|
919 | Dispose();
|
---|
920 | }
|
---|
921 |
|
---|
922 | private void Form_TextChanged(object sender, EventArgs e)
|
---|
923 | {
|
---|
924 | if (DockHelper.IsDockStateAutoHide(DockState))
|
---|
925 | DockPanel.RefreshAutoHideStrip();
|
---|
926 | else if (Pane != null)
|
---|
927 | {
|
---|
928 | if (Pane.FloatWindow != null)
|
---|
929 | Pane.FloatWindow.SetText();
|
---|
930 | Pane.RefreshChanges();
|
---|
931 | }
|
---|
932 | }
|
---|
933 |
|
---|
934 | private bool m_flagClipWindow = false;
|
---|
935 | internal bool FlagClipWindow
|
---|
936 | {
|
---|
937 | get { return m_flagClipWindow; }
|
---|
938 | set
|
---|
939 | {
|
---|
940 | if (m_flagClipWindow == value)
|
---|
941 | return;
|
---|
942 |
|
---|
943 | m_flagClipWindow = value;
|
---|
944 | if (m_flagClipWindow)
|
---|
945 | Form.Region = new Region(Rectangle.Empty);
|
---|
946 | else
|
---|
947 | Form.Region = null;
|
---|
948 | }
|
---|
949 | }
|
---|
950 |
|
---|
951 | private ContextMenuStrip m_tabPageContextMenuStrip = null;
|
---|
952 | public ContextMenuStrip TabPageContextMenuStrip
|
---|
953 | {
|
---|
954 | get { return m_tabPageContextMenuStrip; }
|
---|
955 | set { m_tabPageContextMenuStrip = value; }
|
---|
956 | }
|
---|
957 |
|
---|
958 | #region IDockDragSource Members
|
---|
959 |
|
---|
960 | Control IDragSource.DragControl
|
---|
961 | {
|
---|
962 | get { return Form; }
|
---|
963 | }
|
---|
964 |
|
---|
965 | bool IDockDragSource.CanDockTo(DockPane pane)
|
---|
966 | {
|
---|
967 | if (!IsDockStateValid(pane.DockState))
|
---|
968 | return false;
|
---|
969 |
|
---|
970 | if (Pane == pane && pane.DisplayingContents.Count == 1)
|
---|
971 | return false;
|
---|
972 |
|
---|
973 | return true;
|
---|
974 | }
|
---|
975 |
|
---|
976 | Rectangle IDockDragSource.BeginDrag(Point ptMouse)
|
---|
977 | {
|
---|
978 | Size size;
|
---|
979 | DockPane floatPane = this.FloatPane;
|
---|
980 | if (DockState == DockState.Float || floatPane == null || floatPane.FloatWindow.NestedPanes.Count != 1)
|
---|
981 | size = DockPanel.DefaultFloatWindowSize;
|
---|
982 | else
|
---|
983 | size = floatPane.FloatWindow.Size;
|
---|
984 |
|
---|
985 | Point location;
|
---|
986 | Rectangle rectPane = Pane.ClientRectangle;
|
---|
987 | if (DockState == DockState.Document)
|
---|
988 | {
|
---|
989 | if (Pane.DockPanel.DocumentTabStripLocation == DocumentTabStripLocation.Bottom)
|
---|
990 | location = new Point(rectPane.Left, rectPane.Bottom - size.Height);
|
---|
991 | else
|
---|
992 | location = new Point(rectPane.Left, rectPane.Top);
|
---|
993 | }
|
---|
994 | else
|
---|
995 | {
|
---|
996 | location = new Point(rectPane.Left, rectPane.Bottom);
|
---|
997 | location.Y -= size.Height;
|
---|
998 | }
|
---|
999 | location = Pane.PointToScreen(location);
|
---|
1000 |
|
---|
1001 | if (ptMouse.X > location.X + size.Width)
|
---|
1002 | location.X += ptMouse.X - (location.X + size.Width) + Measures.SplitterSize;
|
---|
1003 |
|
---|
1004 | return new Rectangle(location, size);
|
---|
1005 | }
|
---|
1006 |
|
---|
1007 | void IDockDragSource.EndDrag()
|
---|
1008 | {
|
---|
1009 | }
|
---|
1010 |
|
---|
1011 | public void FloatAt(Rectangle floatWindowBounds)
|
---|
1012 | {
|
---|
1013 | DockPane pane = DockPanel.DockPaneFactory.CreateDockPane(Content, floatWindowBounds, true);
|
---|
1014 | }
|
---|
1015 |
|
---|
1016 | public void DockTo(DockPane pane, DockStyle dockStyle, int contentIndex)
|
---|
1017 | {
|
---|
1018 | if (dockStyle == DockStyle.Fill)
|
---|
1019 | {
|
---|
1020 | bool samePane = (Pane == pane);
|
---|
1021 | if (!samePane)
|
---|
1022 | Pane = pane;
|
---|
1023 |
|
---|
1024 | if (contentIndex == -1 || !samePane)
|
---|
1025 | pane.SetContentIndex(Content, contentIndex);
|
---|
1026 | else
|
---|
1027 | {
|
---|
1028 | DockContentCollection contents = pane.Contents;
|
---|
1029 | int oldIndex = contents.IndexOf(Content);
|
---|
1030 | int newIndex = contentIndex;
|
---|
1031 | if (oldIndex < newIndex)
|
---|
1032 | {
|
---|
1033 | newIndex += 1;
|
---|
1034 | if (newIndex > contents.Count -1)
|
---|
1035 | newIndex = -1;
|
---|
1036 | }
|
---|
1037 | pane.SetContentIndex(Content, newIndex);
|
---|
1038 | }
|
---|
1039 | }
|
---|
1040 | else
|
---|
1041 | {
|
---|
1042 | DockPane paneFrom = DockPanel.DockPaneFactory.CreateDockPane(Content, pane.DockState, true);
|
---|
1043 | INestedPanesContainer container = pane.NestedPanesContainer;
|
---|
1044 | if (dockStyle == DockStyle.Left)
|
---|
1045 | paneFrom.DockTo(container, pane, DockAlignment.Left, 0.5);
|
---|
1046 | else if (dockStyle == DockStyle.Right)
|
---|
1047 | paneFrom.DockTo(container, pane, DockAlignment.Right, 0.5);
|
---|
1048 | else if (dockStyle == DockStyle.Top)
|
---|
1049 | paneFrom.DockTo(container, pane, DockAlignment.Top, 0.5);
|
---|
1050 | else if (dockStyle == DockStyle.Bottom)
|
---|
1051 | paneFrom.DockTo(container, pane, DockAlignment.Bottom, 0.5);
|
---|
1052 |
|
---|
1053 | paneFrom.DockState = pane.DockState;
|
---|
1054 | }
|
---|
1055 | }
|
---|
1056 |
|
---|
1057 | public void DockTo(DockPanel panel, DockStyle dockStyle)
|
---|
1058 | {
|
---|
1059 | if (panel != DockPanel)
|
---|
1060 | throw new ArgumentException(Strings.IDockDragSource_DockTo_InvalidPanel, "panel");
|
---|
1061 |
|
---|
1062 | DockPane pane;
|
---|
1063 |
|
---|
1064 | if (dockStyle == DockStyle.Top)
|
---|
1065 | pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.DockTop, true);
|
---|
1066 | else if (dockStyle == DockStyle.Bottom)
|
---|
1067 | pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.DockBottom, true);
|
---|
1068 | else if (dockStyle == DockStyle.Left)
|
---|
1069 | pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.DockLeft, true);
|
---|
1070 | else if (dockStyle == DockStyle.Right)
|
---|
1071 | pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.DockRight, true);
|
---|
1072 | else if (dockStyle == DockStyle.Fill)
|
---|
1073 | pane = DockPanel.DockPaneFactory.CreateDockPane(Content, DockState.Document, true);
|
---|
1074 | else
|
---|
1075 | return;
|
---|
1076 | }
|
---|
1077 |
|
---|
1078 | #endregion
|
---|
1079 | }
|
---|
1080 | }
|
---|