示例#1
0
 public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     if (provider != null)
     {
         this.editorService = provider.GetService(typeof(IWindowsFormsEditorService)) as IWindowsFormsEditorService;
     }
     if (this.editorService != null)
     {
         AllList  = StragClass.getObjectListByXml <StragClass>(GlobalClass.ReReadStragList());
         AllPlans = StragRunPlanClass.getObjectListByXml <StragRunPlanClass>(GlobalClass.getStragRunningPlan(true)).ToDictionary(t => t.GUID, t => t);
         List <StragClass> list = AllList.Where(t => AllPlans.ContainsKey(t.GUID) == false).ToList <StragClass>();
         picker = new StragPicker(AllList);//支持一组合对多相同策略
         editorService.ShowDialog(picker);
         if (picker.SelectedStrag == null)
         {
             value = null;
         }
         else
         {
             value = picker.SelectedStrag;
             //picker.Hide();
         }
         ////if (value == null)
         ////{
         ////    picker.Show();
         ////    picker.Visible = true;
         ////}
         ////else
         ////{
         ////}
     }
     return(value);
 }
示例#2
0
        public static Dictionary <string, AssetUnitClass> Init_AssetUnits()
        {
            string strUnits = GlobalClass.ReReadAssetUnitList();
            Dictionary <string, AssetUnitClass> AllStragList = new Dictionary <string, AssetUnitClass>();

            if (strUnits == null || strUnits.Trim().Length == 0)
            {
                ToLog("资产单元列表", "为空!");
                return(AllStragList);
            }
            List <AssetUnitClass> list = StragClass.getObjectListByXml <AssetUnitClass>(strUnits); //StragClass.getStragsByXml(stragList);

            if (list == null)
            {
                return(AllStragList);
            }
            AllStragList = list.ToDictionary(t => t.UnitId, v => v);

            ToLog("资产单元列表", AllStragList.Count.ToString());
            return(AllStragList);
        }
示例#3
0
        public static Dictionary <string, StragClass> Init_StragList()
        {
            string stragList = GlobalClass.ReReadStragList();

            Dictionary <string, StragClass> AllStragList = new Dictionary <string, StragClass>();

            if (stragList == null || stragList.Trim().Length == 0)
            {
                ToLog("策略列表", "为空!");
                return(AllStragList);
            }
            List <StragClass> list = StragClass.getObjectListByXml <StragClass>(stragList); //StragClass.getStragsByXml(stragList);

            if (list == null)
            {
                return(AllStragList);
            }
            AllStragList = list.ToDictionary(t => t.GUID, v => v);

            ToLog("策略列表", AllStragList.Count.ToString());
            return(AllStragList);
        }