public wImportProject(cProject _project)
        {
            InitializeComponent();
            Owner = G.mainWindow;
            tbSource.Text = _project.path_to_folder;
            project = _project;

        }
 public wProject(cProject p)
 {
     InitializeComponent();
     project=p;
     tbPathExe.Text = p.path_to_exe;
     //tbFolder.Text = p.path_to_folder;
     tbPass.Text = p.pass;
    
 }
 public wProjectOptions(cProject p)
 {
     InitializeComponent();
     this.Owner = G.mainWindow;
     project = p;
     tbPathExe.Text = p.path_to_exe;
     tbGameFolder.Text = p.path_to_folder;
     tbPass.Text = p.pass;
     cbAutorun.IsChecked = p.PressGameStartAfterApplicationRun;
 }
Exemple #4
0
        public static void SaveProject(string p, cProject cp)
        {
            try
            {
                /*   XmlSerializerNamespaces ns = new XmlSerializerNamespaces();
                   ns.Add("", "urn:Abracadabra");
                   ////////////////////////////////////
                   XmlAttributeOverrides xOver = new XmlAttributeOverrides();
                   XmlAttributes xAttrs1 = new XmlAttributes();                
                   XmlRootAttribute xRoot = new XmlRootAttribute() { Namespace = "" };
                   xAttrs1.XmlRoot = xRoot;
                   xOver.Add(typeof(cProject), xAttrs1);
                   XmlAttributes xAttrs2 = new XmlAttributes();
                   var xElt = new XmlElementAttribute(typeof(string)) { Namespace = "" };
                   xAttrs2.XmlElements.Add(xElt);
                
                   XmlAttributes xAttrs11 = new XmlAttributes();
                   XmlRootAttribute xRoot1 = new XmlRootAttribute() { Namespace = "" };
                   xAttrs11.XmlRoot = xRoot1;
                   xOver.Add(typeof(cProject), xAttrs11);
                   XmlAttributes xAttrs22 = new XmlAttributes();
                   var xElt1 = new XmlElementAttribute(typeof(ArrayList)) { Namespace = "" };
                   xAttrs22.XmlElements.Add(xElt1);


                   xOver.Add(typeof(cProject), "file", xAttrs2);
                   xOver.Add(typeof(cProject), "folder", xAttrs22);
                  ////////////*/
                cProject myObject = cp;
                XmlSerializer mySerializer = new XmlSerializer(typeof(cProject));
                StreamWriter myWriter = new StreamWriter(p);
                mySerializer.Serialize(myWriter, myObject);
                myWriter.Close();
            }
            catch (Exception ex) { new wException(ex).ShowDialog(); }
        }
 public FilesAndFolderCount GetFilesRecursive(string b, ref cProject cp)
 {
     string[] ext = tbSearchPattern.Text.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
     for (int i = 0; i < ext.Length; i++) ext[i] = '.' + ext[i].ToLower();
     int filecount = 0;
     int foldercount = 0;
     List<string> result = new List<string>();
     Stack<string> stack = new Stack<string>();
     ArrayList alCurrent = cp.files[0] as ArrayList;
     stack.Push(b);
     while (stack.Count > 0)
     {
         string dir = stack.Pop();
         string path = dir.Remove(0, tbSource.Text.Length);
         if (path.Length > 0)
             alCurrent = CreateFolder(path,ref foldercount);
         try
         {
             result.AddRange(Directory.EnumerateFiles(dir,"*.*"));
             foreach (string fpath in result)
             {
                 if (requiredExt(fpath, ext))
                 {
                     string fname = fpath.Remove(0, tbSource.Text.Length);
                     if (isFileExistInProject(alCurrent, fname) == -1)
                     {
                         filecount++;
                         alCurrent.Add(fname);
                     }
                 }
             }
             result.Clear();
             foreach (string dn in Directory.EnumerateDirectories(dir))
             {
                 stack.Push(dn);
             }
         }
         catch {}
     }
     return new FilesAndFolderCount(filecount, foldercount);
 }