Skip to content

Commit

Permalink
Reformat codes
Browse files Browse the repository at this point in the history
  • Loading branch information
lzcapp committed Feb 20, 2024
1 parent 2734580 commit 8fea38d
Show file tree
Hide file tree
Showing 7 changed files with 8,989 additions and 8,968 deletions.
2 changes: 1 addition & 1 deletion FrmBookRename.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ private bool IsRevised() {
return _bookname.Trim() != txtBook.Text.Trim() || _authorname.Trim() != txtAuthor.Text.Trim();
}
}
}
}
5,901 changes: 2,954 additions & 2,947 deletions FrmBookRename.resx

Large diffs are not rendered by default.

5,897 changes: 2,950 additions & 2,947 deletions FrmEdit.resx

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions FrmMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,12 @@ private void DisplayData() {

dataGridView.Sort(dataGridView.Columns["clippingdate"]!, ListSortDirection.Descending);

var books = _dataTable.AsEnumerable().Select(row => new { BookName = row.Field<string>("bookname"), AuthorName = row.Field<string>("authorname") }).Distinct();
var books = _dataTable.AsEnumerable().Select(row => new {
BookName = row.Field<string>("bookname"), AuthorName = row.Field<string>("authorname")
}).Distinct();

var rootNode = new TreeNode("全部") {
ImageIndex = 2,
SelectedImageIndex = 2
ImageIndex = 2, SelectedImageIndex = 2
};

treeView.Nodes.Clear();
Expand Down Expand Up @@ -340,18 +341,18 @@ private void ImportKindleClippings(string clippingsPath) {
}

var insertedOriginCount = (from DataRow row in originClippingsTable.Rows
where !_staticData.IsExistOriginalClippings(row["key"].ToString())
select _staticData.InsertOriginClippings(row["key"].ToString() ?? string.Empty, row["line1"].ToString() ?? string.Empty, row["line2"].ToString() ?? string.Empty, row["line3"].ToString() ?? string.Empty,
row["line4"].ToString() ?? string.Empty, row["line5"].ToString() ?? string.Empty)).Sum();
where !_staticData.IsExistOriginalClippings(row["key"].ToString())
select _staticData.InsertOriginClippings(row["key"].ToString() ?? string.Empty, row["line1"].ToString() ?? string.Empty, row["line2"].ToString() ?? string.Empty, row["line3"].ToString() ?? string.Empty,
row["line4"].ToString() ?? string.Empty, row["line5"].ToString() ?? string.Empty)).Sum();

var insertedCount = 0;

if (insertedOriginCount > 0) {
insertedCount += (from DataRow row in clippingsTable.Rows
where !_staticData.IsExistClippings(row["key"].ToString())
select _staticData.InsertClippings(row["key"].ToString() ?? string.Empty, row["content"].ToString() ?? string.Empty, row["bookname"].ToString() ?? string.Empty, row["authorname"].ToString() ?? string.Empty,
(int)row["brieftype"], row["clippingtypelocation"].ToString() ?? string.Empty, row["clippingdate"].ToString() ?? string.Empty, (int)row["read"], row["clipping_importdate"].ToString() ?? string.Empty,
row["tag"].ToString() ?? string.Empty, (int)row["sync"], row["newbookname"].ToString() ?? string.Empty, (int)row["colorRGB"], (int)row["pagenumber"])).Sum();
where !_staticData.IsExistClippings(row["key"].ToString())
select _staticData.InsertClippings(row["key"].ToString() ?? string.Empty, row["content"].ToString() ?? string.Empty, row["bookname"].ToString() ?? string.Empty, row["authorname"].ToString() ?? string.Empty,
(int)row["brieftype"], row["clippingtypelocation"].ToString() ?? string.Empty, row["clippingdate"].ToString() ?? string.Empty, (int)row["read"], row["clipping_importdate"].ToString() ?? string.Empty,
row["tag"].ToString() ?? string.Empty, (int)row["sync"], row["newbookname"].ToString() ?? string.Empty, (int)row["colorRGB"], (int)row["pagenumber"])).Sum();

if (insertedCount > 0) {
DisplayData();
Expand Down Expand Up @@ -552,8 +553,7 @@ private void MenuImportKindleMate_Click(object sender, EventArgs e) {
private void MenuRepo_Click(object sender, EventArgs e) {
const string repoUrl = "https://github.com/lzcapp/KindleMate2";
Process.Start(new ProcessStartInfo {
FileName = repoUrl,
UseShellExecute = true
FileName = repoUrl, UseShellExecute = true
});
}

Expand Down
Loading

0 comments on commit 8fea38d

Please sign in to comment.