Example #1
0
        private string GetFullDependentsString(string target)
        {
            string fullDependentsString = "";

            StringArrayList fullListOfDependents = new StringArrayList();
            StringArrayList ancestorDependents = new StringArrayList();
            ArrayList directDependents = new ArrayList();
            directDependents.AddRange( this.GetDirectDependents( target ) );

            fullListOfDependents.AddRange( this.GetFullDependentList( target ) );
            fullDependentsString += "Total Dependents (Direct & Ancestor):\r\n";

            if (fullListOfDependents.Count > 0)
            {
                fullListOfDependents.Sort();
                int maxStrLength = fullListOfDependents.MaxStringLength();
                int columnLength = maxStrLength + 5;
                foreach( string dependent in fullListOfDependents )
                {
                    String formattedStr = dependent;
                    if( directDependents.Contains( dependent ))
                    {
                        string strFormat = "{0,-" + columnLength + "}{1}";
                        formattedStr = String.Format(strFormat,	formattedStr, "(direct)");
                    }
                    else
                    {
                        ancestorDependents.Add( dependent );
                    }
                    fullDependentsString += "\t" + formattedStr;
                    fullDependentsString += "\r\n";
                }
            }
            else
            {
                fullDependentsString += "\t(none)\r\n";
            }
            return fullDependentsString;
        }
Example #2
0
        private string GetFullDependenciesString( string target, string depends )
        {
            string fullDependenciesString = "";

            StringArrayList fullListOfDependencies = new StringArrayList();
            StringArrayList derivedDependencies = new StringArrayList();
            ArrayList directDependencies = new ArrayList();
            directDependencies.AddRange( this.SplitDependencyString( depends ));

            fullListOfDependencies.AddRange(this.GetFullDependencyList( target ));
            fullDependenciesString += "Total Dependencies (Derived + Direct):\r\n";

            if (fullListOfDependencies.Count > 0)
            {
                fullListOfDependencies.Sort();
                int maxStrLength = fullListOfDependencies.MaxStringLength();
                int columnLength = maxStrLength + 5;
                foreach( string dependency in fullListOfDependencies )
                {
                    String formattedStr = dependency;
                    if( directDependencies.Contains( dependency ))
                    {
                        string strFormat = "{0,-" + columnLength + "}{1}";
                        formattedStr = String.Format(strFormat,	formattedStr, "(direct)");
                    }
                    else
                    {
                        derivedDependencies.Add( dependency );
                    }
                    fullDependenciesString += "\t" + formattedStr;
                    fullDependenciesString += "\r\n";
                }
            }
            else
            {
                fullDependenciesString += "\t(none)\r\n";
            }
            return fullDependenciesString;
        }