Пример #1
0
        private void LoadProduct()
        {
            ThemeDef def = MonitoringThemeFactory.GetAllThemes()[0];//"CMA"

            ProductDef[] products = def.Products;
            foreach (ProductDef prd in products)
            {
                if (string.IsNullOrWhiteSpace(prd.Name))
                {
                    continue;
                }
                string name = prd.Name.Replace(" ", "");
                if (_productDic.ContainsKey(name))
                {
                    continue;
                }
                _productDic.Add(name, prd.Identify);
            }
            comboBox4.Items.Clear();
            foreach (string product in _productDic.Keys)
            {
                comboBox4.Items.Add(product);
            }
            comboBox4.SelectedItem = comboBox1.Items[0];
        }
Пример #2
0
        private void TrySetProductDicName(ProductDic[] productDics)
        {
            ThemeDef def = MonitoringThemeFactory.GetAllThemes()[0];//"CMA"

            foreach (ProductDic prd in productDics)
            {
                MIF.Core.ProductDef prdDef = def.GetProductDefByIdentify(prd.ProductIdentify);
                if (prdDef != null)
                {
                    prd.ProductName = prdDef.Name.Replace(" ", "");
                }
                else
                {
                    prd.ProductName = prd.ProductIdentify;
                }
            }
        }
Пример #3
0
        private void CreateRibbonBar()
        {
            Padding productPadding = new Padding(0, 5, 0, 0);

            ThemeDef[] ths = MonitoringThemeFactory.GetAllThemes();
            Dictionary <string, RadRibbonBarGroup> dic = new Dictionary <string, RadRibbonBarGroup>();

            _tempButtons = new List <RadButtonElement>();
            foreach (ThemeDef theme in ths)
            {
                if (theme == null || theme.Products == null || theme.Products.Length == 0)
                {
                    continue;
                }
                #region 监测专题产品
                foreach (ProductDef item in theme.Products)
                {
                    //这里需要将没加载成功的产品过滤掉。
                    if (HasProduct(item.Identify))
                    {
                        RadButtonElement btn = new RadButtonElement(item.Name);
                        btn.Tag            = item;
                        btn.ImageAlignment = ContentAlignment.TopCenter;
                        btn.TextAlignment  = ContentAlignment.BottomCenter;
                        btn.Padding        = productPadding;
                        btn.Click         += new EventHandler(btn_Click);
                        if (dic.ContainsKey(item.Group))
                        {
                            dic[item.Group].Items.Add(btn);
                        }
                        else
                        {
                            dic.Add(item.Group, new RadRibbonBarGroup());
                            dic[item.Group].Text = item.Group;
                            dic[item.Group].Items.Add(btn);
                        }
                        _tempButtons.Add(btn);
                    }
                }
                #endregion 监测专题产品
            }

            //RadRibbonBarGroup rbgUserDef = new RadRibbonBarGroup();
            //rbgUserDef.Text = "自定义";
            //btnNewProduct.Text = "扩展专题产品";
            //btnNewProduct.TextAlignment = ContentAlignment.BottomCenter;
            //btnNewProduct.Margin = new Padding(0, 5, 0, 0);
            //btnNewProduct.ImageAlignment = ContentAlignment.TopCenter;
            //rbgUserDef.Items.Add(btnNewProduct);

            #region 图像增强方案
            _rbgzq      = new RadRibbonBarGroup();
            _rbgzq.Text = "图像增强方案";
            btnSaveEnhance.TextAlignment  = ContentAlignment.BottomCenter;
            btnSaveEnhance.ImageAlignment = ContentAlignment.TopCenter;
            btnSaveEnhance.Margin         = new Padding(0, 5, 0, 0);
            btnSaveEnhance.Click         += new EventHandler(btnSaveEnhance_Click);
            _rbgzq.Items.Add(btnSaveEnhance);

            //galItemList.Add(new RadGalleryItem("     火情\nFY2D_VISSR\n    夏上午"));
            //galItemList.Add(new RadGalleryItem("     大雾\nFY2D_VISSR\n    夏下午"));
            //galItemList.Add(new RadGalleryItem("     沙尘\nFY2E_VISSR\n    夏上午"));
            //galItemList.Add(new RadGalleryItem("     暴雨\nFY2E_VISSR\n    夏下午"));

            //修改为从文件夹中查找的方式 modify by wangyu 20121020
            CreatGalleryElement(null, null);
            #endregion

            foreach (RadRibbonBarGroup grp in dic.Values)
            {
                _tab.Items.Add(grp);
            }
            //_tab.Items.Add(rbgUserDef);
            _tab.Items.Add(_rbgzq);
        }