예제 #1
0
        private void InitThemeGraphRegion()
        {   //初始化当前区域设置为“无范围应用”
            ThemeGraphRegion newRegion = ThemeGraphRegionSetting.GetThemeGraphRegion(_productIdentify);

            newRegion.Enable = false;
            ThemeGraphRegionSetting.SaveThemeGraphRegion(newRegion);
        }
예제 #2
0
        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();
        }
예제 #3
0
        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;
            }
        }
예제 #4
0
        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);
        }
예제 #5
0
 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();
 }