public void Activity(ref Content Files, ref DataUser User, ListView ListFiles, ProgressBar Loading, int Count, bool SelIt, string Function) { if (User.CheckIntConnect()) { handle = new AutoResetEvent(false); int ThreadCount = Count; Loading.Maximum = ThreadCount; InterUser = User; InterFiles = Files; for (int index = 0; index < ThreadCount; index++) { Thread thread = new Thread(new ParameterizedThreadStart(Capabilities[Function])); thread.IsBackground = true; if (SelIt) { thread.Start(ListFiles.SelectedItems[index].Index); } else { thread.Start(index); } } while (ThreadCount > 0) { handle.WaitOne(); Loading.Increment(1); ThreadCount--; } Loading.Value = 0; User.InfoFiles(ref Files, ref User, ref ListFiles, User.Data.Hrefs.Last(), true); } }
public void MakeDirectory(ref Content Files, ref DataUser User, ListView ListFiles, TextBox NewFolder, string Folder) { Rename Active = new Rename(); if (Active.CheckName(Folder, Files)) { if (User.CheckIntConnect()) { ReqRes Act = new ReqRes(); try { HttpWebRequest Request = Act.MakeRequest(User.Data.UrlServer, User.Data.Hrefs.Last() + Folder, User.Data.Name, User.Data.Password); if (Request != null) { Request.Method = WebRequestMethods.Http.MkCol; Act.GetResponse(Request); User.InfoFiles(ref Files, ref User, ref ListFiles, User.Data.Hrefs.Last(), true); NewFolder.Text = ""; } } catch (WebException ex) { if (GotMessage != null) { GotMessage(ex.Message); } } } } }
public void StartRename(ListView ListFiles, DataUser User, Content Files, bool DoubleClick) { if (ListFiles.SelectedIndices.Count == 1) { int index = ListFiles.SelectedItems[0].Index; if (Files.All[index].ContentType == "d:collection") { if (User.Data.Hrefs.Last() != Files.All[index].Href) { if (DoubleClick) { User.InfoFiles(ref Files, ref User, ref ListFiles, Files.All[index].Href, true); } else { ListFiles.SelectedItems[0].BeginEdit(); } } } else { ListFiles.SelectedItems[0].BeginEdit(); } } }
public MainForm(string Url, string Name, string Password, Form Log) { InitializeComponent(); MakeMenu(); User = new DataUser(); User.GotMessage += GetMessage; User.FillData(Url, Name, Password, "/", Log); User.InfoFiles(ref Files, ref User, ref ListFiles, User.Data.Hrefs.Last(), true); }
public void EndRename(ref Content Files, ref DataUser User, ref ListView ListFiles, LabelEditEventArgs e) { if (CheckName(e.Label, Files)) { if (!MakeNewName(User, e.Item, e.Label, Files)) { e.CancelEdit = true; } else { User.InfoFiles(ref Files, ref User, ref ListFiles, User.Data.Hrefs.Last(), true); } } else { e.CancelEdit = true; } }
private void RefreshFiles() { User.InfoFiles(ref Files, ref User, ref ListFiles, User.Data.Hrefs.Last(), true); }