void RaisePostBackEvent(string eventArgument) { if (eventArgument == "Upload") { HttpPostedFile uploadedFile = Page.Request.Files[ClientID + "_Upload"]; if (uploadedFile != null && uploadedFile.ContentLength > 0) { FileManagerItemInfo dir = GetCurrentDirectory(); Controller.ProcessFileUpload(dir, uploadedFile); } } else if (eventArgument == "Select") { if (SelectCommand != null) SelectCommand.Invoke(this, EventArgs.Empty); } else if (eventArgument == "Cancel") { if (CancelCommand != null) CancelCommand.Invoke(this, EventArgs.Empty); } else if (eventArgument.StartsWith("Toolbar:", StringComparison.Ordinal)) { int i = int.Parse(eventArgument.Substring(8)); CustomToolbarButton button = CustomToolbarButtons[i]; OnToolbarCommand(new CommandEventArgs(button.CommandName, button.CommandArgument)); } }
// Kích hoạt event huỷ lệnh shutdown private void TriggerCancel(object sender, EventArgs e) { CancelCommand?.Invoke(this, EventArgs.Empty); // Ẩn notify icon mainNotifier.Visible = false; // Nếu huỷ từ tray (form đang ẩn) thì thoát chương trình if (!Visible) { Close(); } }