View | Details | Raw Unified | Return to bug 455950
Collapse All | Expand All

(-)System.Windows.Forms/SplitContainer.cs (-1 / +43 lines)
Lines 130-135 Link Here
130
		}
130
		}
131
		#endregion
131
		#endregion
132
132
133
		#region UIA Framework Events
134
#if NET_2_0
135
		static object UIACanResizeChangedEvent = new object ();
136
137
		internal event EventHandler UIACanResizeChanged {
138
			add { Events.AddHandler (UIACanResizeChangedEvent, value); }
139
			remove { Events.RemoveHandler (UIACanResizeChangedEvent, value); }
140
		}
141
142
		internal void OnUIACanResizeChanged (EventArgs e)
143
		{
144
			EventHandler eh = (EventHandler) Events [UIACanResizeChangedEvent];
145
			if (eh != null)
146
				eh (this, e);
147
		}
148
149
		static object UIACanMoveChangedEvent = new object ();
150
151
		internal event EventHandler UIACanMoveChanged {
152
			add { Events.AddHandler (UIACanMoveChangedEvent, value); }
153
			remove { Events.RemoveHandler (UIACanMoveChangedEvent, value); }
154
		}
155
156
		internal void OnUIACanMoveChanged (EventArgs e)
157
		{
158
			EventHandler eh = (EventHandler) Events [UIACanMoveChangedEvent];
159
			if (eh != null)
160
				eh (this, e);
161
		}
162
#endif
163
		#endregion
164
133
		#region Public Constructors
165
		#region Public Constructors
134
		public SplitContainer ()
166
		public SplitContainer ()
135
		{
167
		{
Lines 250-256 Link Here
250
282
251
		new public DockStyle Dock {
283
		new public DockStyle Dock {
252
			get { return base.Dock; }
284
			get { return base.Dock; }
253
			set { base.Dock = value; }
285
			set {
286
#if NET_2_0
287
				// UIA Framework Event: CanResize changed
288
				OnUIACanResizeChanged (EventArgs.Empty);
289
290
				// UIA Framework Event: CanMove changed
291
				OnUIACanMoveChanged (EventArgs.Empty);
292
#endif
293
294
				base.Dock = value;
295
			}
254
		}
296
		}
255
297
256
		[DefaultValue (FixedPanel.None)]
298
		[DefaultValue (FixedPanel.None)]
(-)System.Windows.Forms/Splitter.cs (+23 lines)
Lines 64-69 Link Here
64
		private Rectangle 		splitter_rectangle_moving;
64
		private Rectangle 		splitter_rectangle_moving;
65
		#endregion	// Local Variables
65
		#endregion	// Local Variables
66
66
67
		#region UIA Framework Events
68
#if NET_2_0
69
		static object UIACanResizeChangedEvent = new object ();
70
71
		internal event EventHandler UIACanResizeChanged {
72
			add { Events.AddHandler (UIACanResizeChangedEvent, value); }
73
			remove { Events.RemoveHandler (UIACanResizeChangedEvent, value); }
74
		}
75
76
		internal void OnUIACanResizeChanged (EventArgs e)
77
		{
78
			EventHandler eh = (EventHandler) Events [UIACanResizeChangedEvent];
79
			if (eh != null)
80
				eh (this, e);
81
		}
82
#endif
83
		#endregion
84
67
		#region Constructors
85
		#region Constructors
68
		static Splitter() {
86
		static Splitter() {
69
			splitter_ns = Cursors.HSplit;
87
			splitter_ns = Cursors.HSplit;
Lines 178-183 Link Here
178
196
179
			set {
197
			set {
180
				if (!Enum.IsDefined (typeof (DockStyle), value) || (value == DockStyle.None) || (value == DockStyle.Fill)) {
198
				if (!Enum.IsDefined (typeof (DockStyle), value) || (value == DockStyle.None) || (value == DockStyle.Fill)) {
199
#if NET_2_0
200
					// UIA Framework Event: CanResize changed
201
					OnUIACanResizeChanged (EventArgs.Empty);
202
#endif
203
181
					throw new ArgumentException("Splitter must be docked left, top, bottom or right");
204
					throw new ArgumentException("Splitter must be docked left, top, bottom or right");
182
				}
205
				}
183
206
(-)System.Windows.Forms/ToolBar.cs (+51 lines)
Lines 1110-1115 Link Here
1110
			private bool redraw;    // Flag if needs to redraw after add/remove operations
1110
			private bool redraw;    // Flag if needs to redraw after add/remove operations
1111
			#endregion
1111
			#endregion
1112
1112
1113
			#region UIA Framework Events
1114
#if NET_2_0
1115
			static object UIACollectionChangedEvent = new object ();
1116
			
1117
			internal event CollectionChangeEventHandler UIACollectionChanged {
1118
				add { owner.Events.AddHandler (UIACollectionChangedEvent, value); }
1119
				remove { owner.Events.RemoveHandler (UIACollectionChangedEvent, value); }
1120
			}
1121
1122
			internal void OnUIACollectionChanged (CollectionChangeEventArgs e)
1123
			{
1124
				CollectionChangeEventHandler eh
1125
					= (CollectionChangeEventHandler) owner.Events [UIACollectionChangedEvent];
1126
				if (eh != null)
1127
					eh (owner, e);
1128
			}
1129
#endif
1130
			#endregion
1131
1113
			#region constructors
1132
			#region constructors
1114
			public ToolBarButtonCollection (ToolBar owner)
1133
			public ToolBarButtonCollection (ToolBar owner)
1115
			{
1134
			{
Lines 1132-1140 Link Here
1132
			public virtual ToolBarButton this [int index] {
1151
			public virtual ToolBarButton this [int index] {
1133
				get { return (ToolBarButton) list [index]; }
1152
				get { return (ToolBarButton) list [index]; }
1134
				set {
1153
				set {
1154
#if NET_2_0
1155
				// UIA Framework Event: Button Removed
1156
				OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Remove, index));
1157
#endif
1158
1135
					value.SetParent (owner);
1159
					value.SetParent (owner);
1136
					list [index] = value;
1160
					list [index] = value;
1137
					owner.Redraw (true);
1161
					owner.Redraw (true);
1162
1163
#if NET_2_0
1164
1165
				// UIA Framework Event: Button Added
1166
				OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, index));
1167
#endif
1138
				}
1168
				}
1139
			}
1169
			}
1140
1170
Lines 1189-1194 Link Here
1189
				result = list.Add (button);
1219
				result = list.Add (button);
1190
				if (redraw)
1220
				if (redraw)
1191
					owner.Redraw (true);
1221
					owner.Redraw (true);
1222
1223
#if NET_2_0
1224
				// UIA Framework Event: Button Added
1225
				OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, result));
1226
#endif
1227
1192
				return result;
1228
				return result;
1193
			}
1229
			}
1194
1230
Lines 1209-1214 Link Here
1209
			{
1245
			{
1210
				list.Clear ();
1246
				list.Clear ();
1211
				owner.Redraw (false);
1247
				owner.Redraw (false);
1248
1249
#if NET_2_0
1250
				// UIA Framework Event: Button Cleared
1251
				OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Refresh, -1));
1252
#endif
1212
			}
1253
			}
1213
1254
1214
			public bool Contains (ToolBarButton button)
1255
			public bool Contains (ToolBarButton button)
Lines 1294-1299 Link Here
1294
			{
1335
			{
1295
				list.Insert (index, button);
1336
				list.Insert (index, button);
1296
				owner.Redraw (true);
1337
				owner.Redraw (true);
1338
1339
#if NET_2_0
1340
				// UIA Framework Event: Button Added
1341
				OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Add, index));
1342
#endif
1297
			}
1343
			}
1298
1344
1299
			public void Remove (ToolBarButton button)
1345
			public void Remove (ToolBarButton button)
Lines 1306-1311 Link Here
1306
			{
1352
			{
1307
				list.RemoveAt (index);
1353
				list.RemoveAt (index);
1308
				owner.Redraw (true);
1354
				owner.Redraw (true);
1355
1356
#if NET_2_0
1357
				// UIA Framework Event: Button Removed
1358
				OnUIACollectionChanged (new CollectionChangeEventArgs (CollectionChangeAction.Remove, index));
1359
#endif
1309
			}
1360
			}
1310
1361
1311
#if NET_2_0
1362
#if NET_2_0

Return to bug 455950