Example #1
0
        /// <summary>
        /// Called in order to have this component handle a command that it has registered for.
        /// </summary>
        /// <param name="commandId">the id of the command</param>
        /// <param name="properties">the properties of the command</param>
        /// <param name="sequence">the sequence number of the command</param>
        /// <returns>true if the command was successfully handled by the component</returns>
        public override bool HandleCommand(string commandId, Dictionary <string, string> properties, int sequence)
        {
            switch (commandId)
            {
            case TabSwitchCommand:
                string tabName         = properties.ContainsKey("NewContextId") ? properties["NewContextId"] : "";
                bool   ribbonMinimized = (string.Compare(tabName, ReadTabName) == 0);
                NativeUtility.OnRibbonMinimizedChanged(ribbonMinimized);
                break;

            case DeleteCommand:
                PrintItemCommand("Delete");
                break;

            case CheckInCommand:
                PrintItemCommand("Check In");
                break;

            case CheckOutCommand:
                PrintItemCommand("Checkout");
                break;

            case DiscardCheckOutCommand:
                PrintItemCommand("Discard Checkout");
                break;

            case ViewVersionsCommand:
                PrintItemCommand("View Version History");
                break;

            case ViewPropertiesCommand:
                PrintItemCommand("View Item Properties");
                break;

            case EditPropertiesCommand:
                PrintItemCommand("EditItem Properties");
                break;

            case ManagePermissionsCommand:
                PrintItemCommand("Manage Item Permissions");
                break;

            case UnpublishCommand:
                PrintItemCommand("Unpublish Item Version");
                break;

            case ModerateCommand:
                PrintItemCommand("Moderate Item Version");
                break;

            case CancelApprovalCommand:
                PrintItemCommand("Cancel Item Version Approval");
                break;

            case NewFolderCommand:
                Browser.Window.Alert("Creating a new Folder");
                break;

            case ViewRSSFeedCommand:
                Browser.Window.Alert("View RSS feed for this library");
                break;

            case ListSettingsCommand:
                Browser.Window.Alert("Update settings for this list");
                break;

            case UploadDocumentCommand:
                Browser.Window.Alert("Upload a document to this library");
                break;

            case UploadMultipleDocumentsCommand:
                Browser.Window.Alert("Upload multiple documents to this library");
                break;

            case UploadDocumentMenuOpenCommand:
                Browser.Window.Alert("Open the Upload Document dropdown menu");
                break;

            case CreateViewCommand:
                Browser.Window.Alert("Create a new view for this library");
                break;

            case OpenWithExplorerCommand:
                Browser.Window.Alert("View this library in Windows Explorer");
                break;

            case LibraryPermissionsCommand:
                Browser.Window.Alert("Modify user permissions for this library");
                break;

            case ExportToSpreadsheetCommand:
                Browser.Window.Alert("Export items in this library to Excel");
                break;

            case PopulateSendToMenuCommand:
                properties["PopulationXML"] = GetSendToMenuXml();
                Browser.Window.Alert("Display the Send To button dropdown menu");
                break;

            case SendToOtherLocationCommand:
                PrintItemCommand("Send to Other Location");
                break;

            case SendToRecommendedLocationCommand:
                PrintItemCommand("Send to Recommended Location");
                break;

            default:
                return(false);
            }
            return(true);
        }