Exemplo n.º 1
0
 private void DirectoryTree(SlynchyDirectoryTree tree)
 {
     tbReport.AppendText("   -----------------------------------------------------------------------" + nl);
     tbReport.AppendText("   Directory Tree name: " + tree.Name + nl);
     tbReport.AppendText("   Root Directory path: " + tree.RootDirectoryPath + nl);
     tbReport.AppendText(" " + nl);
 }
Exemplo n.º 2
0
        public frmExclusions(SlynchyProject project, Comparison comparison, SlynchyDirectoryTree currentTree)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            Project           = project;
            CurrentComparison = comparison;
            CurrentTree       = currentTree;
            CurrentTree.ScanTree();

            labProjectName.Text    = Project.Name;
            labComparisonName.Text = CurrentComparison.Name;
            labTreeName.Text       = CurrentTree.Name;

            CurrentTree.CopyToTreeControl(tvDirs, false);

            LoadDirExclusions(CurrentTree.Spec.PathNameExcludes,
                              CurrentTree.Spec.PathRelativeExcludes);
            LoadFileType(CurrentTree.Spec.IncludedFileExtensions);
            LoadFileExclusions(CurrentTree.Spec.FileNameExcludes,
                               CurrentTree.Spec.FilePathExcludes);
            LoadDirFileExclusions(CurrentTree.Spec.DirFileExcludes);
        }
Exemplo n.º 3
0
        public SlynchyDirectoryTree AddTree(string name, string path)
        {
            //TODO: check why this is not used
            var newTree = new SlynchyDirectoryTree(name, path);

            Directories.Add(newTree);
            return(newTree);
        }
Exemplo n.º 4
0
        private void LoadTree()
        {
            this.Cursor = Cursors.WaitCursor;
            tvTree.Nodes.Clear();
            Application.DoEvents();
            var CurrentTreeName = cboSelectTree.Text;

            CurrentDirectoryTree = CurrentComparison.FindTree(CurrentTreeName);
            CurrentDirectoryTree.CopyToTreeControl(tvTree, false);
            this.Cursor = Cursors.Arrow;
            Application.DoEvents();
        }
Exemplo n.º 5
0
        public List <SlynchyDirectoryTree> OtherDirTrees(SlynchyDirectoryTree treePicked)
        {
            var OtherTrees = new List <SlynchyDirectoryTree>();

            foreach (var tree in Comp.Directories)
            {
                if (tree != treePicked)
                {
                    OtherTrees.Add(tree);
                }
            }
            return(OtherTrees);
        }
Exemplo n.º 6
0
        public SlynchyDirectoryTree FindTree(string name)
        {
            SlynchyDirectoryTree foundTree = null;

            foreach (var tree in Directories)
            {
                if (tree.Name.Equals(name))
                {
                    foundTree = tree;
                }
            }
            return(foundTree);
        }
Exemplo n.º 7
0
        private void cboSelectRightTree_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            tvRightTree.Nodes.Clear();
            Application.DoEvents();
            var CurrentRightTreeName = cboSelectRightTree.Text;

            CurrentRightDirectoryTree = CurrentComparison.FindTree(CurrentRightTreeName);
            CurrentRightDirectoryTree.CopyToTreeControl(tvRightTree,
                                                        labRightDir, labRightDirCount, labRightDirCount, false);
            this.Cursor = Cursors.Arrow;
            Application.DoEvents();
        }
Exemplo n.º 8
0
        public SlynchyDirectoryTree GetRootDirectoryTree(string rootDirPath)
        {
            var FoundTree = new SlynchyDirectoryTree();

            foreach (var tree in Comp.Directories)
            {
                if (tree.RootDirectoryPath.Equals(rootDirPath))
                {
                    FoundTree = tree;
                }
            }

            return(FoundTree);
        }
Exemplo n.º 9
0
        public void AddDifferentFileSpec(SlynchyDirectoryTree tree, SlynchyFile info)
        {
            var IsInList = false;

            foreach (var spec in Specs)
            {
                if (spec.Tree.RootDirectoryPath.Equals(tree.RootDirectoryPath))
                {
                    IsInList = true;
                }
            }
            if (!IsInList)
            {
                var spec = new FileSpecs(tree, info);
                Specs.Add(spec);
            }
        }
Exemplo n.º 10
0
        private void butAddTree_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(tbAddTreeName.Text) &&
                !String.IsNullOrEmpty(tbAddTreeRootDirectory.Text) &&
                !IsInTreeNameList(tbAddTreeName.Text) &&
                !IsInTreeDirList(tbAddTreeRootDirectory.Text))
            {
                var newTree           = new SlynchyDirectoryTree(tbAddTreeName.Text, tbAddTreeRootDirectory.Text);
                var CurrentComparison = SlynchyTrack.Project.FindComparison(cboSelectComparison.Text);
                CurrentComparison.Directories.Add(newTree);

                LoadDirTrees();
                tbAddTreeName.Text          = "";
                tbAddTreeRootDirectory.Text = "";
                SlynchyProjectFiles.SaveProject(SlynchyTrack.Project, SlynchyTrack.ProjectFileName);
                Application.DoEvents();
            }
        }
Exemplo n.º 11
0
        private SlynchyDirectoryTree FindDirTree(string name)
        {
            //TODO: This should be a method in SlynchyTrack
            var CurrentComparison            = SlynchyTrack.Project.FindComparison(cboSelectComparison.Text);
            SlynchyDirectoryTree CurrentTree = null;

            if (!String.IsNullOrEmpty(name))
            {
                foreach (var tree in CurrentComparison.Directories)
                {
                    if (tree.Name.Equals(name))
                    {
                        CurrentTree = tree;
                    }
                }
            }
            return(CurrentTree);
        }
Exemplo n.º 12
0
        //tree is the tree for the comparison file, with data "info"
        public void AddDifferentFile(string relDirectoryPath, SlynchyDirectoryTree tree, SlynchyFile info)
        {
            var FoundRelDir = false;

            foreach (var dFile in DFiles)
            {
                if (dFile.RelDir.Equals(relDirectoryPath) && dFile.FileName.Equals(info.Info.Name))
                {
                    FoundRelDir = true;
                    dFile.AddDifferentFileSpec(tree, info);
                }
            }
            if (!FoundRelDir)
            {
                var newDiffFiles = new DifferentFiles();
                newDiffFiles.RelDir   = relDirectoryPath;
                newDiffFiles.FileName = info.Info.Name;
                newDiffFiles.AddDifferentFileSpec(tree, info);
                DFiles.Add(newDiffFiles);
            }
        }
Exemplo n.º 13
0
        public bool RemoveTree(string name)
        {
            //TOSO: check why this is not used
            //returns true if tree found
            var IsFound = false;
            SlynchyDirectoryTree foundTree = null;

            foreach (var tree in Directories)
            {
                if (tree.Name.Equals(name))
                {
                    foundTree = tree;
                    IsFound   = true;
                }
            }
            if (IsFound)
            {
                Directories.Remove(foundTree);
            }
            return(IsFound);
        }
Exemplo n.º 14
0
        public SlynchyDirectoryTree RescanTree(string name)
        {
            //TODO: check why this is not used
            SlynchyDirectoryTree currentTree = null;
            string path = "";
            SlynchyDirectoryTree rescanTree = null;

            foreach (var tree in Directories)
            {
                if (tree.Name.Equals(name))
                {
                    currentTree = tree;
                    path        = tree.RootDirectoryPath;
                }
            }
            if (currentTree != null)
            {
                currentTree.ScanTree();
            }

            return(rescanTree);
        }
Exemplo n.º 15
0
        //tree is the directory tree without the file
        public void SetUncommonFile(string relDir, string fileName, SlynchyDirectoryTree tree)
        {
            var FoundFile = false;

            foreach (var UFile in UFiles)
            {
                if (UFile.RelDir.Equals(relDir) && UFile.FileName.Equals(fileName))
                {
                    FoundFile = true;
                    if (!UFile.NotInTrees.Contains(tree))
                    {
                        UFile.NotInTrees.Add(tree);
                    }
                }
            }
            if (!FoundFile)
            {
                var UFile = new UncommonFile();
                UFile.RelDir   = relDir;
                UFile.FileName = fileName;
                UFiles.Add(UFile);
                UFile.NotInTrees.Add(tree);
            }
        }
Exemplo n.º 16
0
 public FileSpecs(SlynchyDirectoryTree tree, SlynchyFile info)
 {
     Tree = tree;
     Info = info;
 }