Ejemplo n.º 1
0
 public void EnableProjectView(RSXProject pr)
 {
     if (this.pluginUI == null)
     {
         CreatePluginPanel();
     }
     this.project          = pr;
     this.pluginUI.Project = pr;
 }
Ejemplo n.º 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 = "as3rsx";
            dialog.Filter     = "AS3 Resource Project (*.as3rsx)|*.as3rsx";
            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, "rsx"));
                    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 RSXProject(di.FullName);
                    ProjectManager.PluginMain pm = (ProjectManager.PluginMain)PluginBase.MainForm.FindPlugin("30018864-fadd-1122-b2a5-779832cbbf23");
                    //ProjectManager.Projects.AS3.AS3Project
                }
            }
        }
Ejemplo n.º 3
0
 public RSXProjectWriter(RSXProject project, string filename)
     : base(project, filename)
 {
     this.project = base.Project as RSXProject;
 }
Ejemplo n.º 4
0
 public RSXProjectReader(string path)
     : base(path, new RSXProject(path))
 {
     this.project = base.Project as RSXProject;
 }