private void ProcessGridAttachmentAction(string actionName, Guid attachmentGuid) { // Process proper action switch (actionName.ToLowerInvariant()) { case "moveup": if (attachmentGuid != Guid.Empty) { // Move attachment up if (FormGUID == Guid.Empty) { PerformAttachmentAction("moveup", () => DocumentHelper.MoveAttachmentUp(attachmentGuid, Node)); } else { var ai = AttachmentInfoProvider.GetTemporaryAttachmentInfo(attachmentGuid); if (ai != null) { ai.Generalized.MoveObjectUp(); } } } break; case "movedown": if (attachmentGuid != Guid.Empty) { // Move attachment down if (FormGUID == Guid.Empty) { PerformAttachmentAction("movedown", () => DocumentHelper.MoveAttachmentDown(attachmentGuid, Node)); } else { var ai = AttachmentInfoProvider.GetTemporaryAttachmentInfo(attachmentGuid); if (ai != null) { ai.Generalized.MoveObjectDown(); } } } break; case "delete": if (attachmentGuid != Guid.Empty) { // Delete attachment if (FormGUID == Guid.Empty) { PerformAttachmentAction("delete", () => DocumentHelper.DeleteAttachment(Node, attachmentGuid)); } else { AttachmentInfoProvider.DeleteTemporaryAttachment(attachmentGuid, SiteContext.CurrentSiteName); } ShowConfirmation(GetString("attach.deleted")); } break; } }