예제 #1
0
        public void Create()
        {
            string globalOptionSetName = PromptOptionSetName();

            // get global option set id
            Guid?globalOptionSetId = GlobalOptionSetDao.GetId(orgSvc, globalOptionSetName);

            if (globalOptionSetId == null)
            {
                return;
            }

            IEnumerable <Dependency> dependencies = GlobalOptionSetDao.GetDependencies(orgSvc, globalOptionSetId.Value);

            Console.WriteLine("");
            foreach (Dependency d in dependencies)
            {
                //Just testing for Attributes
                if (d.DependentComponentType == componenttype.Attribute)
                {
                    AttributeMetadata attmet         = AttributeDao.GetMetadata(orgSvc, d.DependentComponentObjectId.Value);
                    string            attributeLabel = attmet.DisplayName.UserLocalizedLabel.Label;

                    Console.WriteLine(
                        "An {0} named {1} will prevent deleting the {2} global option set.",
                        d.DependentComponentType.Value,
                        attributeLabel,
                        globalOptionSetName);
                }
            }
        }
예제 #2
0
 public SolutionComponentDependencyReport(IOrganizationService orgSvc)
 {
     _orgSvc           = orgSvc;
     _componentTypeDao = new ComponentInfoProvider(orgSvc);
     //The ComponentType global Option Set contains options for each possible component.
     _componentTypeOptionSet = GlobalOptionSetDao.GetMetadata(_orgSvc, "componenttype");
 }