protected AdditionalSetting(AdditionalSettingTypes type) { NameValue = null; BaseValue = null; BaseUnitValue = null; TypeValue = type; }
public bool IsVisibleFor(NetworkManagerConfigurationUnit unit) { if (unit is NetworkManager && (Visibility & SettingPanelVisibility.Main) == SettingPanelVisibility.Main) return true; else if (unit is Network && (Visibility & SettingPanelVisibility.Network) == SettingPanelVisibility.Network) return true; else if (unit is ServerConfiguration && (Visibility & SettingPanelVisibility.Server) == SettingPanelVisibility.Server) return true; else if ((Visibility & SettingPanelVisibility.All) == SettingPanelVisibility.All) return true; return false; }
private TreeNode TreeNodeFromConfigUnit(NetworkManagerConfigurationUnit unit) { TreeNode result = new TreeNode(unit.Name); result.Tag = unit; if (unit is NetworkManager) { NetworkManager unit2 = (NetworkManager)unit; foreach (Network subUnit in unit2.Networks) { result.Nodes.Add(TreeNodeFromConfigUnit(subUnit)); } } else if (unit is Network) { Network unit2 = (Network)unit; foreach (ServerConfiguration subUnit in unit2.Servers) { result.Nodes.Add(TreeNodeFromConfigUnit(subUnit)); } } return result; }
private void LoadConfigUnit(NetworkManagerConfigurationUnit unit) { SettingTabs.TabPages.Clear(); foreach (TabPage tab in TabPages) { NetworkManagerSettingPanel panel = (NetworkManagerSettingPanel)tab.Controls[0]; if (panel.IsVisibleFor(unit)) { panel.CurrentConfigurationUnit = unit; SettingTabs.TabPages.Add(tab); } } }