private void ActionAddCustomProperty(object sender, EventArgs e) { if (treeView1.SelectedNode.Tag is Item) { Item i = (Item)treeView1.SelectedNode.Tag; AddCustomProperty form = new AddCustomProperty(i.CustomProperties); form.ShowDialog(); } if (treeView1.SelectedNode.Tag is root) { root l = (root)treeView1.SelectedNode.Tag; AddCustomProperty form = new AddCustomProperty(l.CustomProperties); form.ShowDialog(); } if (treeView1.SelectedNode.Tag is Layer) { Layer l = (Layer)treeView1.SelectedNode.Tag; AddCustomProperty form = new AddCustomProperty(l.CustomProperties); form.ShowDialog(); } if (treeView1.SelectedNode.Tag is CustomNode) { } propertyGrid1.Refresh(); }
private void customPropertyAddButton_Click(object sender, EventArgs e) { if (Editor.Instance.SelectedItems.Count == 0) { MessageBox.Show("select some items first"); return; } SerializableDictionary props = new SerializableDictionary(); AddCustomProperty form = new AddCustomProperty(props); form.ShowDialog(); foreach (String key in props.Keys) { CustomProperty cp = props[key]; foreach (Item selitem in Editor.Instance.SelectedItems) { selitem.CustomProperties.Add(key, cp.clone()); } } }
private void ActionAddCustomProperty(object sender, EventArgs e) { if (treeView1.SelectedNode.Tag is Item) { Item i = (Item)treeView1.SelectedNode.Tag; AddCustomProperty form = new AddCustomProperty(i.CustomProperties); form.ShowDialog(); } if (treeView1.SelectedNode.Tag is Level) { Level l = (Level)treeView1.SelectedNode.Tag; AddCustomProperty form = new AddCustomProperty(l.CustomProperties); form.ShowDialog(); } if (treeView1.SelectedNode.Tag is Layer) { Layer l = (Layer)treeView1.SelectedNode.Tag; AddCustomProperty form = new AddCustomProperty(l.CustomProperties); form.ShowDialog(); } propertyGrid1.Refresh(); }