Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
################################################################################
# This .gitignore file was automatically created by Microsoft(R) Visual Studio.
################################################################################

/obj/Debug
/bin
/obj
/.vs/Latex4CorelDRAW
/.vs
45 changes: 44 additions & 1 deletion DockerUI.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using System.Windows.Navigation;
using System.Windows.Shapes;
using corel = Corel.Interop.VGCore;
using System.Reflection;

namespace Latex4CorelDraw
{
Expand All @@ -35,7 +36,7 @@ public DockerUI(corel.Application app)
this.corelApp = app;
m_current = this;
InitializeComponent();

AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
AddinUtilities.initFonts();
AddinUtilities.copyLatexTemplate("LatexTemplate.txt", Properties.Resources.LatexTemplate);

Expand Down Expand Up @@ -103,5 +104,47 @@ private void btn_addEqnarray_Click(object sender, RoutedEventArgs e)
string template = "\\begin{eqnarray*}\r\n\t<Enter latex code>\r\n\\end{eqnarray*}\r\n";
createLatexObject(template, "Create latex equation array");
}
private Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
if (args.RequestingAssembly != null)
return args.RequestingAssembly;
Assembly asm = null;
string name = args.Name;
if (name.Contains(".resources"))
name = name.Replace(".resources", "");
asm = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(r => string.Equals(r.FullName.Split(',')[0], name.Split(',')[0]));
if (args.Name.Contains(".resources"))
asm = LoadResourceAssembly(asm);
if (asm == null)
asm = Assembly.LoadFrom(Name);
return asm;
}
private Assembly LoadResourceAssembly(Assembly executingAsm)
{
if (executingAsm == null)
return executingAsm;
string[] resourcesName = executingAsm.GetManifestResourceNames();
string resourceName = string.Empty;
for (int i = 0; i < resourcesName.Length; i++)
{
if (!resourcesName[i].Contains(".g."))
{
resourceName = resourcesName[i];
break;
}
}
if (string.IsNullOrEmpty(resourceName))
return executingAsm;
using (var stream = executingAsm.GetManifestResourceStream(resourceName))
{
if (stream != null)
{
byte[] assemblyData = new byte[stream.Length];
stream.Read(assemblyData, 0, assemblyData.Length);
return Assembly.Load(assemblyData);
}
}
return executingAsm;
}
}
}
214 changes: 181 additions & 33 deletions Latex4CorelDraw.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CdrTargetPath>$(SolutionDir)bonus630.CDRCommon.targets</CdrTargetPath>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
Expand All @@ -13,6 +14,7 @@
<!--<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>-->
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<Import Project="$(CdrTargetPath)" Condition="Exists('$(CdrTargetPath)')" />
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
Expand All @@ -23,19 +25,173 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'X7 Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;X7</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'X7 Release|AnyCPU'">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\$(CurrentCorelAbs)\</OutputPath>
<OutDir>bin\Release\$(CurrentCorelAbs)\$(SolutionName)</OutDir>
<DefineConstants>TRACE;X7</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'X8 Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;X8</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'X8 Release|AnyCPU'">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\$(CurrentCorelAbs)\</OutputPath>
<OutDir>bin\Release\$(CurrentCorelAbs)\$(SolutionName)</OutDir>
<DefineConstants>TRACE;X8</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '2017 Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;X9</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '2017 Release|AnyCPU'">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\$(CurrentCorelAbs)\</OutputPath>
<OutDir>bin\Release\$(CurrentCorelAbs)\$(SolutionName)</OutDir>
<DefineConstants>TRACE;X9</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '2018 Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;X10</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '2018 Release|AnyCPU'">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<OutDir>bin\Release\$(SolutionName)</OutDir>
<DefineConstants>TRACE</DefineConstants>
<OutputPath>bin\Release\$(CurrentCorelAbs)\</OutputPath>
<OutDir>bin\Release\$(CurrentCorelAbs)\$(SolutionName)</OutDir>
<DefineConstants>TRACE;X10</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '2019 Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;X11</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '2019 Release|AnyCPU'">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\$(CurrentCorelAbs)\</OutputPath>
<OutDir>bin\Release\$(CurrentCorelAbs)\$(SolutionName)</OutDir>
<DefineConstants>TRACE;X11</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '2020 Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;X12</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '2020 Release|AnyCPU'">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\$(CurrentCorelAbs)\</OutputPath>
<OutDir>bin\Release\$(CurrentCorelAbs)\$(SolutionName)</OutDir>
<DefineConstants>TRACE;X12</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '2021 Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;X13</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '2021 Release|AnyCPU'">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\$(CurrentCorelAbs)\</OutputPath>
<OutDir>bin\Release\$(CurrentCorelAbs)\$(SolutionName)</OutDir>
<DefineConstants>TRACE;X13</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '2022 Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;X14</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '2022 Release|AnyCPU'">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\$(CurrentCorelAbs)\</OutputPath>
<OutDir>bin\Release\$(CurrentCorelAbs)\$(SolutionName)</OutDir>
<DefineConstants>TRACE;X14</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '2024 Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;X15</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == '2024 Release|AnyCPU'">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\$(CurrentCorelAbs)\</OutputPath>
<OutDir>bin\Release\$(CurrentCorelAbs)\$(SolutionName)</OutDir>
<DefineConstants>TRACE;X15</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="ScintillaNET, Version=2.6.0.0, Culture=neutral, PublicKeyToken=948d6c9751444115, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>ScintillaNET\ScintillaNET.dll</HintPath>
<EmbedInteropTypes>False</EmbedInteropTypes>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand All @@ -50,7 +206,9 @@
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="WindowsBase" />
<Reference Include="c:\program files\corel\CorelDRAW Graphics Suite 2021\programs64\Assemblies\Corel.Interop.VGCore.dll">
</ItemGroup>
<ItemGroup Label="VGCoreReferences">
<Reference Include="$(CurrentCorelPath)$(VGCoreDLL)">
<Name>Corel.Interop.VGCore</Name>
<Private>False</Private>
</Reference>
Expand All @@ -77,13 +235,9 @@
</Page>
<Compile Include="DockerUI.xaml.cs">
<SubType>Code</SubType>
<DependentUpon>DockerUI.xaml</DependentUpon>
</Compile>
</ItemGroup>
<!--<ItemGroup>
<Compile Include="DockerUI.xaml" />
<Compile Include="DockerUI.xaml.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>-->
<ItemGroup>
<Compile Include="LatexFileGenerator.cs" />
<Compile Include="OptionsDialog.cs">
Expand Down Expand Up @@ -131,6 +285,21 @@
</Content>
<None Include="Resources\Language.xml" />
<None Include="Resources\LatexTemplate.txt" />
<Content Include="License.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="SciLexer.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="SciLexer64.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="ScintillaNET.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="ScintillaNET.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="UserUI.xslt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<SubType>Designer</SubType>
Expand All @@ -140,29 +309,8 @@
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PostBuildEvent>
if not exist "c:\program files\corel\CorelDRAW Graphics Suite 2021\programs64\addons\$(SolutionName)" md "c:\program files\corel\CorelDRAW Graphics Suite 2021\programs64\addons\$(SolutionName)"
copy "$(TargetPath)" "c:\program files\corel\CorelDRAW Graphics Suite 2021\programs64\addons\$(SolutionName)" /y
copy "$(ProjectDir)CorelDrw.addon" "c:\program files\corel\CorelDRAW Graphics Suite 2021\programs64\addons\$(SolutionName)" /y
copy "$(ProjectDir)AppUI.xslt" "c:\program files\corel\CorelDRAW Graphics Suite 2021\programs64\addons\$(SolutionName)" /y
copy "$(ProjectDir)UserUI.xslt" "c:\program files\corel\CorelDRAW Graphics Suite 2021\programs64\addons\$(SolutionName)" /y
copy "$(ProjectDir)\ScintillaNET\SciLexer.dll" "c:\program files\corel\CorelDRAW Graphics Suite 2021\programs64\addons\$(SolutionName)" /y
copy "$(ProjectDir)\ScintillaNET\SciLexer64.dll" "c:\program files\corel\CorelDRAW Graphics Suite 2021\programs64\addons\$(SolutionName)" /y
copy "$(ProjectDir)\ScintillaNET\ScintillaNET.dll" "c:\program files\corel\CorelDRAW Graphics Suite 2021\programs64\addons\$(SolutionName)" /y
copy "$(ProjectDir)\ScintillaNET\ScintillaNET.xml" "c:\program files\corel\CorelDRAW Graphics Suite 2021\programs64\addons\$(SolutionName)" /y
if $(ConfigurationName) == Debug copy "$(TargetDir)\$(SolutionName).pdb" "c:\program files\corel\CorelDRAW Graphics Suite 2021\programs64\addons\$(SolutionName)\$(SolutionName).pdb"
</PostBuildEvent>
</PropertyGroup>
<PropertyGroup>
<StartAction>Program</StartAction>
<StartProgram>c:\program files\corel\CorelDRAW Graphics Suite 2021\programs64\CorelDRW.exe</StartProgram>
<StartProgram>$(CurrentCorelPath)CorelDRW.exe</StartProgram>
</PropertyGroup>
</Project>
6 changes: 6 additions & 0 deletions Latex4CorelDraw.csproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
</Project>
Loading