Beispiel #1
0
        public FileConditionsWidget(FilePropertisData fcd)
        {
            this.Build();
            project = fcd.Project;
            filepath = fcd.Filename;

            fi_old = project.FilesProperty.Find(x => x.SystemFilePath == filepath);

            conditionRules = new List<ConditionRule>();
            conditionRules_Old = new List<ConditionRule>();

            if (fi_old != null)
            if (fi_old.ConditionValues != null)
                conditionRules_Old = fi_old.ConditionValues;

            int rowCount = project.ConditoinsDefine.Count;
            //Table tableSystem = new Table((uint)(2),(uint)2,false);
            Table table = new Table((uint)(rowCount + 3),(uint)2,false);

            GenerateContent(ref table, MainClass.Settings.Platform.Name, 1, MainClass.Settings.Platform,false);//tableSystem
            GenerateContent(ref table, MainClass.Settings.Resolution.Name, 2,MainClass.Settings.Resolution,true); //project.Resolution);//tableSystem
            int i = 3;//1;

            foreach (Condition cd in project.ConditoinsDefine) {

                GenerateContent(ref table, cd.Name, i, cd,false);

                i++;
            }
            vbox2.PackEnd(table, true, true, 0);
            this.ShowAll();
        }
Beispiel #2
0
        public DirPropertyWidget(FilePropertisData fpd)
        {
            project = fpd.Project;
            fiOld = project.FilesProperty.Find(x => x.SystemFilePath == fpd.Filename);
            if (fiOld == null){
                fiOld =new FileItem(fpd.Filename,false);
                fiOld.IsDirectory = true;
                project.FilesProperty.Add(fiOld);
            }
            if (fiOld.ConditionValues == null)
                fiOld.ConditionValues = new System.Collections.Generic.List<ConditionRule>();

            Table mainTable = new Table(2,1,false);
            Table propertyTable = new Table(5,2,false);

            Label lblFN =GetLabel(System.IO.Path.GetFileName(fiOld.SystemFilePath)); // new Label(System.IO.Path.GetFileName(fiOld.SystemFilePath));

            Entry entr = new Entry(fiOld.SystemFilePath);
            entr.IsEditable = false;

            Entry entrFullPath = new Entry(MainClass.Workspace.GetFullPath(fiOld.SystemFilePath));
            entrFullPath.IsEditable = false;

            Label lblPrj = GetLabel(project.ProjectName); //new Label(project.ProjectName);

            AddControl(ref propertyTable,0,lblFN,"Name ");
            AddControl(ref propertyTable,1,entr,"Relative Path ");
            AddControl(ref propertyTable,2,entrFullPath,"Full Path ");
            AddControl(ref propertyTable,3,lblPrj,"Project ");

            int rowCount = project.ConditoinsDefine.Count;
            Table conditionsTable = new Table((uint)(rowCount + 3),(uint)2,false);

            GenerateContent(ref conditionsTable, MainClass.Settings.Platform.Name, 1, MainClass.Settings.Platform,false);//tableSystem
            GenerateContent(ref conditionsTable, MainClass.Settings.Resolution.Name, 2,MainClass.Settings.Resolution,true); //project.Resolution);//tableSystem
            int i = 3;
            foreach (Condition cd in project.ConditoinsDefine) {
                GenerateContent(ref conditionsTable, cd.Name, i, cd,false);
                i++;
            }
            Expander exp1 = new Expander("General");
            exp1.Expanded = true;
            exp1.Add(propertyTable);

            Expander exp2 = new Expander("Conditions");
            exp2.Expanded = true;
            exp2.Add(conditionsTable);

            mainTable.Attach(exp1,0,1,0,1,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Fill,0,0);
            mainTable.Attach(exp2,0,1,1,2,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Fill,0,0);

            this.PackStart(mainTable,true,true,0);
            this.ShowAll();
        }
Beispiel #3
0
        public DirGeneralWidget(FilePropertisData fpd)
        {
            this.Build();

            this.fpd = fpd;
            project = this.fpd.Project;
            filepath = this.fpd.Filename;

            fi_old = project.FilesProperty.Find(x => x.SystemFilePath == filepath);
            if (fi_old == null){
                fi_old =new FileItem(filepath,false);
                project.FilesProperty.Add(fi_old);
            }

            lblName.LabelProp = System.IO.Path.GetFileName(filepath);
            lblRelativePath.LabelProp = filepath;
            lblProject.LabelProp =project.ProjectName;
            lblFullPath.LabelProp = MainClass.Workspace.GetFullPath(filepath);
        }
Beispiel #4
0
 public FileItem ToggleExcludeFile(string filePath)
 {
     FileItem fi = FindFile(filePath);
     if (fi == null) {
         fi = new FileItem(filePath,true);
         FilesProperty.Add(fi);
     } else
         fi.IsExcluded = !fi.IsExcluded;
     return fi;
     /*FileItem fi = new FileItem();
     fi.IsExclude = true;
     fi.FilePath = filePath;
     FilesProperty.Add(fi);*/
 }
Beispiel #5
0
        public FilePropertyWidget(FilePropertisData fpd)
        {
            Project project = fpd.Project;
            fiOld = project.FilesProperty.Find(x => x.SystemFilePath == fpd.Filename);
            if (fiOld == null){
                fiOld =new FileItem(fpd.Filename,false);
                project.FilesProperty.Add(fiOld);
            }
            if (fiOld.ConditionValues == null)
                fiOld.ConditionValues = new System.Collections.Generic.List<ConditionRule>();

            string fullPath = MainClass.Workspace.GetFullPath(fiOld.FilePath);

            string size = "0";
            FileInfo fi = new FileInfo(fullPath);
            if(fi.Exists){
                size =((int)(fi.Length/1024)).ToString() + " KB";
            }

            Table mainTable = new Table(4,1,false);
            Table propertyTable = new Table(5,2,false);

            Label lblFN =GetLabel(System.IO.Path.GetFileName(fiOld.SystemFilePath)); //new Label(System.IO.Path.GetFileName(fiOld.SystemFilePath));
            Label lblSZ =GetLabel(System.IO.Path.GetFileName(size));// new Label(System.IO.Path.GetFileName(size));

            Entry entr = new Entry(fiOld.SystemFilePath);
            entr.IsEditable = false;

            Entry entrFullPath = new Entry(fullPath);
            entrFullPath.IsEditable = false;

            Label lblPrj =GetLabel(project.ProjectName);// new Label(project.ProjectName);

            CheckButton chbExclude = new CheckButton("");
            chbExclude.Active = fiOld.IsExcluded;

            chbExclude.Clicked+=  delegate(object sender, EventArgs e)
            {
                fiOld.IsExcluded = chbExclude.Active;
            };

            AddControl(ref propertyTable,0,lblFN,"Name ");
            AddControl(ref propertyTable,1,lblSZ,"Size ");
            AddControl(ref propertyTable,2,entr,"Relative Path ");
            AddControl(ref propertyTable,3,entrFullPath,"Full Path ");
            AddControl(ref propertyTable,4,lblPrj,"Project ");
            AddControl(ref propertyTable,5,chbExclude,"Exclude ");

            int rowCount = project.ConditoinsDefine.Count;
            Table conditionsTable = new Table((uint)(rowCount + 3),(uint)2,false);

            GenerateContent(ref conditionsTable, MainClass.Settings.Platform.Name, 1, MainClass.Settings.Platform,false);//tableSystem
            GenerateContent(ref conditionsTable, MainClass.Settings.Resolution.Name, 2,MainClass.Settings.Resolution,true); //project.Resolution);//tableSystem
            int i = 3;
            foreach (Condition cd in project.ConditoinsDefine) {
                GenerateContent(ref conditionsTable, cd.Name, i, cd,false);
                i++;
            }

            Expander exp1 = new Expander("General");
            exp1.Expanded = true;
            exp1.Add(propertyTable);

            Expander exp2 = new Expander("Conditions");
            exp2.Expanded = true;
            exp2.Add(conditionsTable);

            mainTable.Attach(exp1,0,1,0,1,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Fill,0,0);
            mainTable.Attach(exp2,0,1,1,2,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Fill,0,0);

            string extension = System.IO.Path.GetExtension(fpd.Filename);
            switch (extension) {
            case ".png":
            case ".jpg":
            case ".jpeg":
            case ".bmp":
            case ".gif":
            case ".tif":
            case ".svg":{
                Table ImageTable =GenerateImageControl();
                if(ImageTable!= null){
                    Expander expImage = new Expander("Image");
                    expImage.Expanded = true;
                    expImage.Add(ImageTable);
                    mainTable.Attach(expImage,0,1,2,3,AttachOptions.Expand|AttachOptions.Fill,AttachOptions.Fill,0,0);
                }
                break;
            }
            case ".db":
                //
                break;
            default:
                //
                break;
            }

            this.PackStart(mainTable,true,true,0);
            this.ShowAll();
        }
Beispiel #6
0
        private void setConditionsRecursive(string path,int condId, int ruleId)
        {
            if (!Directory.Exists(path))
                return;

            DirectoryInfo di = new DirectoryInfo(path);

            foreach (DirectoryInfo d in di.GetDirectories()){
                int indx = -1;
                indx = MainClass.Settings.IgnoresFolders.FindIndex(x => x.Folder == d.Name && x.IsForIde);
                if(indx<0){
                    string relativePath = MainClass.Workspace.GetRelativePath(d.FullName);
                    FileItem fi = project.FilesProperty.Find(x => x.SystemFilePath == relativePath);
                    if(fi == null){
                        fi = new FileItem(relativePath, false);
                        fi.ConditionValues = new List<ConditionRule>();
                        fi.IsDirectory = true;
                        project.FilesProperty.Add(fi);
                    }

                    if(fi.ConditionValues == null)
                        fi.ConditionValues = new List<ConditionRule>();

                    ConditionRule cr = fi.ConditionValues.Find(x => x.ConditionId == condId);
                    if (ruleId != 0){
                        if (cr != null)
                            cr.RuleId = ruleId;
                        else
                            fi.ConditionValues.Add(new ConditionRule(condId,ruleId));
                    }
                    else {
                        //cd.Id);
                        if (cr != null){
                            fi.ConditionValues.Remove(cr);
                        }
                    }
                    setConditionsRecursive(d.FullName,condId, ruleId);
                }
            }

            foreach (FileInfo f in di.GetFiles()){
                if (!MainClass.Tools.IsIgnoredExtension(f.Extension)) {

                    int indx = -1;
                    indx = MainClass.Settings.IgnoresFiles.FindIndex(x => x.Folder == f.Name && x.IsForIde);
                    if(indx >-1)continue;

                    string relativePath = MainClass.Workspace.GetRelativePath(f.FullName);
                    FileItem fi = project.FilesProperty.Find(x => x.SystemFilePath == relativePath);
                    if (fi == null) {
                        fi = new FileItem(relativePath, false);
                        fi.ConditionValues = new List<ConditionRule>();
                        project.FilesProperty.Add(fi);
                    }

                    if(fi.ConditionValues == null)
                        fi.ConditionValues = new List<ConditionRule>();

                    ConditionRule cr = fi.ConditionValues.Find(x => x.ConditionId == condId);
                    if (ruleId != 0){
                        if (cr != null)
                            cr.RuleId = ruleId;
                        else
                            fi.ConditionValues.Add(new ConditionRule(condId,ruleId));
                    }
                    else {
                        if (cr != null){
                            fi.ConditionValues.Remove(cr);
                        }
                    }

                }
            }
        }