/// <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)); }
/// <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; }
/// <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); }
public DotRunnerLogDecorator(IDotRunner runner, string filename = "tmp") { this.runner = runner; this.filename = filename; }
/// <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; }