Esempio n. 1
0
        public void SetProject(Project project)
        {
            this.project = project;

            SerealizationEvent?.Invoke(this, new SerealizationEventArgs()
            {
                project = this.project
            });
            toolStripButtonBuild.Enabled = true;
            toolStripButtonRun.Enabled   = true;
            tabControlCode.Enabled       = true;
            treeView1.Nodes.Clear();
            tabControlCode.TabPages.Clear();
            var Node = treeView1.Nodes.Add(this.project.Name);

            Node.ContextMenuStrip = contextMenuStripProject;
            Node.SelectedImageKey = "cs_ico.png";
            Node.ImageKey         = "cs_ico.png";
            CNode = Node;

            foreach (var item in this.project.csfile)
            {
                AddFileis(CNode, item);
                AddPageEvent?.Invoke(this, new CSEventArgs()
                {
                    cS = item as CS
                });
            }
        }
Esempio n. 2
0
 public void AddCS(CS cS)
 {
     this.project.csfile.Add(cS);
     SerealizationEvent?.Invoke(this, new SerealizationEventArgs()
     {
         project = this.project
     });
     AddPageEvent?.Invoke(this, new CSEventArgs()
     {
         cS = this.project.csfile[this.project.csfile.Count - 1]
     });
     AddFileis(CNode, this.project.csfile[this.project.csfile.Count - 1]);
 }
Esempio n. 3
0
 public void AddCs(Cs cS)
 {
     if (cS != null)
     {
         _proj.CsFile.Add(cS);
         SerializationEvent?.Invoke(this, new SerializationEventArgs {
             Project = _proj
         });
         AddPageEvent?.Invoke(this, new ProjectEventArgs {
             Cs = _proj.CsFile[_proj.CsFile.Count - 1]
         });
         AddFileIs(_cNode, _proj.CsFile[_proj.CsFile.Count - 1]);
     }
 }
Esempio n. 4
0
 public void AddCS(CS cS)
 {
     if (cS != null)
     {
         this.proj.csfile.Add(cS);
         SerializationEvent?.Invoke(this, new SerializationEventArgs()
         {
             project = this.proj
         });
         AddPageEvent?.Invoke(this, new ProjectEventArgs()
         {
             cS = this.proj.csfile[this.proj.csfile.Count - 1]
         });
         AddFileIs(CNode, this.proj.csfile[this.proj.csfile.Count - 1]);
     }
 }
Esempio n. 5
0
        public void GetProject(Project project)
        {
            this.proj = project;

            string xmlFile = project.Path + @"\" + project.Name + ".mysln";

            XmlTextWriter xmlWriter = new XmlTextWriter(xmlFile, null);

            xmlWriter.WriteStartDocument();
            xmlWriter.WriteStartElement("project");
            xmlWriter.WriteAttributeString("name", project.Name);
            xmlWriter.WriteStartElement("outputfile");
            xmlWriter.WriteAttributeString("path", project.Name + ".exe");
            xmlWriter.WriteEndElement();

            foreach (var item in project.csfile)
            {
                xmlWriter.WriteStartElement("csfile");
                xmlWriter.WriteAttributeString("path", item.Path);
                xmlWriter.WriteAttributeString("name", item.Name);
                xmlWriter.WriteEndElement();
            }

            xmlWriter.WriteEndDocument();
            xmlWriter.Close();

            Build_ToolStripButton.Enabled = true;
            Run_ToolStripButton.Enabled   = true;
            tabControlCode.Enabled        = true;
            ProjectExplorerTreeView.Nodes.Clear();
            tabControlCode.TabPages.Clear();
            var Node = ProjectExplorerTreeView.Nodes.Add(this.proj.Name);

            Node.ContextMenuStrip = contextMenuStripProject;
            CNode = Node;

            foreach (var item in this.proj.csfile)
            {
                AddFileIs(CNode, item);
                AddPageEvent?.Invoke(this, new ProjectEventArgs()
                {
                    cS = item as CS
                });
            }
        }