示例#1
0
        /// <summary>
        /// Factory method: provides convenient way to construct <see cref="LayoutDirector"/>.
        /// </summary>
        /// <remarks>
        /// <para>If an argument value is not provided (i.e., it's null), then
        /// default implementation of required interface is provided. See the
        /// documentation of the constructor of this class for the list of
        /// default implementations of these interfaces.</para>
        /// </remarks>
        public static LayoutDirector GetLayoutDirector(
            ILayoutBuilder <int> builder,
            IDotParser <int> parser        = null,
            IGraphToDotConverter converter = null,
            IDotRunner dotRunner           = null)
        {
            Contract.Requires(builder != null);
            Contract.Ensures(Contract.Result <LayoutDirector>() != null);
            if (parser == null)
            {
                parser = AntlrParserAdapter <int> .GetParser();
            }
            if (converter == null)
            {
                converter = new GraphToDotConverter();
            }
            if (dotRunner == null)
            {
#if SILVERLIGHT
                dotRunner = new DotAutomationFactoryRunner();
#else
                dotRunner = new DotExeRunner();
#endif
            }

            return(new LayoutDirector(builder, parser, converter, dotRunner));
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LayoutDirector"/> class.
 /// </summary>
 /// <param name="builder">The builder is responsible for building the actual graphical output.</param>
 /// <param name="parser">The parser pases DOT output, default
 /// implementation is <see cref="AntlrParserAdapter{T}"/>.
 /// Use factory method <see cref="AntlrParserAdapter{T}.GetParser()"/></param>
 /// <param name="converter">The converter converts the .NET graph into a
 /// GraphViz representation. Default implementation is <see cref="GraphToDotConverter"/>.</param>
 /// <param name="dotRunner">The dot runner runs the DOT utility.
 /// Default implementation is <see cref="DotExeRunner"/></param>
 private LayoutDirector(
     ILayoutBuilder <int> builder,
     IDotParser <int> parser,
     IGraphToDotConverter converter,
     IDotRunner dotRunner)
 {
     Contract.Requires(parser != null);
     Contract.Requires(converter != null);
     Contract.Requires(builder != null);
     Contract.Requires(dotRunner != null);
     this.builder   = builder;
     this.parser    = parser;
     this.converter = converter;
     this.dotRunner = dotRunner;
 }
示例#3
0
        /// <summary>
        /// Factory method: provides convenient way to construct <see cref="LayoutDirector"/>. 
        /// </summary>
        /// <remarks>
        /// <para>If an argument value is not provided (i.e., it's null), then
        /// default implementation of required interface is provided. See the 
        /// documentation of the constructor of this class for the list of 
        /// default implementations of these interfaces.</para>
        /// </remarks>
        public static LayoutDirector GetLayoutDirector(
            ILayoutBuilder<int> builder,
            IDotParser<int> parser = null, 
            IGraphToDotConverter converter = null,
            IDotRunner dotRunner = null)
        {
            Contract.Requires(builder != null);
            Contract.Ensures(Contract.Result<LayoutDirector>() != null);
            if (parser == null)
                parser = AntlrParserAdapter<int>.GetParser();
            if (converter == null)
                converter = new GraphToDotConverter();
            if (dotRunner == null)
            {
#if SILVERLIGHT
                dotRunner = new DotAutomationFactoryRunner();
#else
                dotRunner = new DotExeRunner();
#endif
            }

            return new LayoutDirector(builder, parser, converter, dotRunner);
        }
示例#4
0
 public DotRunnerLogDecorator(IDotRunner runner, string filename = "tmp")
 {
     this.runner   = runner;
     this.filename = filename;
 }
 public DotRunnerLogDecorator(IDotRunner runner, string filename = "tmp")
 {
     this.runner = runner;
     this.filename = filename;
 }
示例#6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LayoutDirector"/> class.
 /// </summary>
 /// <param name="builder">The builder is responsible for building the actual graphical output.</param>
 /// <param name="parser">The parser pases DOT output, default 
 /// implementation is <see cref="AntlrParserAdapter{T}"/>. 
 /// Use factory method <see cref="AntlrParserAdapter{T}.GetParser()"/></param>
 /// <param name="converter">The converter converts the .NET graph into a 
 /// GraphViz representation. Default implementation is <see cref="GraphToDotConverter"/>.</param>
 /// <param name="dotRunner">The dot runner runs the DOT utility. 
 /// Default implementation is <see cref="DotExeRunner"/></param>
 private LayoutDirector(
     ILayoutBuilder<int> builder,
     IDotParser<int> parser, 
     IGraphToDotConverter converter, 
     IDotRunner dotRunner)
 {
     Contract.Requires(parser != null);
     Contract.Requires(converter != null);
     Contract.Requires(builder != null);
     Contract.Requires(dotRunner != null);
     this.builder = builder;
     this.parser = parser;
     this.converter = converter;
     this.dotRunner = dotRunner;
 }