private void ClearCurrentProperties() { if (currentProperties == null) { return; } currentProperties.CleanUp(); currentProperties.Dispose(); currentProperties = null; }
private void RefreshPropertiesPane() { if (treeView1.SelectedNode == null) return; InventoryBase io = (InventoryBase)treeView1.SelectedNode.Tag; if (io is InventoryItem) { panel2.Visible = false; //InventoryImageConsole.vi InventoryItemConsole console = new InventoryItemConsole(instance, (InventoryItem)io); console.Dock = DockStyle.Fill; splitContainer1.Panel2.Controls.Add(console); ClearCurrentProperties(); //ClearAutoProperties(); currentProperties = console; InventoryItem item = (InventoryItem)io; //item.InventoryType try { if (item.InventoryType == InventoryType.Wearable || item.InventoryType == InventoryType.Attachment || item.InventoryType == InventoryType.Object) { console.Controls["btnDetach"].Visible = true; console.Controls["btnWear"].Visible = true; console.Controls["btnTP"].Visible = false; } else if (item.InventoryType == InventoryType.Landmark) { console.Controls["btnTP"].Visible = true; } else { console.Controls["btnDetach"].Visible = false; console.Controls["btnWear"].Visible = false; console.Controls["btnTP"].Visible = false; } console.Controls["btnGive"].Visible = true; } catch (Exception ex) { // do nothing } } else { if (ShowAuto) { panel2.Visible = true; textBox2.Text = io.Name.ToString(); ClearCurrentProperties(); } else { ClearCurrentProperties(); } } }
private void ClearCurrentProperties() { if (currentProperties == null) return; currentProperties.CleanUp(); currentProperties.Dispose(); currentProperties = null; }
private void RefreshPropertiesPane() { if (treeView1.SelectedNode == null) { return; } InventoryBase io = (InventoryBase)treeView1.SelectedNode.Tag; if (io is InventoryItem) { panel2.Visible = false; //InventoryImageConsole.vi InventoryItemConsole console = new InventoryItemConsole(instance, (InventoryItem)io); console.Dock = DockStyle.Fill; splitContainer1.Panel2.Controls.Add(console); ClearCurrentProperties(); //ClearAutoProperties(); currentProperties = console; InventoryItem item = (InventoryItem)io; //item.InventoryType try { if (item.InventoryType == InventoryType.Wearable || item.InventoryType == InventoryType.Attachment || item.InventoryType == InventoryType.Object) { console.Controls["btnDetach"].Visible = true; console.Controls["btnWear"].Visible = true; console.Controls["btnTP"].Visible = false; } else if (item.InventoryType == InventoryType.Landmark) { console.Controls["btnTP"].Visible = true; } else { console.Controls["btnDetach"].Visible = false; console.Controls["btnWear"].Visible = false; console.Controls["btnTP"].Visible = false; } console.Controls["btnGive"].Visible = true; } catch (Exception ex) { // do nothing } } else { if (ShowAuto) { panel2.Visible = true; textBox2.Text = io.Name.ToString(); ClearCurrentProperties(); } else { ClearCurrentProperties(); } } }