コード例 #1
0
        private void GeneratePluginSdkMessageImage(RetrievePluginTypes retrievePluginTypes, Guid pluginstepId, ref XmlNode images, ref XmlDocument xmlDoc, IOrganizationService service)
        {
            EntityCollection imageColl = retrievePluginTypes.GetSdkProcessingStepImage(pluginstepId, service);

            foreach (Entity sdkstepImage in imageColl.Entities)
            {
                XmlNode image = xmlDoc.CreateElement("Image");
                images.AppendChild(image);

                XmlAttribute attributes = xmlDoc.CreateAttribute("Attributes");
                attributes.Value = sdkstepImage.Attributes.Contains("attributes") ? sdkstepImage["attributes"].ToString() : "All";
                image.Attributes.Append(attributes);

                XmlAttribute entityAlias = xmlDoc.CreateAttribute("EntityAlias");
                entityAlias.Value = sdkstepImage["entityalias"].ToString();
                image.Attributes.Append(entityAlias);

                XmlAttribute name = xmlDoc.CreateAttribute("Name");
                name.Value = sdkstepImage["name"].ToString();
                image.Attributes.Append(name);

                XmlAttribute id = xmlDoc.CreateAttribute("Id");
                id.Value = sdkstepImage.Id.ToString();
                image.Attributes.Append(id);

                XmlAttribute messagePropertyName = xmlDoc.CreateAttribute("MessagePropertyName");
                messagePropertyName.Value = sdkstepImage["messagepropertyname"].ToString();
                image.Attributes.Append(messagePropertyName);

                XmlAttribute imageType = xmlDoc.CreateAttribute("ImageType");
                imageType.Value = ((OptionSetValue)sdkstepImage["imagetype"]).Value.ToString();
                image.Attributes.Append(imageType);
            }
        }
コード例 #2
0
        public void UnRegisterPluginTypes(Guid pluginAssemblyId, IOrganizationService service)
        {
            RetrievePluginTypes retrievePluginTypes = new RetrievePluginTypes();
            EntityCollection    pluginTypesColl     = retrievePluginTypes.GetPluginTypes(pluginAssemblyId, service);

            foreach (Entity pluginTypeEntity in pluginTypesColl.Entities)
            {
                EntityCollection pluginStepsColl = retrievePluginTypes.GetSdkProcessingStep(pluginTypeEntity.Id, service);
                foreach (Entity pluginStep in pluginStepsColl.Entities)
                {
                    EntityCollection stepImageColl = retrievePluginTypes.GetSdkProcessingStepImage(pluginStep.Id, service);
                    foreach (Entity stepImage in stepImageColl.Entities)
                    {
                        service.Delete(stepImage.LogicalName, stepImage.Id);
                    }
                    service.Delete(pluginStep.LogicalName, pluginStep.Id);
                }
                service.Delete(pluginTypeEntity.LogicalName, pluginTypeEntity.Id);
            }
        }