コード例 #1
0
ファイル: Dirs.cs プロジェクト: Mykyta1995/WPF-MyExplorer
 /// <summary>
 /// method for add
 /// </summary>
 /// <param name="el"></param>
 public override void Add(Elemnts el)
 {
     if (this.Test(el))
     {
         for (var i = 1; i < this.lst.Count; i++)
         {
             if (this.lst[i].Root.Parent.FullName == el.Root.Parent.FullName)
             {
                 this.lst.RemoveRange(i, (this.lst.Count) - i);
                 this.actionindex = i;
                 MediatorWinRename.EnabledBtnFront(false);
             }
             else if (this.lst[i].Root.FullName.Contains("Searching results"))
             {
                 if (this.lst[i].Parent.Root.FullName == el.Root.Parent.FullName)
                 {
                     this.lst.RemoveRange(i, (this.lst.Count) - i);
                     this.actionindex = i;
                     MediatorWinRename.EnabledBtnFront(false);
                 }
             }
         }
         this.actionindex++;
         this.lst.Add(el);
         MediatorWinRename.EnableBtnBack(true);
     }
 }
コード例 #2
0
ファイル: Dirs.cs プロジェクト: Mykyta1995/WPF-MyExplorer
 /// <summary>
 /// method for test
 /// </summary>
 /// <param name="el">new element</param>
 /// <returns>choise</returns>
 private bool Test(Elemnts el)
 {
     foreach (var element in this.lst)
     {
         if (element.Root.FullName == el.Root.FullName)
         {
             this.actionindex++;
             if (this.actionindex == lst.Count)
             {
                 MediatorWinRename.EnabledBtnFront(false);
             }
             return(false);
         }
     }
     return(true);
 }
コード例 #3
0
 /// <summary>
 /// method for save path
 /// </summary>
 /// <param name="root">content</param>
 private void AddSavePath(DirectoryInfo root, bool flag = false)
 {
     try
     {
         if (!flag)
         {
             foreach (var file in root.GetFiles())
             {
                 break;
             }
         }
         if (root.Parent == null)
         {
             this.element.Reset();
             this.btnFront.IsEnabled = false;
         }
         var     buf = this.element.GetRoot;
         Elemnts el  = null;
         if (buf == null)
         {
             el = new Dirs {
                 Parent = this.element, Root = root
             }
         }
         ;
         else
         {
             el = new Dirs {
                 Parent = buf, Root = root
             }
         };
         this.element.Add(el);
         if (!flag)
         {
             this.Path.Text = this.element.GetActionNode.FullName;
         }
         else
         {
             this.Path.Text = this.element.GetActionNode.Name;
         }
     }
     catch (Exception ex)
     {
     }
 }
コード例 #4
0
        /// <summary>
        /// method for recurs walk dir
        /// </summary>
        /// <param name="root"></param>
        public void WalkToParent(DirectoryInfo root)
        {
            //if (root == null)
            //    return;
            //WalkToParent(root.Parent);
            var     buf = this.element.GetRoot;
            Elemnts el  = null;

            if (buf == null)
            {
                el = new Dirs {
                    Parent = this.element, Root = root
                }
            }
            ;
            else
            {
                el = new Dirs {
                    Parent = buf, Root = root
                }
            };
            this.element.Add(el);
        }
コード例 #5
0
ファイル: Elemnts.cs プロジェクト: Mykyta1995/WPF-MyExplorer
 /// <summary>
 /// method for add new element
 /// </summary>
 /// <param name="el">new element</param>
 public abstract void Add(Elemnts el);