Datei: SimpleMappingTool/PropertyNode.cs
Last Commit (2ee4f7f)
1 | // |
2 | // Copyright (c) 2002-2016 Mirko Matytschak |
3 | // (www.netdataobjects.de) |
4 | // |
5 | // Author: Mirko Matytschak |
6 | // |
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated |
8 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation |
9 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the |
10 | // Software, and to permit persons to whom the Software is furnished to do so, subject to the following |
11 | // conditions: |
12 | |
13 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions |
14 | // of the Software. |
15 | // |
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED |
17 | // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
18 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF |
19 | // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. |
21 | |
22 | |
23 | using System; |
24 | using System.Windows.Forms; |
25 | using NDO; |
26 | using NDO.Mapping; |
27 | |
28 | namespace SimpleMappingTool |
29 | { |
30 | ····/// <summary> |
31 | ····/// Zusammenfassung für PropertyNode. |
32 | ····/// </summary> |
33 | ····internal class PropertyNode : NDOTreeNode |
34 | ····{ |
35 | ········NDOTreeNode parent; |
36 | public PropertyNode( NDOTreeNode parent, Property prop) : base( prop. Name, prop) |
37 | ········{ |
38 | ············this.parent = parent; |
39 | ············this.SelectedImageIndex = 14; |
40 | ············this.ImageIndex = 14; |
41 | ········}········ |
42 | |
43 | public Property Property |
44 | ········{ |
45 | ············get { return this.o as Property; } |
46 | ········} |
47 | |
48 | #if nix |
49 | ········void ChangeProperty(object sender, EventArgs args) |
50 | ········{ |
51 | ············AddPropertyDialog dlg = new AddPropertyDialog(); |
52 | ············dlg.PropName = Property.Name; |
53 | ············dlg.Type = Property.Type; |
54 | ············dlg.Value = Property.Value; |
55 | ············dlg.EditProperty = true; |
56 | ············if (dlg.ShowDialog() == DialogResult.OK) |
57 | ············{ |
58 | ················Property.Type = dlg.Type; |
59 | ················Property.Value = dlg.Value; |
60 | ················MappingNode mn = (MappingNode)parent.Object; |
61 | ················mn.AddProperty(Property); |
62 | ············} |
63 | ············this.TreeView.Refresh();············ |
64 | ········} |
65 | #endif |
66 | ····} |
67 | } |
68 |
New Commit (37eab6b)
1 | // |
2 | // Copyright (c) 2002-2016 Mirko Matytschak |
3 | // (www.netdataobjects.de) |
4 | // |
5 | // Author: Mirko Matytschak |
6 | // |
7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated |
8 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation |
9 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the |
10 | // Software, and to permit persons to whom the Software is furnished to do so, subject to the following |
11 | // conditions: |
12 | |
13 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions |
14 | // of the Software. |
15 | // |
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED |
17 | // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
18 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF |
19 | // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. |
21 | |
22 | |
23 | using System; |
24 | using System.Windows.Forms; |
25 | using NDO; |
26 | using NDO.Mapping; |
27 | |
28 | namespace SimpleMappingTool |
29 | { |
30 | ····/// <summary> |
31 | ····/// Zusammenfassung für PropertyNode. |
32 | ····/// </summary> |
33 | ····internal class PropertyNode : NDOTreeNode |
34 | ····{ |
35 | ········NDOTreeNode parent; |
36 | public PropertyNode( NDOTreeNode parent, Property? prop) : base( prop?. Name??"--", prop) |
37 | ········{ |
38 | ············this.parent = parent; |
39 | ············this.SelectedImageIndex = 14; |
40 | ············this.ImageIndex = 14; |
41 | ········}········ |
42 | |
43 | public Property? Property |
44 | ········{ |
45 | ············get { return this.o as Property; } |
46 | ········} |
47 | |
48 | #if nix |
49 | ········void ChangeProperty(object sender, EventArgs args) |
50 | ········{ |
51 | ············AddPropertyDialog dlg = new AddPropertyDialog(); |
52 | ············dlg.PropName = Property.Name; |
53 | ············dlg.Type = Property.Type; |
54 | ············dlg.Value = Property.Value; |
55 | ············dlg.EditProperty = true; |
56 | ············if (dlg.ShowDialog() == DialogResult.OK) |
57 | ············{ |
58 | ················Property.Type = dlg.Type; |
59 | ················Property.Value = dlg.Value; |
60 | ················MappingNode mn = (MappingNode)parent.Object; |
61 | ················mn.AddProperty(Property); |
62 | ············} |
63 | ············this.TreeView.Refresh();············ |
64 | ········} |
65 | #endif |
66 | ····} |
67 | } |
68 |