Mercurial > silverbladetech
annotate SilverlightGlimpse/FloatableWindow/FloatableWindowAutomationPeer.cs @ 71:96e6fbd70f49
Latest version
author | Steven Hollidge <stevenhollidge@hotmail.com> |
---|---|
date | Mon, 23 Apr 2012 14:54:24 +0100 |
parents | a0bcd783e612 |
children |
rev | line source |
---|---|
62
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
1 // (c) Copyright Microsoft Corporation. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
2 // This source is subject to the Microsoft Public License (Ms-PL). |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
3 // Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
4 // All other rights reserved. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
5 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
6 using System.Windows.Automation.Provider; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
7 using System.Windows.Controls; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
8 using System.Windows.Media; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
9 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
10 namespace System.Windows.Automation.Peers |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
11 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
12 public class FloatableWindowAutomationPeer : FrameworkElementAutomationPeer, IWindowProvider, ITransformProvider |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
13 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
14 #region Data |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
15 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
16 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
17 /// Specifies whether the FloatableWindow is the top most element. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
18 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
19 private bool _isTopMost; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
20 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
21 #endregion Data |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
22 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
23 #region Properties |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
24 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
25 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
26 /// Gets or sets a value indicating whether the FloatableWindow is the top most element. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
27 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
28 private bool IsTopMostPrivate |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
29 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
30 get |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
31 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
32 return this._isTopMost; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
33 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
34 set |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
35 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
36 if (this._isTopMost != value) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
37 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
38 this._isTopMost = value; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
39 this.RaisePropertyChangedEvent(WindowPatternIdentifiers.IsTopmostProperty, !this._isTopMost, this._isTopMost); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
40 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
41 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
42 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
43 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
44 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
45 /// Gets the owning FloatableWindow. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
46 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
47 private FloatableWindow OwningFloatableWindow |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
48 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
49 get |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
50 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
51 return (FloatableWindow)Owner; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
52 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
53 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
54 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
55 #endregion Properties |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
56 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
57 public FloatableWindowAutomationPeer(FloatableWindow owner) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
58 : base(owner) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
59 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
60 if (owner == null) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
61 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
62 throw new ArgumentNullException("owner"); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
63 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
64 this.RefreshIsTopMostProperty(); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
65 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
66 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
67 #region AutomationPeer overrides |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
68 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
69 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
70 /// Gets the control pattern for this |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
71 /// <see cref="T:System.Windows.Automation.Peers.FloatableWindowAutomationPeer" />. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
72 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
73 /// <param name="patternInterface"> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
74 /// One of the enumeration values. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
75 /// </param> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
76 /// <returns> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
77 /// The object that implements the pattern interface, or null if the |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
78 /// specified pattern interface is not implemented by this peer. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
79 /// </returns> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
80 public override object GetPattern(PatternInterface patternInterface) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
81 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
82 if (patternInterface == PatternInterface.Transform || patternInterface == PatternInterface.Window) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
83 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
84 return this; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
85 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
86 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
87 return base.GetPattern(patternInterface); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
88 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
89 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
90 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
91 /// Gets the |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
92 /// <see cref="T:System.Windows.Automation.Peers.AutomationControlType" /> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
93 /// for the element associated with this |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
94 /// <see cref="T:System.Windows.Automation.Peers.FloatableWindowAutomationPeer" />. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
95 /// Called by |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
96 /// <see cref="M:System.Windows.Automation.Peers.AutomationPeer.GetAutomationControlType" />. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
97 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
98 /// <returns>A value of the enumeration.</returns> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
99 protected override AutomationControlType GetAutomationControlTypeCore() |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
100 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
101 return AutomationControlType.Window; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
102 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
103 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
104 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
105 /// Gets the name of the class for the object associated with this |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
106 /// <see cref="T:System.Windows.Automation.Peers.FloatableWindowAutomationPeer" />. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
107 /// Called by |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
108 /// <see cref="M:System.Windows.Automation.Peers.AutomationPeer.GetClassName" />. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
109 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
110 /// <returns> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
111 /// A string value that represents the type of the child window. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
112 /// </returns> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
113 protected override string GetClassNameCore() |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
114 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
115 return this.Owner.GetType().Name; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
116 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
117 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
118 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
119 /// Gets the text label of the |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
120 /// <see cref="T:System.Windows.Controls.FloatableWindow" /> that is |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
121 /// associated with this |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
122 /// <see cref="T:System.Windows.Automation.Peers.FloatableWindowAutomationPeer" />. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
123 /// Called by |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
124 /// <see cref="M:System.Windows.Automation.Peers.AutomationPeer.GetName" />. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
125 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
126 /// <returns> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
127 /// The text label of the element that is associated with this |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
128 /// automation peer. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
129 /// </returns> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
130 protected override string GetNameCore() |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
131 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
132 string name = base.GetNameCore(); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
133 if (string.IsNullOrEmpty(name)) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
134 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
135 AutomationPeer labeledBy = GetLabeledByCore(); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
136 if (labeledBy != null) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
137 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
138 name = labeledBy.GetName(); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
139 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
140 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
141 if (string.IsNullOrEmpty(name) && this.OwningFloatableWindow.Title != null) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
142 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
143 name = this.OwningFloatableWindow.Title.ToString(); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
144 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
145 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
146 return name; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
147 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
148 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
149 #endregion AutomationPeer overrides |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
150 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
151 #region IWindowProvider |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
152 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
153 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
154 /// Gets the interaction state of the window. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
155 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
156 /// <value> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
157 /// The interaction state of the control, as a value of the enumeration. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
158 /// </value> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
159 WindowInteractionState IWindowProvider.InteractionState |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
160 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
161 get |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
162 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
163 return this.OwningFloatableWindow.InteractionState; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
164 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
165 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
166 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
167 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
168 /// Gets a value indicating whether the window is modal. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
169 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
170 /// <value> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
171 /// True in all cases. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
172 /// </value> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
173 bool IWindowProvider.IsModal |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
174 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
175 get { return true; } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
176 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
177 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
178 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
179 /// Gets a value indicating whether the window is the topmost |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
180 /// element in the z-order of layout. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
181 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
182 /// <value> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
183 /// True if the window is topmost; otherwise, false. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
184 /// </value> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
185 bool IWindowProvider.IsTopmost |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
186 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
187 get |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
188 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
189 return this.IsTopMostPrivate; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
190 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
191 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
192 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
193 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
194 /// Gets a value indicating whether the window can be maximized. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
195 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
196 /// <value>False in all cases.</value> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
197 bool IWindowProvider.Maximizable |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
198 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
199 get { return false; } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
200 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
201 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
202 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
203 /// Gets a value indicating whether the window can be minimized. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
204 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
205 /// <value>False in all cases.</value> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
206 bool IWindowProvider.Minimizable |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
207 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
208 get { return false; } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
209 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
210 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
211 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
212 /// Gets the visual state of the window. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
213 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
214 /// <value> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
215 /// <see cref="F:System.Windows.Automation.WindowVisualState.Normal" /> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
216 /// in all cases. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
217 /// </value> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
218 WindowVisualState IWindowProvider.VisualState |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
219 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
220 get |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
221 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
222 return WindowVisualState.Normal; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
223 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
224 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
225 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
226 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
227 /// Closes the window. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
228 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
229 void IWindowProvider.Close() |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
230 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
231 this.OwningFloatableWindow.Close(); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
232 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
233 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
234 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
235 /// Changes the visual state of the window (such as minimizing or |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
236 /// maximizing it). |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
237 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
238 /// <param name="state"> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
239 /// The visual state of the window to change to, as a value of the |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
240 /// enumeration. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
241 /// </param> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
242 void IWindowProvider.SetVisualState(WindowVisualState state) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
243 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
244 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
245 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
246 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
247 /// Blocks the calling code for the specified time or until the |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
248 /// associated process enters an idle state, whichever completes first. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
249 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
250 /// <param name="milliseconds"> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
251 /// The amount of time, in milliseconds, to wait for the associated |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
252 /// process to become idle. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
253 /// </param> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
254 /// <returns> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
255 /// True if the window has entered the idle state; false if the timeout |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
256 /// occurred. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
257 /// </returns> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
258 bool IWindowProvider.WaitForInputIdle(int milliseconds) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
259 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
260 return false; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
261 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
262 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
263 #endregion IWindowProvider |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
264 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
265 #region ITransformProvider |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
266 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
267 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
268 /// Moves the control. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
269 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
270 /// <param name="x"> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
271 /// The absolute screen coordinates of the left side of the control. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
272 /// </param> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
273 /// <param name="y"> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
274 /// The absolute screen coordinates of the top of the control. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
275 /// </param> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
276 void ITransformProvider.Move(double x, double y) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
277 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
278 if (x < 0) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
279 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
280 x = 0; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
281 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
282 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
283 if (y < 0) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
284 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
285 y = 0; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
286 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
287 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
288 if (x > this.OwningFloatableWindow.Width) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
289 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
290 x = this.OwningFloatableWindow.Width; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
291 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
292 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
293 if (y > this.OwningFloatableWindow.Height) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
294 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
295 y = this.OwningFloatableWindow.Height; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
296 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
297 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
298 FrameworkElement contentRoot = this.OwningFloatableWindow.ContentRoot; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
299 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
300 if (contentRoot != null) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
301 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
302 GeneralTransform gt = contentRoot.TransformToVisual(null); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
303 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
304 if (gt != null) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
305 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
306 Point p = gt.Transform(new Point(0, 0)); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
307 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
308 TransformGroup transformGroup = contentRoot.RenderTransform as TransformGroup; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
309 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
310 if (transformGroup == null) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
311 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
312 transformGroup = new TransformGroup(); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
313 transformGroup.Children.Add(contentRoot.RenderTransform); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
314 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
315 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
316 TranslateTransform t = new TranslateTransform(); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
317 t.X = x - p.X; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
318 t.Y = y - p.Y; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
319 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
320 if (transformGroup != null) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
321 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
322 transformGroup.Children.Add(t); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
323 contentRoot.RenderTransform = transformGroup; |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
324 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
325 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
326 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
327 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
328 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
329 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
330 /// Resizes the control. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
331 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
332 /// <param name="width">The new width of the window, in pixels.</param> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
333 /// <param name="height"> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
334 /// The new height of the window, in pixels. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
335 /// </param> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
336 void ITransformProvider.Resize(double width, double height) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
337 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
338 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
339 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
340 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
341 /// Rotates the control. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
342 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
343 /// <param name="degrees"> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
344 /// The number of degrees to rotate the control. A positive number |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
345 /// rotates the control clockwise. A negative number rotates the |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
346 /// control counterclockwise. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
347 /// </param> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
348 void ITransformProvider.Rotate(double degrees) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
349 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
350 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
351 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
352 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
353 /// Gets a value indicating whether the element can be moved. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
354 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
355 /// <value>True in all cases.</value> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
356 bool ITransformProvider.CanMove |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
357 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
358 get { return true; } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
359 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
360 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
361 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
362 /// Gets a value indicating whether the element can be resized. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
363 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
364 /// <value>False in all cases.</value> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
365 bool ITransformProvider.CanResize |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
366 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
367 get { return false; } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
368 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
369 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
370 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
371 /// Gets a value indicating whether the element can be rotated. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
372 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
373 /// <value>False in all cases.</value> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
374 bool ITransformProvider.CanRotate |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
375 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
376 get { return false; } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
377 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
378 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
379 #endregion ITransformProvider |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
380 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
381 #region Methods |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
382 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
383 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
384 /// Returns if the FloatableWindow is the top most element. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
385 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
386 /// <returns>Bool value.</returns> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
387 private bool GetIsTopMostCore() |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
388 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
389 return !(this.OwningFloatableWindow.InteractionState == WindowInteractionState.BlockedByModalWindow); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
390 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
391 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
392 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
393 /// Raises PropertyChangedEvent for WindowInteractionStateProperty. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
394 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
395 /// <param name="oldValue">Old WindowInteractionStateProperty.</param> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
396 /// <param name="newValue">New WindowInteractionStateProperty.</param> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
397 internal void RaiseInteractionStatePropertyChangedEvent(WindowInteractionState oldValue, WindowInteractionState newValue) |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
398 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
399 this.RaisePropertyChangedEvent(WindowPatternIdentifiers.WindowInteractionStateProperty, oldValue, newValue); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
400 this.RefreshIsTopMostProperty(); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
401 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
402 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
403 /// <summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
404 /// Updates the IsTopMostPrivate property. |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
405 /// </summary> |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
406 private void RefreshIsTopMostProperty() |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
407 { |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
408 this.IsTopMostPrivate = this.GetIsTopMostCore(); |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
409 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
410 |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
411 #endregion Methods |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
412 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
413 } |
810116cd6b8e
ErrorWindow working
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff
changeset
|
414 |