private void PrintDependencySummary(int dependenciesCount, SolutionComponent component) { ComponentInfo componentInfo = _componentTypeDao.GetComponentInfo(component.ComponentType.Value, component.ObjectId.Value); if (dependenciesCount == 0) { Console.ForegroundColor = ConsoleColor.Green; } else { Console.ForegroundColor = ConsoleColor.Yellow; } Console.WriteLine( $"{dependenciesCount} dependencies - {componentInfo.Name} ({component.ObjectId.Value})" + $" ({component.ComponentType.Value})"); Console.ForegroundColor = ConsoleColor.Gray; }
private ComponentInfo ProcessSolutionComponent(Guid componentObjectId) { ComponentInfo cInfo = cInfoProvider.GetAttributeInformation(componentObjectId); if (ShouldSkip(cInfo)) { return(null); } if (SolutionComponentDao.HasDependencies(_orgSvc, cInfo.ComponentType, cInfo.ComponentId)) { return(null); } bool hasData = HasData(cInfo); PrintComponentInfo(cInfo, hasData); AppendToFile(cInfo, hasData); return(cInfo); }
private bool ShouldSkip(ComponentInfo cInfo) { // Skip as dont want managed attributes if (_onlyUnmanaged && cInfo.IsManaged != false) { return(true); } // Skip as don't want base attributes if (_skipBase && cInfo.Name.Contains("(Base)")) { return(true); } // Skip as don't want deprecated attributes that are already hidden if (_runDepricator && cInfo.Name.Contains("[DEP]") && !cInfo.IsValidForAdvancedFind) { return(true); } return(false); }
private void AppendToFile(ComponentInfo cInfo, bool hasData) { _sb.AppendLine( $"{cInfo.Name},{cInfo.ComponentId},{cInfo.ComponentType}," + $"{cInfo.EntityLogicalName},{cInfo.IsManaged},{hasData}"); }
private void PrintComponentInfo(ComponentInfo cInfo, bool hasData) { // name Console.ForegroundColor = ConsoleColor.Green; Console.Write($"{cInfo.Name}"); // entity name if (cInfo.EntityLogicalName != null) { Console.Write($" - {cInfo.EntityLogicalName}"); } Console.WriteLine(); // guid and type Console.ForegroundColor = ConsoleColor.DarkGray; Console.WriteLine($"\t{cInfo.ComponentId} | {cInfo.ComponentType}"); // has data if (hasData) { Console.ForegroundColor = ConsoleColor.Red; } else { Console.ForegroundColor = ConsoleColor.DarkGray; } Console.WriteLine($"\tHas Data: {hasData}"); // required level if (cInfo.RequiredLevel == AttributeRequiredLevel.ApplicationRequired || cInfo.RequiredLevel == AttributeRequiredLevel.SystemRequired) { Console.ForegroundColor = ConsoleColor.Red; } else if (cInfo.RequiredLevel == AttributeRequiredLevel.Recommended) { Console.ForegroundColor = ConsoleColor.Yellow; } else { Console.ForegroundColor = ConsoleColor.DarkGray; } Console.WriteLine($"\tRequired Level: {cInfo.RequiredLevel.ToString()}"); // is valid for advanced find Console.ForegroundColor = ConsoleColor.DarkGray; Console.WriteLine($"\tIs Valid for Advanced Find: {cInfo.IsValidForAdvancedFind}"); // is managed if (cInfo.IsManaged != null) { if (cInfo.IsManaged == true) { Console.ForegroundColor = ConsoleColor.Red; } else { Console.ForegroundColor = ConsoleColor.DarkGray; } Console.WriteLine($"\tManaged: {cInfo.IsManaged.Value}"); Console.ForegroundColor = ConsoleColor.Gray; } // reset color incase it has changed Console.ForegroundColor = ConsoleColor.Gray; }
private bool HasData(ComponentInfo cInfo) { return(EntityDao.CountRecordsContainingValue(_orgSvc, cInfo.EntityLogicalName, cInfo.LogicalName)); }