Exemple #1
0
 /// <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);
     }
 }
Exemple #2
0
 /// <summary>
 /// operator --
 /// </summary>
 /// <param name="d"></param>
 /// <returns></returns>
 public static Dirs operator --(Dirs d)
 {
     if (d.actionindex > 0)
     {
         d.actionindex--;
     }
     if (d.actionindex == 0)
     {
         MediatorWinRename.EnableBtnBack(false);
     }
     return(d);
 }
Exemple #3
0
 /// <summary>
 /// operator ++
 /// </summary>
 /// <param name="d"></param>
 /// <returns></returns>
 public static Dirs operator ++(Dirs d)
 {
     if (d.actionindex < d.lst.Count)
     {
         d.actionindex++;
     }
     if (d.actionindex == d.lst.Count)
     {
         MediatorWinRename.EnabledBtnFront(false);
     }
     return(d);
 }
Exemple #4
0
 /// <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);
 }
Exemple #5
0
 public override void DeletePath(List <DirectoryInfo> dirs)
 {
     foreach (var dir in dirs)
     {
         for (var i = this.lst.Count - 1; i >= 0; i--)
         {
             if (this.lst[i].Root.FullName == dir.FullName)
             {
                 this.lst.RemoveAt(i);
                 this.actionindex--;
                 if (this.actionindex == this.lst.Count)
                 {
                     MediatorWinRename.EnabledBtnFront(false);
                 }
             }
         }
     }
 }
Exemple #6
0
 /// <summary>
 /// method for btnOk
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     MediatorWinRename.NameFile(this.BoxName.Text);
     this.Close();
 }