예제 #1
0
 public DiagramDefinition(string name, IScope scope, OutputSettings output, IEnumerable<Filter> filters, bool dependencyDown = true, bool hideAnonymousLayers = true)
 {
     Name = name;
     Scope = scope;
     Output = output;
     Filters = filters;
     HideAnonymousLayers = hideAnonymousLayers;
     DependencyDown = dependencyDown;
 }
예제 #2
0
        public static async Task RenderTreeToBitmapAsync(Node tree, bool dependencyDown, OutputSettings outputSettings, bool hideAnonymousNodes = true, bool overWrite = true)
        {
            if (!tree.HasChildren())
                throw new Exception("Empty diagram");

            if (overWrite)
            {
                if (File.Exists(outputSettings.Path))
                    File.Delete(outputSettings.Path);
            }
            
            var viewModel = LayerMapper.TreeModelToArchViewModel(tree,dependencyDown,hideAnonymousNodes);
            await StartStaTask(() => RenderViewModelToBitmap(viewModel, outputSettings.Path, outputSettings.Size));
        }
예제 #3
0
 public static void RenderTreeToBitmap(Node tree, bool dependencyDown, OutputSettings outputSettings, bool hideAnonymousNodes = true, bool overWrite = true)
 {
     RenderTreeToBitmapAsync(tree, dependencyDown, outputSettings, hideAnonymousNodes, overWrite).Wait();
 }
예제 #4
0
 private static OutputSettings ParseOutputSettings(XmlNode output)
 {
     var outputPath = RequireAttribute(output, "Path");
     int scale;
     int.TryParse(output.Attributes?.GetNamedItem("Scale")?.Value, out scale);
     if (scale == 0)
         scale = 1;
     var outputSettings = new OutputSettings(outputPath, scale);
     return outputSettings;
 }