Example #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);
                }
            }
        }
 public void Process(IList <ComponentInfo> cInfos)
 {
     foreach (ComponentInfo cInfo in cInfos)
     {
         if (Prompt == false || Prompter.YesNo("Depricate Attribute", true))
         {
             AttributeDao.Deprecate(_orgSvc, cInfo);
             Console.WriteLine($"{cInfo.Name} - Attribute Depricated");
         }
     }
 }