Example #1
0
 public static JavascriptTool ToJavascriptTool(object t)
 {
     try
     {
         JavascriptTool jt = (JavascriptTool)t;
         return(jt);
     }
     catch (Exception ex)
     {
         //TODO: error handling
         return(null);
     }
 }
Example #2
0
        public void AddNewTool()
        {
            NewToolDialog ntd = new NewToolDialog(this);

            ntd.ShowDialog();
            ToolData.ToolTypes tt = ntd.CurrentToolType;

            Tool temp;

            if (CurrentProject != null)
            {
                temp = CurrentProject.Tools.Where(x => x.Language.ToLower() == tt.ToString().ToLower()).FirstOrDefault();
            }
            else
            {
                temp = Tools.Where(x => x.Language.ToLower() == tt.ToString().ToLower()).FirstOrDefault();
            }

            if (temp == null)
            {
                switch (tt)
                {
                case ToolData.ToolTypes.Javascript:
                    JavascriptTool jt = new JavascriptTool();
                    if (CurrentProject != null)
                    {
                        CurrentProject.Tools.Add(jt);
                    }
                    else
                    {
                        Tools.Add(jt);
                    }
                    break;
                }
            }
        }
Example #3
0
        public void AddNewTool()
        {
            NewToolDialog ntd = new NewToolDialog(this);
            ntd.ShowDialog();
            ToolData.ToolTypes tt = ntd.CurrentToolType;

            Tool temp;
            if (CurrentProject != null)
            {
                temp = CurrentProject.Tools.Where(x => x.Language.ToLower() == tt.ToString().ToLower()).FirstOrDefault();
            }
            else
            {
                temp = Tools.Where(x => x.Language.ToLower() == tt.ToString().ToLower()).FirstOrDefault();
            }

            if (temp == null)
            {
                switch (tt)
                {
                    case ToolData.ToolTypes.Javascript:
                        JavascriptTool jt = new JavascriptTool();
                        if (CurrentProject != null)
                        {
                            CurrentProject.Tools.Add(jt);
                        }
                        else
                        {
                            Tools.Add(jt);
                        }
                        break;
                }
            }
        }