Beispiel #1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button b = (Button)sender;
            if (b.Content.ToString() == "Okay")
            {
                //CurrentToolType = ToolData.ToolTypes.Javascript;
                switch (CurrentToolType)
                {
                    case ToolData.ToolTypes.Javascript:
                        tool.Language = "javascript";
                        tool.Name = CurrentToolType.ToString();
                        break;
                }

                this.Close();
            }
            if (b.Content.ToString() == "Cancel")
            {
                CurrentToolType = ToolData.ToolTypes.None;
                this.Close();
            }
        }
Beispiel #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button b = (Button)sender;

            if (b.Content.ToString() == "Okay")
            {
                //CurrentToolType = ToolData.ToolTypes.Javascript;
                switch (CurrentToolType)
                {
                case ToolData.ToolTypes.Javascript:
                    tool.Language = "javascript";
                    tool.Name     = CurrentToolType.ToString();
                    break;
                }

                this.Close();
            }
            if (b.Content.ToString() == "Cancel")
            {
                CurrentToolType = ToolData.ToolTypes.None;
                this.Close();
            }
        }
Beispiel #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;
                }
            }
        }