コード例 #1
0
        /// <summary>
        /// Executes the Service Object method and returns any data.
        /// </summary>
        /// <param name="inputs">A Property[] array containing all the allowed input properties.</param>
        /// <param name="required">A RequiredProperties collection containing the required properties.</param>
        /// <param name="returns">A Property[] array containing all the allowed return properties.</param>
        /// <param name="methodType">A MethoType indicating what type of Service Object method was called.</param>
        /// <param name="serviceObject">A ServiceObject containing populated properties for use with the method call.</param>
        public void Execute(Property[] inputs, RequiredProperties required, Property[] returns, MethodType methodType, ServiceObject serviceObject)
        {
            crmconfig = new CRMConfig
            {
                CRMURL = crmurl,
                CRMOrganization = crmorganization
            };


            #region Container


            if (serviceObject.Methods[0].Name.Equals("loadcontainer"))
            {
                BlobContainer container = new BlobContainer(serviceBroker);
                container.ExecuteLoadContainer(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("listcontainers"))
            {
                BlobContainer container = new BlobContainer(serviceBroker);
                container.ExecuteListContainers(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("createcontainer"))
            {
                BlobContainer container = new BlobContainer(serviceBroker);
                container.ExecuteCreateContainer(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("setcontainerpermissions"))
            {
                BlobContainer container = new BlobContainer(serviceBroker);
                container.ExecuteSetPermissions(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("setcontainermetadata"))
            {
                BlobContainer container = new BlobContainer(serviceBroker);
                container.ExecuteSetMetadata(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("loadcontainermetadatavalue"))
            {
                BlobContainer container = new BlobContainer(serviceBroker);
                container.ExecuteLoadMetadataValue(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("listcontainermetadata"))
            {
                BlobContainer container = new BlobContainer(serviceBroker);
                container.ExecuteListMetadata(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("deletecontainer"))
            {
                BlobContainer container = new BlobContainer(serviceBroker);
                container.ExecuteDeleteContainer(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("listcontainerfolders"))
            {
                BlobContainer container = new BlobContainer(serviceBroker);
                container.ExecuteListContainerFolders(inputs, required, returns, methodType, serviceObject);
            }

            #endregion Container


            #region Blob


            if (serviceObject.Methods[0].Name.Equals("loadblob"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteLoadBlob(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("setblobmetadata"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteSetBlobMetadata(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("loadblobmetadatavalue"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteLoadBlobMetadataValue(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("listblobmetadata"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteListBlobMetadata(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("deleteblob"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteDeleteBlob(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("uploadblob"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteUploadBlob(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("uploadblobfrombase64"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteUploadBlobFromBase64(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("uploadblobfromfilesystem"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteUploadBlobFromFilePath(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("uploadblobfromurl"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteUploadBlobFromUrl(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("listblobs"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteListBlobs(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("downloadblob"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteDownloadBlob(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("downloadblobtobase64"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteDownloadBlobAsBase64(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("downloadblobtofilesystem"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteDownloadBlobToFileSystem(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("setblobproperties"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteSetBlobProperties(inputs, required, returns, methodType, serviceObject);
            }

            #endregion Blob

        }
        /// <summary>
        /// Executes the Service Object method and returns any data.
        /// </summary>
        /// <param name="inputs">A Property[] array containing all the allowed input properties.</param>
        /// <param name="required">A RequiredProperties collection containing the required properties.</param>
        /// <param name="returns">A Property[] array containing all the allowed return properties.</param>
        /// <param name="methodType">A MethoType indicating what type of Service Object method was called.</param>
        /// <param name="serviceObject">A ServiceObject containing populated properties for use with the method call.</param>
        public void Execute(Property[] inputs, RequiredProperties required, Property[] returns, MethodType methodType, ServiceObject serviceObject)
        {
            #region Container


            if (serviceObject.Methods[0].Name.Equals("loadcontainer"))
            {
                BlobContainer container = new BlobContainer(serviceBroker);
                container.ExecuteLoadContainer(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("listcontainers"))
            {
                BlobContainer container = new BlobContainer(serviceBroker);
                container.ExecuteListContainers(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("createcontainer"))
            {
                BlobContainer container = new BlobContainer(serviceBroker);
                container.ExecuteCreateContainer(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("setcontainerpermissions"))
            {
                BlobContainer container = new BlobContainer(serviceBroker);
                container.ExecuteSetPermissions(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("setcontainermetadata"))
            {
                BlobContainer container = new BlobContainer(serviceBroker);
                container.ExecuteSetMetadata(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("loadcontainermetadatavalue"))
            {
                BlobContainer container = new BlobContainer(serviceBroker);
                container.ExecuteLoadMetadataValue(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("listcontainermetadata"))
            {
                BlobContainer container = new BlobContainer(serviceBroker);
                container.ExecuteListMetadata(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("deletecontainer"))
            {
                BlobContainer container = new BlobContainer(serviceBroker);
                container.ExecuteDeleteContainer(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("listcontainerfolders"))
            {
                BlobContainer container = new BlobContainer(serviceBroker);
                container.ExecuteListContainerFolders(inputs, required, returns, methodType, serviceObject);
            }

            #endregion Container


            #region Blob


            if (serviceObject.Methods[0].Name.Equals("loadblob"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteLoadBlob(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("setblobmetadata"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteSetBlobMetadata(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("loadblobmetadatavalue"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteLoadBlobMetadataValue(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("listblobmetadata"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteListBlobMetadata(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("deleteblob"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteDeleteBlob(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("uploadblob"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteUploadBlob(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("uploadblobfrombase64"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteUploadBlobFromBase64(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("uploadblobfromfilesystem"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteUploadBlobFromFilePath(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("uploadblobfromurl"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteUploadBlobFromUrl(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("listblobs"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteListBlobs(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("downloadblob"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteDownloadBlob(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("downloadblobtobase64"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteDownloadBlobAsBase64(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("downloadblobtofilesystem"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteDownloadBlobToFileSystem(inputs, required, returns, methodType, serviceObject);
            }

            if (serviceObject.Methods[0].Name.Equals("setblobproperties"))
            {
                BlobBlob blob = new BlobBlob(serviceBroker);
                blob.ExecuteSetBlobProperties(inputs, required, returns, methodType, serviceObject);
            }

            #endregion Blob
        }