Exemple #1
0
        private void CreateButton_Click(object sender, EventArgs e)
        {
            if (projectName1.Text == string.Empty)
            {
                MessageBox.Show("Project name cannot be empty", "Invalid name", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                _create.Addfolder(folder, projectName1.Text, folderPath);

                if (_create.creator)
                {
                    if (_est == null)
                    {
                        var main = new ProjectWindow();
                        var tn   = _create.ADDNode(folder, projectName1.Text, folderPath, main.menu);
                        main.Treeview.Nodes.Add(tn);
                        main.Treeview.SelectedNode = tn;
                        main.Show();
                    }
                    else
                    {
                        var tn = _create.ADDNode(folder, projectName1.Text, folderPath, _menu);
                        folder.Nodes.Add(tn);
                        folder.SelectedNode = tn;
                    }



                    Close();
                }
            }
        }
Exemple #2
0
 public CreateProject(TreeView folder, ProjectWindow est, ContextMenuStrip menu)
 {
     this.folder = folder;
     _est        = est;
     _menu       = menu;
     InitializeComponent();
 }
Exemple #3
0
        private void fastColoredTextBox1_PaintLine(object sender, PaintLineEventArgs e)
        {
            int i = 0;

            while (i < _line.Length)
            {
                if (e.LineIndex == _line[i])
                {
                    var projectWindow = new ProjectWindow();
                    //projectWindow.Populate("");
                    Brush brush;
                    using (brush = new LinearGradientBrush(new Rectangle(0, e.LineRect.Top, 15, 15), Color.LightPink,
                                                           Color.Red, 45))
                        e.Graphics.FillEllipse(brush, 0, e.LineRect.Top, 15, 15);
                    var x = 0;
                    while (x <= i)
                    {
                        projectWindow.feedback.Text += _error[x];
                        //  projectWindow.Populate(projectWindow.feedback.Text);
                        //  _fochild.Errortext.Text += feedback.Text;
                        x++;
                    }
                }

                i++;
            }
        }
Exemple #4
0
        private void Open_new_project_Click(object sender, EventArgs e)
        {
            var editor = new ProjectWindow();

            var open = new OpenNewProject(editor.Treeview, editor.classcontainer, editor.search, editor.displayhelp);

            open.OpnenNewProject();
            if (open.Flag)
            {
                editor.Show();
            }
            else
            {
                MessageBox.Show("Chosen folder is not a valid project", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                open.Dispose();
            }
        }
Exemple #5
0
        private bool VerifyForm()
        {
            const string caption = "Error";

            if (nameTextBox.Text.Length == 0)
            {
                const string message = "Please give us a name :)";
                MessageBox.Show(message, caption,
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                return(false);
            }
            if (!ProjectWindow.isEmailVaild(emailTextBox.Text))
            {
                const string message = "Not a correct email";
                MessageBox.Show(message, caption,
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
                return(false);
            }
            return(true);
        }
Exemple #6
0
        public void OpnenNewProject()
        {
            var est        = new ProjectWindow();
            var create     = new CreateClassForm(_text1, _display);
            var currentDir = /*Path.GetDirectoryName(Directory.GetCurrentDirectory());
                              * if (string.IsNullOrEmpty(currentDir))
                              * currentDir =*/"C:\\Projects";

            var folderBrowserDialog = new FolderBrowserDialog
            {
                SelectedPath = Path.GetDirectoryName(currentDir) +
                               "\\ESTFProject"
            };

            if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
            {
                _project = folderBrowserDialog.SelectedPath;
                var directoryInfo = new DirectoryInfo(_project);
                var directory     = directoryInfo.GetDirectories();

                if (directory.Length > 0)
                {
                    Flag = false;
                    return;
                }

                var node = _treeView.Nodes.Add(directoryInfo.Name);
                _treeView.SelectedNode = node;
                node.Text       = directoryInfo.Name;
                node.Tag        = directoryInfo.FullName;
                node.ImageIndex = 0;
                foreach (var file in directoryInfo.GetFiles("*.java"))
                {
                    if (file.Exists)
                    {
                        var file1 = _treeView.Nodes[node.Index].Nodes.Add(file.Name);
                        file1.Text               = file.Name;
                        file1.Tag                = file.FullName;
                        file1.ImageIndex         = 1;
                        file1.SelectedImageIndex = 1;
                        //texteditor = new FastColoredTextBox();

                        var texteditor1 = new FastColoredTextBox();
                        //if (texteditor != null)
                        //    texteditor1 = texteditor;
                        texteditor1.PaintLine          += est.fastColoredTextBox1_PaintLine;
                        texteditor1.TextChangedDelayed += est.fastColoredTextBox1_TextChangedDelayed;

                        var text = File.ReadAllText(file.FullName);
                        create.OpenClass(file.Name, _tab, texteditor1, directoryInfo.Name, text, file.FullName);
                    }
                }
                _treeView.SelectedNode = node;
                node.Text       = directoryInfo.Name;
                node.Tag        = directoryInfo.FullName;
                node.ImageIndex = 0;

                Flag = true;
            }
            else
            {
                Flag = false;
            }
        }