public void WriteNodeDescription()

in Sharpmake/TrackedConfiguration.cs [96:181]


        public void WriteNodeDescription(System.IO.StreamWriter stream, bool writeExternNodes, bool verbose, string prefix)
        {
            bool isExternProject = IsExtern();
            _nodeVisited = true;
            bool writeDescription = (isExternProject == writeExternNodes);
            if (writeDescription)
            {
                stream.Write("\t" + GetUniqueId() + "[label=<" + GetDisplayedName(verbose) + ">");

                string shape;
                if (isExternProject)
                    shape = DependencyTracker.ShapeExtern;
                else
                {
                    switch (_configOutputType)
                    {
                        case Project.Configuration.OutputType.Exe:
                        case Project.Configuration.OutputType.Dll:
                        case Project.Configuration.OutputType.Lib:
                            shape = DependencyTracker.ShapeProject;
                            break;
                        default:
                            shape = DependencyTracker.ShapeUnknown;
                            break;
                    }
                }

                string color;
                Project.Configuration.OutputType outputType = Project.Configuration.OutputType.None;

                if (_configOutputType != Project.Configuration.OutputType.None)
                {
                    outputType = _configOutputType;
                }
                else if (_config != null)
                {
                    // output type might be defined in inherited target class (this is the case for some extern project). Try to find it through reflection.
                    try
                    {
                        System.Type type = _config.Target.GetType();
                        System.Reflection.FieldInfo field = type.GetField("OutputType");
                        object fieldValue = field.GetValue(_config.Target);
                        switch (fieldValue.ToString())
                        {
                            case "Dll":
                                outputType = Project.Configuration.OutputType.Dll;
                                break;
                            case "Lib":
                                outputType = Project.Configuration.OutputType.Lib;
                                break;
                            case "Exe":
                                outputType = Project.Configuration.OutputType.Exe;
                                break;
                            default:
                                outputType = Project.Configuration.OutputType.None;
                                break;
                        }
                    }
                    catch { }
                }

                switch (outputType)
                {
                    case Project.Configuration.OutputType.Exe:
                        color = isExternProject ? DependencyTracker.ColorExternExe : DependencyTracker.ColorExe;
                        break;
                    case Project.Configuration.OutputType.Dll:
                        color = isExternProject ? DependencyTracker.ColorExternDll : DependencyTracker.ColorDll;
                        break;
                    case Project.Configuration.OutputType.Lib:
                        color = isExternProject ? DependencyTracker.ColorExternLib : DependencyTracker.ColorLib;
                        break;
                    default:
                        color = DependencyTracker.ColorUnkownOutputType;
                        break;
                }

                stream.WriteLine(" shape = " + shape + ", style=filled, fillcolor = " + color + ", fontsize=8, fontname=\"sans-serif\"]");
            }

            foreach (var dep in _dependenciesTo)
            {
                if (!dep.Key.IsNodeVisited())
                    dep.Key.WriteNodeDescription(stream, writeExternNodes, verbose, prefix + " ");
            }
        }