private void InitThemeGraphRegion() { //初始化当前区域设置为“无范围应用” ThemeGraphRegion newRegion = ThemeGraphRegionSetting.GetThemeGraphRegion(_productIdentify); newRegion.Enable = false; ThemeGraphRegionSetting.SaveThemeGraphRegion(newRegion); }
private void UpdateSession() { string productIdentify = (_session.MonitoringSession as IMonitoringSession).ActiveMonitoringProduct.Identify; ThemeGraphRegion newRegion = ThemeGraphRegionSetting.GetThemeGraphRegion(productIdentify); _region = newRegion; if (_region.PrjEnvelopeItems != null && _region.PrjEnvelopeItems.Length != 0) { _items = new List <PrjEnvelopeItem>(_region.PrjEnvelopeItems); } LoadUserDefinedRegion(); }
private void UpdateBtn() { ThemeGraphRegion newRegion = ThemeGraphRegionSetting.GetThemeGraphRegion(_productIdentify); if (newRegion == null || !newRegion.Enable || newRegion.PrjEnvelopeItems == null || newRegion.SelectedIndex >= newRegion.PrjEnvelopeItems.Length) { _btnSetThemeGraphRegion.Text = "无范围应用"; } else { _btnSetThemeGraphRegion.Text = newRegion.PrjEnvelopeItems[newRegion.SelectedIndex].Name; } }
private void LoadThemeGraphRegion() { _btnSetThemeGraphRegion.Items.Clear(); ThemeGraphRegion region = ThemeGraphRegionSetting.GetThemeGraphRegion(_productIdentify); _btnSetThemeGraphRegion.Tag = region; if (region != null) { bool enable = region.Enable; int selectedIndex = region.SelectedIndex; PrjEnvelopeItem[] items = region.PrjEnvelopeItems; if (items != null) { for (int i = 0; i < items.Length; i++) { PrjEnvelopeItem item = items[i]; RadMenuItem menu = new RadMenuItem(); menu.Text = item.Name; menu.Tag = i; menu.Click += new EventHandler(menu_Click); if (enable && selectedIndex == i) { _btnSetThemeGraphRegion.Text = item.Name; menu.IsChecked = true; } _btnSetThemeGraphRegion.Items.Add(menu); } _btnSetThemeGraphRegion.Items.Add(new RadMenuSeparatorItem()); RadMenuItem cancelRegion = new RadMenuItem("取消范围应用"); cancelRegion.Tag = region; cancelRegion.Click += new EventHandler(cancelRegion_Click); _btnSetThemeGraphRegion.Items.Add(cancelRegion); } } _btnSetThemeGraphRegion.Items.Add(new RadMenuSeparatorItem()); RadMenuItem editRegion = new RadMenuItem("编辑范围"); editRegion.Click += new EventHandler(editRegion_Click); editRegion.Tag = region; _btnSetThemeGraphRegion.Items.Add(editRegion); }
private void LoadUserDefinedRegion() { _tree.Nodes.Clear(); _region = ThemeGraphRegionSetting.GetThemeGraphRegion(_region.ProductIdentify); PrjEnvelopeItem[] items = _region.PrjEnvelopeItems; if (_region.PrjEnvelopeItems != null && _region.PrjEnvelopeItems.Length != 0) { _items = new List <PrjEnvelopeItem>(_region.PrjEnvelopeItems); } foreach (PrjEnvelopeItem item in _items) { RadTreeNode node = new RadTreeNode(item.Name); node.Tag = item; _tree.Nodes.Add(node); } if (_tree.Nodes.Count != 0) { _tree.SelectedNode = _tree.Nodes[0]; } _tree.ExpandAll(); }