Skip to content

Commit

Permalink
Remove AvalonEdit, Open with Visual Studio Code
Browse files Browse the repository at this point in the history
  • Loading branch information
daramkun committed Apr 9, 2018
1 parent a9f24a0 commit 47182da
Show file tree
Hide file tree
Showing 18 changed files with 204 additions and 352 deletions.
51 changes: 31 additions & 20 deletions Daramkun.DaramRenamer.Engine/ProcessorExtensions.cs
Expand Up @@ -63,7 +63,6 @@ public static MethodInfo CreateMethod ( this ICondition condition )
}
private static MethodInfo GenerateDynamicMethod ( Type type, string methodName, string callMethod )
{

List<PropertyInfo> propInfos = new List<PropertyInfo> ();
List<Type> paramTypes = new List<Type> ( 8 )
{
Expand Down Expand Up @@ -110,30 +109,38 @@ private static MethodInfo GenerateDynamicMethod ( Type type, string methodName,
return method;
}

static List<Delegate> delegates = new List<Delegate> ();
public static IReadOnlyList<Delegate> Delegates => delegates;
public static void CollectDelegates ()
static List<Delegate> delegates;
public static IReadOnlyList<Delegate> Delegates
{
Assembly assembly = Assembly.Load ( "DaramRenamer.Engine" );
foreach ( Type type in assembly.GetTypes () )
get
{
if ( type.GetInterface ( typeof ( IProcessor ).FullName ) != null )
{
IProcessor processor = Activator.CreateInstance ( type ) as IProcessor;
MethodInfo methodInfo = processor.CreateMethod ();
Type methodType = processor.GetMethodType ();
delegates.Add ( methodInfo.CreateDelegate ( methodType ) );
}
else if ( type.GetInterface ( typeof ( ICondition ).FullName ) != null )
if ( delegates == null)
{
ICondition condition = Activator.CreateInstance ( type ) as ICondition;
MethodInfo methodInfo = condition.CreateMethod ();
Type methodType = condition.GetMethodType ();
delegates.Add ( methodInfo.CreateDelegate ( methodType ) );
delegates = new List<Delegate> ();

Assembly assembly = Assembly.Load ( "DaramRenamer.Engine" );
foreach ( Type type in assembly.GetTypes () )
{
if ( type.GetInterface ( typeof ( IProcessor ).FullName ) != null )
{
IProcessor processor = Activator.CreateInstance ( type ) as IProcessor;
MethodInfo methodInfo = processor.CreateMethod ();
Type methodType = processor.GetMethodType ();
delegates.Add ( methodInfo.CreateDelegate ( methodType ) );
}
else if ( type.GetInterface ( typeof ( ICondition ).FullName ) != null )
{
ICondition condition = Activator.CreateInstance ( type ) as ICondition;
MethodInfo methodInfo = condition.CreateMethod ();
Type methodType = condition.GetMethodType ();
delegates.Add ( methodInfo.CreateDelegate ( methodType ) );
}
}
delegates.Add ( new Func<string> ( get_renamer_version ) );
delegates.Add ( new Func<string, string> ( get_file_content ) );
}
return delegates;
}
delegates.Add ( new Func<string> ( get_renamer_version ) );
delegates.Add ( new Func<string, string> ( get_file_content ) );
}

private static string get_renamer_version ()
Expand All @@ -145,5 +152,9 @@ private static string get_file_content ( string filename )
{
try { return File.ReadAllText ( filename, Encoding.UTF8 ); } catch { return null; }
}
private static FileInfo create_file_info ( string filename )
{
return new FileInfo ( filename );
}
}
}
Expand Up @@ -27,10 +27,7 @@ public bool Process ( FileInfo file )
{
f = TagLib.File.Create ( new TagLib.File.LocalFileAbstraction ( file.OriginalFullPath ) );
}
catch ( Exception ex )
{
return false;
}
catch { return false; }

string tag = "";
switch ( Tag )
Expand Down
127 changes: 6 additions & 121 deletions Daramkun.DaramRenamer/App.xaml

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions Daramkun.DaramRenamer/App.xaml.cs
Expand Up @@ -47,8 +47,6 @@ public App ()
Debug.Listeners.Remove ( textWriterTraceListnerForFile );
}
};

ProcessorExtensions.CollectDelegates ();
}

string [] args;
Expand Down
40 changes: 5 additions & 35 deletions Daramkun.DaramRenamer/DaramRenamer.manifest
@@ -1,36 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="3.2.0.0" name="DaramRenamer.app" processorArchitecture="msil" type="win32" />
<assemblyIdentity version="3.3.0.0" name="DaramRenamer.app" processorArchitecture="msil" type="win32" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC 매니페스트 옵션
Windows 사용자 계정 컨트롤 수준을 변경하려면
requestedExecutionLevel 노드를 다음 중 하나로 바꿉니다.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
requestedExecutionLevel 요소를 지정하면 파일 및 레지스트리 가상화를 사용하지 않습니다.
이전 버전과의 호환성을 위해 응용 프로그램에 가상화가 필요한 경우
이 요소를 제거합니다.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
<applicationRequestMinimum>
<defaultAssemblyRequest permissionSetReference="Custom" />
<PermissionSet ID="Custom" SameSite="site" Unrestricted="true" />
</applicationRequestMinimum>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- 이 응용 프로그램이 테스트되고 함께 작동하도록 설계된 Windows 버전
목록입니다. 적절한 요소의 주석 처리를 제거하면 Windows에서
호환 가능성이 가장 높은 환경을 자동으로 선택합니다. -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
<!-- Windows 8 -->
Expand All @@ -41,26 +20,17 @@
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
<!-- 응용 프로그램에서 DPI를 인식하며 높은 DPI에서는 Windows가 자동으로 크기를 조정하지
않습니다. WPF(Windows Presentation Foundation) 응용 프로그램은 자동으로 DPI를 인식하며
옵트인할 필요가 없습니다. 이 설정으로 옵트인하며 .NET Framework 4.6을 대상으로 하는
Windows Forms 응용 프로그램은 app.config에서 'EnableWindowsFormsHighDpiAutoResizing' 설정도 'true'로 지정합니다. -->

<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
<!-- Windows 공용 컨트롤 및 대화 상자의 테마 사용(Windows XP 이상) -->

<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0"
processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" />
</dependentAssembly>
</dependency>
</assembly>
23 changes: 3 additions & 20 deletions Daramkun.DaramRenamer/Daramkun.DaramRenamer.csproj
Expand Up @@ -16,6 +16,8 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
<IsWebBootstrapper>false</IsWebBootstrapper>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<PublishUrl>Publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
Expand All @@ -31,8 +33,6 @@
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -76,7 +76,7 @@
<GenerateManifests>false</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
<SignManifests>false</SignManifests>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
Expand All @@ -90,18 +90,11 @@
<ApplicationManifest>DaramRenamer.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="ICSharpCode.AvalonEdit, Version=5.0.3.0, Culture=neutral, PublicKeyToken=9cc39be672370310, processorArchitecture=MSIL">
<HintPath>..\packages\AvalonEdit.5.0.4\lib\Net40\ICSharpCode.AvalonEdit.dll</HintPath>
</Reference>
<Reference Include="Jint, Version=0.0.0.0, Culture=neutral, PublicKeyToken=2e92ba9c8d81157f, processorArchitecture=MSIL">
<HintPath>..\packages\Jint.2.11.58\lib\net451\Jint.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.IO.Compression, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.Compression.4.3.0\lib\net46\System.IO.Compression.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xaml">
Expand Down Expand Up @@ -160,20 +153,10 @@
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<None Include="Daramkun.DaramRenamer_TemporaryKey.pfx" />
<None Include="DaramRenamer.manifest" />
<None Include="DaramRenamer.pfx" />
<EmbeddedResource Include="Localization.json" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
Expand Down
Binary file not shown.
6 changes: 4 additions & 2 deletions Daramkun.DaramRenamer/Localization.json
Expand Up @@ -201,7 +201,8 @@

"batch_load": "열기",
"batch_save": "저장",
"batch_filters": ""
"open_with_vscode": "Visual Studio Code로 열기",
"batch_filters": "Javascript 파일(*.js)|*.js"
}
},
{
Expand Down Expand Up @@ -403,9 +404,10 @@

"os_notice": "Please execute Daram Renamer in Windows 7 or Higher version.",

"open_with_vscode": "Open with Visual Studio Code",
"batch_load": "Load",
"batch_save": "Save",
"batch_filters": "Daram Renamer Javascript File"
"batch_filters": "Javascript File(*.js)|*.js"
}
}
]
Expand Down

0 comments on commit 47182da

Please sign in to comment.