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

            newRegion.Enable = false;
            ThemeGraphRegionSetting.SaveThemeGraphRegion(newRegion);
        }
コード例 #2
0
        void cancelRegion_Click(object sender, EventArgs e)
        {
            _btnSetThemeGraphRegion.Text = "无范围应用";
            ThemeGraphRegion region = (sender as RadMenuItem).Tag as ThemeGraphRegion;

            region.Enable = false;
            ThemeGraphRegionSetting.SaveThemeGraphRegion(region);
        }
コード例 #3
0
        void menu_Click(object sender, EventArgs e)
        {
            int?index = (sender as RadMenuItem).Tag as int?;
            ThemeGraphRegion region = ((sender as RadMenuItem).Owner as RadDropDownButtonElement).Tag as ThemeGraphRegion;

            region.Enable                = true;
            region.SelectedIndex         = index.Value;
            _btnSetThemeGraphRegion.Text = region.PrjEnvelopeItems[index.Value].Name;
            ThemeGraphRegionSetting.SaveThemeGraphRegion(region);
        }
コード例 #4
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();
        }
コード例 #5
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;
            }
        }
コード例 #6
0
        void regionFromAoi_Click(object sender, EventArgs e)
        {
            if (_session.SmartWindowManager.ActiveCanvasViewer == null)
            {
                return;
            }
            AOIItem[] aoiItems = _session.SmartWindowManager.ActiveCanvasViewer.AOIProvider.GetAOIItems();
            if (aoiItems == null || aoiItems.Length == 0)
            {
                return;
            }
            CoordEnvelope    env    = aoiItems[0].GeoEnvelope;
            ThemeGraphRegion region = (sender as RadMenuItem).Tag as ThemeGraphRegion;

            region.Add(new PrjEnvelopeItem("AOI", new PrjEnvelope(env.MinX, env.MaxX, env.MinY, env.MaxY)));
            ThemeGraphRegionSetting.SaveThemeGraphRegion(region);
            UpdateBtn();
        }
コード例 #7
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);
        }
コード例 #8
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();
 }
コード例 #9
0
 private void SaveRegion()
 {
     _region.PrjEnvelopeItems = _items.ToArray();
     ThemeGraphRegionSetting.SaveThemeGraphRegion(_region);
 }