Exemplo n.º 1
0
 private Guid GetSolutionId()
 {
     while (true)
     {
         string solutionName = Prompter.SolutionName();
         Guid?  solutionId   = SolutionDao.GetId(_orgSvc, solutionName);
         if (solutionId != null)
         {
             return(solutionId.Value);
         }
     }
 }
Exemplo n.º 2
0
        private void PrintDependencyDetails(Dependency dependency, SolutionComponent component)
        {
            //These strings represent parameters for the message.
            ComponentInfo dependentComponentInfo;
            string        dependentComponentTypeName     = "";
            string        dependentComponentSolutionName = "";
            ComponentInfo requiredComponentInfo;
            string        requiredComponentTypeName     = "";
            string        requiredComponentSolutionName = "";

            // Match the Component type with the option value and get the label value of the option.
            foreach (OptionMetadata opt in _componentTypeOptionSet.Options)
            {
                if ((int)dependency.DependentComponentType.Value == opt.Value)
                {
                    dependentComponentTypeName = opt.Label.UserLocalizedLabel.Label;
                }

                if ((int)dependency.RequiredComponentType.Value == opt.Value)
                {
                    requiredComponentTypeName = opt.Label.UserLocalizedLabel.Label;
                }
            }

            //The name or display name of the component is retrieved in different ways depending on the component type
            dependentComponentInfo = _componentTypeDao.GetComponentInfo(
                dependency.DependentComponentType.Value,
                dependency.DependentComponentObjectId.Value);

            requiredComponentInfo = _componentTypeDao.GetComponentInfo(
                dependency.RequiredComponentType.Value,
                dependency.RequiredComponentObjectId.Value);

            // Retrieve the friendly name for the dependent solution.
            dependentComponentSolutionName = SolutionDao.GetName(_orgSvc, dependency.DependentComponentBaseSolutionId.Value);

            // Retrieve the friendly name for the required solution.
            requiredComponentSolutionName = SolutionDao.GetName(_orgSvc, dependency.RequiredComponentBaseSolutionId.Value);

            //Display the message
            Console.WriteLine(
                "The {0} {1} in the {2} depends on the {3} {4} in the {5} solution.",
                dependentComponentInfo.Name,
                dependentComponentTypeName,
                dependentComponentSolutionName,
                requiredComponentInfo.Name,
                requiredComponentTypeName,
                requiredComponentSolutionName);
        }