private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { if (e.Node.FullPath != "Root" && !(bool)e.Node.Tag || !(bool)e.Node.Tag) { return; } ObjectDb.Object @object = MKDS_Const.ObjectDatabase.GetObject(e.Node.FullPath); this.label1.Text = @object.ToString(); this.label2.Text = @object.Description; @object.GetPictureAsyc(this.pictureBox1); this.ObjectID = @object.ObjectId; }
private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) { this.changed = true; if (e.ChangedItem.Label == "Name") { this.treeView1.BeginUpdate(); this.treeView1.Nodes.Clear(); MKDS_Const.ObjectDatabase.GetTreeNodes(this.treeView1.Nodes, (string)null); this.treeView1.Sort(); this.treeView1.EndUpdate(); } ObjectDb.Object @object = MKDS_Const.ObjectDatabase.GetObject(((ObjectDb.Object) this.propertyGrid1.SelectedObject).ObjectId); this.label1.Text = @object.ToString(); this.label2.Text = @object.Description; this.pictureBox1.Image = (Image)@object.GetPicture(); }
private void ObjectSelector_Load(object sender, EventArgs e) { this.treeView1.BeginUpdate(); this.treeView1.Nodes.Clear(); MKDS_Const.ObjectDatabase.GetTreeNodes(this.treeView1.Nodes, (string)null); this.treeView1.Sort(); this.treeView1.EndUpdate(); ObjectDb.Object @object = MKDS_Const.ObjectDatabase.GetObject(this.ObjectID); if (@object != null) { this.label1.Text = @object.ToString(); this.label2.Text = @object.Description; @object.GetPictureAsyc(this.pictureBox1); } else { this.label1.Text = "Unknown (" + BitConverter.ToString(BitConverter.GetBytes(this.ObjectID)).Replace("-", "") + ")"; } }
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { if (e.Node.FullPath != "Root" && !(bool)e.Node.Tag) { this.toolStripButton1.Enabled = true; this.toolStripButton2.Enabled = true; this.toolStripButton3.Enabled = true; this.toolStripButton4.Enabled = false; this.toolStripButton5.Enabled = false; this.propertyGrid1.SelectedObject = (object)null; this.label1.Text = ""; this.label2.Text = ""; this.pictureBox1.Image = (Image)null; } else if ((bool)e.Node.Tag) { this.toolStripButton1.Enabled = false; this.toolStripButton2.Enabled = false; this.toolStripButton3.Enabled = false; this.toolStripButton4.Enabled = true; this.toolStripButton5.Enabled = true; ObjectDb.Object @object = MKDS_Const.ObjectDatabase.GetObject(e.Node.FullPath); this.propertyGrid1.SelectedObject = (object)@object; this.label1.Text = @object.ToString(); this.label2.Text = @object.Description; @object.GetPictureAsyc(this.pictureBox1); } else { this.toolStripButton1.Enabled = true; this.toolStripButton2.Enabled = false; this.toolStripButton3.Enabled = false; this.toolStripButton4.Enabled = false; this.toolStripButton5.Enabled = false; this.propertyGrid1.SelectedObject = (object)null; this.label1.Text = ""; this.label2.Text = ""; this.pictureBox1.Image = (Image)null; } }