public void SvgDirToXaml_with_defaultSettingsTest() { var resKeyInfo = new ResKeyInfo { XamlName = "Test", Prefix = "NamePrefix" }; var xaml = ConverterLogic.SvgDirToXaml("TestFiles\\", resKeyInfo, null); Console.WriteLine(xaml); }
public void SvgDirToXaml_with_defaultSettingsTest() { var resKeyInfo = new ResKeyInfo { XamlName = "Test", Prefix = "NamePrefix" }; var xaml = ConverterLogic.SvgDirToXaml("TestFiles\\", resKeyInfo, null, false); CheckXamlOutput(xaml); }
public void SvgDirToXamlTest() { var settings = new WpfDrawingSettings { IncludeRuntime = false, TextAsGeometry = false, OptimizePath = true, }; var xaml = ConverterLogic.SvgDirToXaml("..\\..\\TestFiles\\", "Test", settings); Console.WriteLine(xaml); }
public void SvgDirToXamlTest_withUseCompResKey() { var settings = new WpfDrawingSettings { IncludeRuntime = false, TextAsGeometry = false, OptimizePath = true, }; var xaml = ConverterLogic.SvgDirToXaml("TestFiles\\", ResKeyInfoUseCompResKey, settings, false); CheckXamlOutput(xaml); }
private void ExportDirExecute() { string outFileName = Path.Combine(CurrentDir, Path.GetFileNameWithoutExtension(CurrentDir) + ".xaml"); var saveDlg = new SaveFileDialog { AddExtension = true, DefaultExt = ".xaml", Filter = "Xaml-File|*.xaml", FileName = outFileName }; if (saveDlg.ShowDialog() == DialogResult.OK) { outFileName = saveDlg.FileName; File.WriteAllText(outFileName, ConverterLogic.SvgDirToXaml(CurrentDir, Path.GetFileNameWithoutExtension(outFileName))); MessageBox.Show(outFileName + "\nhas been written"); } }
public void SvgDirToXamlTest_withNamePrefix() { var settings = new WpfDrawingSettings { IncludeRuntime = false, TextAsGeometry = false, OptimizePath = true, }; var resKeyInfo = new ResKeyInfo { XamlName = "Test", Prefix = "NamePrefix" }; var xaml = ConverterLogic.SvgDirToXaml("TestFiles\\", resKeyInfo, settings, true); CheckXamlOutput(xaml); }
public void SvgDirToXamlTest_withUseCompResKey() { var settings = new WpfDrawingSettings { IncludeRuntime = false, TextAsGeometry = false, OptimizePath = true, }; var xaml = ConverterLogic.SvgDirToXaml("TestFiles\\", ResKeyInfoUseCompResKey, settings); Console.WriteLine(xaml); File.WriteAllText("TestFiles\\ExpectedXaml_SvgDirToXamlTest_withUseCompResKey.xaml", xaml); var expectedXaml = File.ReadAllText("TestFiles\\ExpectedXaml_SvgDirToXamlTest_withUseCompResKey.xaml"); xaml.Should().Be(expectedXaml); }
private void ExportDirExecute() { string outFileName = Path.GetFileNameWithoutExtension(CurrentDir) + ".xaml"; var saveDlg = new SaveFileDialog { AddExtension = true, DefaultExt = ".xaml", Filter = "Xaml-File|*.xaml", InitialDirectory = CurrentDir, FileName = outFileName }; if (saveDlg.ShowDialog() == DialogResult.OK) { string namePrefix = null; bool useComponentResKeys = false; string nameSpaceName = null; var nameSpace = Microsoft.VisualBasic.Interaction.InputBox("Enter a NameSpace for using static ComponentResKeys (or leave empty to not use it)", "NameSpace"); if (!string.IsNullOrWhiteSpace(nameSpace)) { useComponentResKeys = true; nameSpaceName = Microsoft.VisualBasic.Interaction.InputBox( "Enter a Name of NameSpace for using static ComponentResKeys", "NamespaceName"); } else { namePrefix = Microsoft.VisualBasic.Interaction.InputBox("Enter a namePrefix (or leave empty to not use it)", "Name Prefix"); if (string.IsNullOrWhiteSpace(namePrefix)) { namePrefix = null; } } outFileName = Path.GetFullPath(saveDlg.FileName); var resKeyInfo = new ResKeyInfo { XamlName = Path.GetFileNameWithoutExtension(outFileName), Prefix = namePrefix, UseComponentResKeys = useComponentResKeys, NameSpace = nameSpace, NameSpaceName = nameSpaceName, }; File.WriteAllText(outFileName, ConverterLogic.SvgDirToXaml(CurrentDir, resKeyInfo)); BuildBatchFile(outFileName, resKeyInfo); } }
public void SvgDirToXamlTest_withNamePrefix() { var settings = new WpfDrawingSettings { IncludeRuntime = false, TextAsGeometry = false, OptimizePath = true, }; var resKeyInfo = new ResKeyInfo { XamlName = "Test", Prefix = "NamePrefix" }; var xaml = ConverterLogic.SvgDirToXaml("TestFiles\\", resKeyInfo, settings); Console.WriteLine(xaml); //File.WriteAllText("TestFiles\\ExpectedXaml_SvgDirToXamlTest_withNamePrefix.xaml", xaml); var expectedXaml = File.ReadAllText("TestFiles\\ExpectedXaml_SvgDirToXamlTest_withNamePrefix.xaml"); xaml.Should().Be(expectedXaml); }
private void ExportDirExecute() { string outFileName = Path.GetFileNameWithoutExtension(CurrentDir) + ".xaml"; var saveDlg = new SaveFileDialog { AddExtension = true, DefaultExt = ".xaml", Filter = "Xaml-File|*.xaml", InitialDirectory = CurrentDir, FileName = outFileName }; if (saveDlg.ShowDialog() == DialogResult.OK) { outFileName = Path.GetFullPath(saveDlg.FileName); var resKeyInfo = new ResKeyInfo { XamlName = Path.GetFileNameWithoutExtension(outFileName), Prefix = null, UseComponentResKeys = false, NameSpace = null, NameSpaceName = null, }; File.WriteAllText(outFileName, ConverterLogic.SvgDirToXaml(CurrentDir, resKeyInfo, false)); BuildBatchFile(outFileName, resKeyInfo); } }
public void SvgDirToXaml_with_defaultSettingsTest() { var xaml = ConverterLogic.SvgDirToXaml("..\\..\\TestFiles\\", "Test", null); Console.WriteLine(xaml); }