Skip to content

Commit

Permalink
如果已经存在的替换好的文件,则不再重复
Browse files Browse the repository at this point in the history
优化UI
  • Loading branch information
aiqinxuancai committed Aug 28, 2021
1 parent cc55689 commit 08db2b6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion EvernoteToNotionChrome/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ private static void InitializeCefSharp()
//硬件加速设置
setting.CefCommandLineArgs.Add("--enable-media-stream", "1");
//setting.CefCommandLineArgs.Add("disable-gpu", "0");
setting.SetOffScreenRenderingBestPerformanceArgs();
//setting.SetOffScreenRenderingBestPerformanceArgs();
//setting.CefCommandLineArgs.Add("disable-gpu", "1");
//setting.CefCommandLineArgs.Add("disable-gpu-compositing", "1");
//setting.CefCommandLineArgs.Add("enable-begin-frame-scheduling", "1");
Expand Down
2 changes: 1 addition & 1 deletion EvernoteToNotionChrome/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</Grid.ColumnDefinitions>


<Button Grid.Column="1" x:Name="TestDrag" Content="Start" Click="TestDrag_Click" Margin="10,0,0,0" Height="40" Width="100"></Button>
<Button Grid.Column="1" x:Name="ButtonStart" Content="Start" Click="ButtonStart_Click" Margin="10,0,0,0" Height="40" Width="100"></Button>

<StackPanel>
<TextBlock Text="请粘贴Everonte导出的HTML所在目录"></TextBlock>
Expand Down
6 changes: 4 additions & 2 deletions EvernoteToNotionChrome/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
}


private async void TestDrag_Click(object sender, RoutedEventArgs e)
private async void ButtonStart_Click(object sender, RoutedEventArgs e)
{
ButtonStart.IsEnabled = false;
var path = TextBoxPath.Text;
await Task.Run(() => {
StartWithPath(path);
});
});
ButtonStart.IsEnabled = true;
}

private void Browser_Loaded(object sender, RoutedEventArgs e)
Expand Down
11 changes: 10 additions & 1 deletion EvernoteToNotionChrome/Service/HtmlManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ public static void UploadHtmlData(string filePath)
doc.Load(filePath);

var path = Path.GetDirectoryName(filePath);
var savePath = path + @"\Replace\" + Path.GetFileName(filePath);

if (File.Exists(savePath))
{
//已经存在 不继续处理
return;
}


if (!Directory.Exists(path + @"\Replace\"))
{
Directory.CreateDirectory(path + @"\Replace\");
Expand Down Expand Up @@ -87,7 +96,7 @@ public static void UploadHtmlData(string filePath)

Debug.WriteLine(docString);

File.WriteAllText(path + @"\Replace\" + Path.GetFileName(filePath), docString);
File.WriteAllText(savePath, docString);

}

Expand Down

0 comments on commit 08db2b6

Please sign in to comment.