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

(-)SplitContainer.cs (+32 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
#endif
149
		#endregion
150
133
		#region Public Constructors
151
		#region Public Constructors
134
		public SplitContainer ()
152
		public SplitContainer ()
135
		{
153
		{
Lines 313-318 Link Here
313
				if (panel1_collapsed != value) {
331
				if (panel1_collapsed != value) {
314
					this.panel1_collapsed = value;
332
					this.panel1_collapsed = value;
315
					panel1.Visible = !value;
333
					panel1.Visible = !value;
334
335
				#region UIA Framework Event: Panel Resized
336
#if NET_2_0
337
					OnUIACanResizeChanged (EventArgs.Empty);
338
#endif
339
				#endregion
340
316
					PerformLayout ();
341
					PerformLayout ();
317
				}
342
				}
318
			}
343
			}
Lines 339-344 Link Here
339
				if (panel2_collapsed != value) {
364
				if (panel2_collapsed != value) {
340
					this.panel2_collapsed = value;
365
					this.panel2_collapsed = value;
341
					panel2.Visible = !value;
366
					panel2.Visible = !value;
367
368
				#region UIA Framework Event: Panel Resized
369
#if NET_2_0
370
					OnUIACanResizeChanged (EventArgs.Empty);
371
#endif
372
				#endregion
373
342
					PerformLayout ();
374
					PerformLayout ();
343
				}
375
				}
344
			}
376
			}
(-)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