Beispiel #1
0
        public static ToolBoxResult Show(ToolBoxType toolBoxType)
        {
            if (toolBoxType == ToolBoxType.SaveAsPTP)
            {
                if (Settings.AppSetting.Default.SaveAsPTP_NeverAskAgain)
                {
                    return(ToolBoxResult.Ok);
                }

                SaveAsPTP saveAsPTP = new SaveAsPTP();
                saveAsPTP.ShowDialog();
                return(saveAsPTP.Result);
            }
            else if (toolBoxType == ToolBoxType.OpenPTP)
            {
                if (Settings.AppSetting.Default.OpenPTP_NeverAskAgain)
                {
                    return(ToolBoxResult.Ok);
                }

                OpenPTP openPTP = new OpenPTP();
                openPTP.ShowDialog();
                return(openPTP.Result);
            }
            else
            {
                return(ToolBoxResult.None);
            }
        }
Beispiel #2
0
 private IToolBox Create(ToolBoxType boxType)
 {
     var configs = ConfigToolContext.Instance.ToolConfigs.Config.ToolBoxs;
     foreach (var config in configs)
     {
         foreach (var toolConfig in config.Items)
         {
             if (toolConfig.ToolBoxType == boxType.ToString())
             {
                 var result = ObjectUtility.CreateObject<IToolBox>(Assembly.GetExecutingAssembly(),
                     toolConfig.Type, new Type[] { }, new object[] { });
                 return result;
             }
         }
     }
     return null;
 }
Beispiel #3
0
 public IToolBox this[ToolBoxType boxType]
 {
     get
     {
         var key = boxType.ToString();
         IToolBox result = null;
         if (m_ToolBoxs.ContainsKey(key))
         {
             result = m_ToolBoxs[key];
         }
         else
         {
             result = Create(boxType);
             m_ToolBoxs.Add(key, result);
         }
         return result;
     }
 }
Beispiel #4
0
 public String CreateNewName(ToolBoxType boxType)
 {
     var total = graphicsList.Count(s => s.Property.BoxType == boxType);
     return String.Format("{0}{1}", boxType.ToString(), total + 1);
 }