public static WebResourceData ToWebResourceData(this Entity e) { WebResourceData webResource = GetGenericData <WebResourceData>(e); webResource.WebResourceType = e.GetAttributeValue <OptionSetValue>("webresourcetype").Value; return(webResource); }
public static object RetrieveObjectDefinition(IOrganizationService service, SolutionComponentBase component) { var componentId = component.ObjectId; if (component.Type == SolutionComponentType.Entity) { return(GetEntityMetadata(service, componentId)); } else if (component.Type == SolutionComponentType.Field) { return(GetAttributeMetadata(service, component.ParentSolutionComponent.LogicalName, componentId)); } else if (component.Type == SolutionComponentType.Relationship) { return(GetRelationshipMetadata(service, componentId)); } else if (component.Type == SolutionComponentType.OptionSet) { return(GetOptionSetMetadata(service, componentId)); } else if (component.Type == SolutionComponentType.EntityKey) { return(GetEntityKeyMetadata(service, component.ParentSolutionComponent.LogicalName, componentId)); } else if (component.Type == SolutionComponentType.Role) { var logicalName = new RoleData().EntityLogicalName; return(GetGenericData(service, logicalName, componentId) .ToRoleData()); } else if (component.Type == SolutionComponentType.RolePrivilege) { var logicalName = new RolePrivilegeData().EntityLogicalName; return(GetGenericData(service, logicalName, componentId) .ToRolePrivilegeData()); } else if (component.Type == SolutionComponentType.View) { var logicalName = new ViewData().EntityLogicalName; return(GetGenericData(service, logicalName, componentId) .ToViewData()); } else if (component.Type == SolutionComponentType.Workflow) { var logicalName = new WorkflowData().EntityLogicalName; return(GetGenericData(service, logicalName, componentId) .ToWorkflowData()); } else if (component.Type == SolutionComponentType.EmailTemplate) { var logicalName = new EmailTemplateData().EntityLogicalName; return(GetGenericData(service, logicalName, componentId) .ToEmailTemplateData()); } else if (component.Type == SolutionComponentType.Ribbon) { var logicalName = new RibbonData().EntityLogicalName; var data = GetRibbonData(service, componentId); return(data.ToRibbonData()); } else if (component.Type == SolutionComponentType.Chart) { var logicalName = new ChartData().EntityLogicalName; return(GetGenericData(service, logicalName, componentId) .ToChartData()); } else if (component.Type == SolutionComponentType.Form) { var logicalName = new FormData().EntityLogicalName; return(GetGenericData(service, logicalName, componentId) .ToFormData()); } else if (component.Type == SolutionComponentType.WebResource) { var logicalName = new WebResourceData().EntityLogicalName; return(GetGenericData(service, logicalName, componentId) .ToWebResourceData()); } else if (component.Type == SolutionComponentType.Sitemap) { var logicalName = new SiteMapData().EntityLogicalName; return(GetGenericData(service, logicalName, componentId) .ToSiteMap()); } else if (component.Type == SolutionComponentType.ConnectionRole) { var logicalName = new ConnectionRoleData().EntityLogicalName; return(GetGenericData(service, logicalName, componentId) .ToConnectionRoleData()); } else if (component.Type == SolutionComponentType.HierarchyRule) { var logicalName = new HierarchyRuleData().EntityLogicalName; return(GetGenericData(service, logicalName, componentId) .ToHierarchyRuleData()); } else if (component.Type == SolutionComponentType.App) { var logicalName = new AppData().EntityLogicalName; return(GetGenericData(service, logicalName, componentId) .ToAppData()); } else if (component.Type == SolutionComponentType.PluginAssembly) { var logicalName = new PluginAssemblyData().EntityLogicalName; return(GetGenericData(service, logicalName, componentId) .ToPluginAssemblyData()); } else if (component.Type == SolutionComponentType.PluginStep) { var logicalName = new PluginStepData().EntityLogicalName; return(GetGenericData(service, logicalName, componentId) .ToPluginStepData()); } else if (component.Type == SolutionComponentType.RoutingRule) { var logicalName = new RoutingRuleData().EntityLogicalName; return(GetGenericData(service, logicalName, componentId) .ToRoutingRuleData()); } else if (component.Type == SolutionComponentType.ConvertRule) { var logicalName = new ConvertRuleData().EntityLogicalName; return(GetGenericData(service, logicalName, componentId) .ToConvertRuleData()); } return(null); }
public void GetWebResources() { WebResourcesObjects = new WebResourceData().GetWebResources(ServerConnection, Solution); }