Beispiel #1
0
 public void EnableProjectView(NFXProject pr)
 {
     if (this.pluginUI == null)
     {
         CreatePluginPanel();
     }
     this.project          = pr;
     this.pluginUI.Project = pr;
 }
Beispiel #2
0
        /// <summary>
        /// Creates a plugin panel for the plugin
        /// </summary>
        public void CreateNewProject(Object sender, System.EventArgs e)
        {
            SaveFileDialog dialog = new SaveFileDialog();

            dialog.DefaultExt = "as3nfx";
            dialog.Filter     = "AS3 NFX Template Project (*.as3nfx)|*.as3nfx";
            if (dialog.ShowDialog() == DialogResult.OK)
            {
                Console.WriteLine(dialog.FileName);
                if (dialog.FileName != "")
                {
                    //String template = (String)TemplateGenerator.ProjectSettings.Clone();
                    FileInfo fi = new FileInfo(@dialog.FileName);
                    //FileStream fs = fi.OpenWrite();
                    //fs.WriteByte(0xEF);
                    //fs.WriteByte(0xBB);
                    //fs.WriteByte(0xBF);
                    //UTF8Encoding enc = new UTF8Encoding();
                    //byte[] bytes = enc.GetBytes(template);
                    //fs.Write(bytes, 0, bytes.Length);
                    //fs.Close();
                    DirectoryInfo di = new DirectoryInfo(Path.Combine(fi.Directory.FullName, "nfx"));
                    if (!di.Exists)
                    {
                        try
                        {
                            di.Create();
                        }
                        catch
                        {
                            Console.WriteLine("Failed to create project folder");
                            // TODO: Need an alert here
                            return;
                        }
                    }
                    //fi = new FileInfo(Path.Combine(di.FullName, "Assets.mxml"));
                    //if (!fi.Exists)
                    //{
                    //fs = fi.OpenWrite();
                    //template = (String)TemplateGenerator.ProjectTemplate.Clone();
                    //bytes = enc.GetBytes(template);
                    //fs.Write(bytes, 0, bytes.Length);
                    //fs.Close();
                    //}
                    project = new NFXProject(di.FullName);
                }
            }
        }
Beispiel #3
0
 public NFXProjectWriter(NFXProject project, string filename)
     : base(project, filename)
 {
     this.project = base.Project as NFXProject;
 }
Beispiel #4
0
 public NFXProjectReader(string path)
     : base(path, new NFXProject(path))
 {
     this.project = base.Project as NFXProject;
 }