-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMaterialItemCollectionEditor.cs
More file actions
83 lines (69 loc) · 3.02 KB
/
MaterialItemCollectionEditor.cs
File metadata and controls
83 lines (69 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#region Imports
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Design;
using System.ComponentModel;
using System.ComponentModel.Design;
using MaterialSkin2Framework;
//using MaterialSkin2Framework.Controls;
using System.Drawing.Text;
using System.Windows.Forms;
using System.Collections;
using System.Collections.ObjectModel;
using System.Runtime.InteropServices;
#endregion Imports
namespace System.Windows.Forms {
public class MaterialItemCollectionEditor : CollectionEditor {
public MaterialItemCollectionEditor() : base(typeof(MaterialItemCollection)) {
}
protected override Type CreateCollectionItemType() {
return typeof(MaterialListBoxItem);
}
protected override Type[] CreateNewItemTypes() {
return new Type[] {
typeof(MaterialListBoxItem)
};
}
}
//public class MaterialItemCollectionEditor : CollectionEditor
//{
// // Define a static event to expose the inner PropertyGrid's
// // PropertyValueChanged event args...
// public delegate void MyPropertyValueChangedEventHandler(object sender,
// PropertyValueChangedEventArgs e);
// public static event MyPropertyValueChangedEventHandler MyPropertyValueChanged;
// // Inherit the default constructor from the standard
// // Collection Editor...
// public MyCollectionEditor(Type type) : base(type) { }
// // Override this method in order to access the containing user controls
// // from the default Collection Editor form or to add new ones...
// protected override CollectionForm CreateCollectionForm()
// {
// // Getting the default layout of the Collection Editor...
// CollectionForm collectionForm = base.CreateCollectionForm();
// Form frmCollectionEditorForm = collectionForm as Form;
// TableLayoutPanel tlpLayout = frmCollectionEditorForm.Controls[0] as TableLayoutPanel;
// if (tlpLayout != null)
// {
// // Get a reference to the inner PropertyGrid and hook
// // an event handler to it.
// if (tlpLayout.Controls[5] is PropertyGrid)
// {
// PropertyGrid propertyGrid = tlpLayout.Controls[5] as PropertyGrid;
// propertyGrid.PropertyValueChanged += new PropertyValueChangedEventHandler(propertyGrid_PropertyValueChanged);
// }
// }
// return collectionForm;
// }
// void propertyGrid_PropertyValueChanged(object sender, PropertyValueChangedEventArgs e)
// {
// // Fire our customized collection event...
// if (MyCollectionEditor.MyPropertyValueChanged != null)
// {
// MyCollectionEditor.MyPropertyValueChanged(this, e);
// }
// }
//}
}