// Copy selected file to one or more designated locations protected void btnCopy_Click(object sender, EventArgs e) { MyEventCopy myEvent = new MyEventCopy(); setMyEventCopy(myEvent); myEvent.copy(); if (myEvent.Error != null) { lblError.Text = myEvent.Error; } if (myEvent.Successful) { Response.Write("<script>alert('File(s) successfully copied to the selected location');</script>"); } }
private void setMyEventCopy(MyEventCopy copy) { //if (!lblSourceCurrentPath.Text.Contains(MyGVSource.CurrentFolder)) { // MyGVSource.setCurrentDirectoryInfo( // lblSourceCurrentPath.Text.Substring("Viewing the folder ".Length) // ); //} string lbl = lblDestinationCurrentPath.Text; if (!lbl.Contains(MyGVDestination.CurrentFolder)) { string newCurrentFolder = ""; if (!SearchMode) { if (!lbl.Contains("search")) { newCurrentFolder = lbl.Substring("Viewing the folder ".Length); newCurrentFolder = Regex.Replace(newCurrentFolder, "<.*?>", String.Empty); } else // not sure if it ever reaches this { newCurrentFolder = lbl.Substring(lbl.IndexOf(":")); } } else // not sure if it ever reaches this { newCurrentFolder = lbl.Substring(lbl.IndexOf(":")); } MyGVDestination.setCurrentDirectoryInfo(newCurrentFolder); } MyGVSource.Gridview = gvSource; MyGVDestination.Gridview = gvDestination; copy.MyGVSource = MyGVSource; copy.MyGVDestination = MyGVDestination; copy.Response = Response; copy.DestinationHomeFolder = DestinationHomeFolder; copy.DestWebServerFolder = DestinationWebServerFolder; copy.DestinationCurrentFolder = DestinationCurrentFolder; copy.Page = this.Page; }