Inheritance: System.Windows.Forms.Form
Exemple #1
0
        private void newDMEToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult result;

            result = folderBrowserDialog1.ShowDialog();
            if (result == DialogResult.Cancel)
            {
                return;
            }
            string_dialog S = new string_dialog("Enivorment name:");

            result = S.ShowDialog();
            if (result == DialogResult.Cancel)
            {
                return;
            }
            string name = S.getresult();
            string path = folderBrowserDialog1.SelectedPath;

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            fileInfo     f    = addFile(path, name + ".dm");
            fileInfo     fdme = addFile(path, name + ".dme");
            StreamWriter P    = new StreamWriter(path + "\\" + name + "\\" + name + ".dme");

            P.Write(dme_string);
            P.Close();
            P = new StreamWriter(path + "\\" + name + "\\" + name + ".dm");
            P.Write(dm_string);
            P.Close();
            File.AppendAllText(path + "\\" + name + "\\" + name + ".dme", "\n #include \"" + name + ".dm\"\n // END_INCLUDE");
        }
Exemple #2
0
        private void addNewFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string_dialog S = new string_dialog("Filename:");

            S.ShowDialog();
            if (S.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            string name = S.getresult();
            string ext  = Path.GetExtension(name);

            if (ext == "" || !info.isdm(ext) && !info.issound(ext))
            {
                MessageBox.Show("Wrong fileending");
                return;
            }
            TreeNode tree = (TreeNode)file_list_menu.Tag;
            string   path = tree.FullPath;

            path = path.Replace('/', '\\');
            if (path.IndexOf('\\') != -1)
            {
                path = path.Substring(path.IndexOf('\\'));
                path = info.dir + path + "\\" + name;
            }
            else
            {
                path = info.dir + name;
            }
            if (File.Exists(path))
            {
                return;
            }
            StreamWriter B = File.CreateText(path);

            B.Close();
            info.files.Add(path, new fileInfo(path, tree.FullPath.Replace('/', '\\').Substring(tree.FullPath.IndexOf('/'))));
            TreeNode node = new TreeNode(name);

            node.Tag                = info.files[path];
            node.ImageIndex         = 1;
            node.SelectedImageIndex = 1;
            tree.Nodes.Add(node);
            info.save_dme();
        }
Exemple #3
0
        private void addNewDirectoryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string_dialog S = new string_dialog("Directory name:");

            S.ShowDialog();
            if (S.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            string name = S.getresult();

            /*   string ext = Path.GetExtension(name);
             * if (ext == "" || !info.isdm(ext) && !info.issound(ext))
             * {
             *     MessageBox.Show("Wrong fileending");
             *     return;
             * }*/
            TreeNode tree = (TreeNode)file_list_menu.Tag;
            string   path = tree.FullPath;

            //  path = path.Replace('/', '\\');
            if (path.IndexOf('\\') != -1)
            {
                path = path.Substring(path.IndexOf('\\'));
                path = info.dir + path + "\\" + name;
            }
            else
            {
                path = info.dir + name;
            }
            if (Directory.Exists(path))
            {
                return;
            }
            Directory.CreateDirectory(path);

            string   internalpath = tree.FullPath.Substring(tree.FullPath.Replace('\\', '/').IndexOf('/')) + "/" + name;
            TreeNode newnode      = new TreeNode(name);

            tree.Nodes.Add(newnode);
            info.dirs.Add(name);
            info.dirsfull[internalpath] = name;
            info.save_dme();
        }
Exemple #4
0
        private void newDMEToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DialogResult result;
            result = folderBrowserDialog1.ShowDialog();
            if (result == DialogResult.Cancel)
                return;
            string_dialog S = new string_dialog("Enivorment name:");
            result = S.ShowDialog();
            if (result == DialogResult.Cancel)
                return;
            string name = S.getresult();
            string path = folderBrowserDialog1.SelectedPath;
            if (!Directory.Exists(path))
                Directory.CreateDirectory(path);

            fileInfo f = addFile(path, name + ".dm");
            fileInfo fdme = addFile(path, name + ".dme");
            StreamWriter P = new StreamWriter(path+"\\"+name+"\\" + name + ".dme");
            P.Write(dme_string);
            P.Close();
            P = new StreamWriter(path + "\\" + name + "\\" + name + ".dm");
            P.Write(dm_string);
            P.Close();
            File.AppendAllText(path + "\\" + name + "\\" + name + ".dme", "\n #include \"" + name + ".dm\"\n // END_INCLUDE");
        }
Exemple #5
0
 private void addNewFileToolStripMenuItem_Click(object sender, EventArgs e)
 {
     string_dialog S = new string_dialog("Filename:");
     S.ShowDialog();
     if (S.DialogResult == DialogResult.Cancel)
         return;
     string name = S.getresult();
     string ext = Path.GetExtension(name);
     if (ext == "" || !info.isdm(ext) && !info.issound(ext))
     {
         MessageBox.Show("Wrong fileending");
         return;
     }
     TreeNode tree = (TreeNode)file_list_menu.Tag;
     string path = tree.FullPath;
     path = path.Replace('/', '\\');
     if (path.IndexOf('\\') != -1)
     {
         path = path.Substring(path.IndexOf('\\'));
         path = info.dir + path + "\\" + name;
     }
     else
         path = info.dir + name;
     if (File.Exists(path))
         return;
     StreamWriter B = File.CreateText(path);
     B.Close();
     info.files.Add(path, new fileInfo(path, tree.FullPath.Replace('/', '\\').Substring(tree.FullPath.IndexOf('/'))));
     TreeNode node = new TreeNode(name);
     node.Tag = info.files[path];
     node.ImageIndex = 1;
     node.SelectedImageIndex = 1;
     tree.Nodes.Add(node);
     info.save_dme();
 }
Exemple #6
0
        private void addNewDirectoryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string_dialog S = new string_dialog("Directory name:");
            S.ShowDialog();
            if (S.DialogResult == DialogResult.Cancel)
                return;
            string name = S.getresult();
            /*   string ext = Path.GetExtension(name);
               if (ext == "" || !info.isdm(ext) && !info.issound(ext))
               {
                   MessageBox.Show("Wrong fileending");
                   return;
               }*/
            TreeNode tree = (TreeNode)file_list_menu.Tag;
            string path = tree.FullPath;
            //  path = path.Replace('/', '\\');
            if (path.IndexOf('\\') != -1)
            {
                path = path.Substring(path.IndexOf('\\'));
                path = info.dir + path + "\\" + name;
            }
            else
                path = info.dir + name;
            if (Directory.Exists(path))
                return;
            Directory.CreateDirectory(path);

            string internalpath = tree.FullPath.Substring(tree.FullPath.Replace('\\', '/').IndexOf('/')) + "/" + name;
            TreeNode newnode = new TreeNode(name);
            tree.Nodes.Add(newnode);
            info.dirs.Add(name);
            info.dirsfull[internalpath] = name;
            info.save_dme();
        }