public static IExporter createExporter(String filetype, System.Windows.Controls.Canvas canvas, MatrixSelection.Fields.Field selectedField) { switch (filetype) { case ".bmp": case ".png": case ".jpeg": case ".gif": case ".tiff": return(new ImageExporter(filetype, canvas)); case ".mxml": return(new MXMLExporter(selectedField.EventLog)); case ".pnml": return(new PNMLExporter(selectedField.ProcessModel)); case ".dot": return(new DotExporter(selectedField.ProcessModel)); } throw new NotImplementedException("No exporter available for the filetype: " + filetype); }
internal static string getFilterString(System.Windows.Controls.Canvas processModelCanvas, MatrixSelection.Fields.Field selectedField) { StringBuilder filterString = new StringBuilder(""); //PNG, JPEG, BMP, GIF, TIFF if (processModelCanvas != null) { filterString.Append("PNG Image|*.png|JPEG Image|*.jpeg|Bitmap Image|*.bmp|GIF Image|*.gif|TIFF Image|*.tiff"); } //DOT, PNML if (selectedField != null && selectedField.ProcessModel != null) { if (filterString.Length > 0) { filterString.Append("|"); } filterString.Append("DOT (GraphViz)|*.dot|Petri Net Markup Language (PNML)|*.pnml"); } //MXML if (selectedField != null && selectedField.EventLog != null) { if (filterString.Length > 0) { filterString.Append("|"); } filterString.Append("Mining eXtensible Markup Language (MXML)|*.mxml"); } return(filterString.ToString()); }