From 2b1991f17693a54cb22b88efe37246916953fdf2 Mon Sep 17 00:00:00 2001 From: Olivier Rogier Date: Fri, 20 Sep 2019 04:20:00 +0200 Subject: [PATCH] Fix tree --- Project/Hebrew Words (vs2017).csproj | 16 -- Project/Properties/AssemblyInfo.cs | 4 +- .../Forms/Import/ImportVerseForm.Analyse.cs | 113 --------- .../Forms/Import/ImportVerseForm.Designer.cs | 215 ------------------ .../Forms/Import/ImportVerseForm.Ghost.cs | 82 ------- .../Source/Forms/Import/ImportVerseForm.cs | 98 -------- .../Source/Forms/Import/ImportVerseForm.resx | 123 ---------- .../MainForm/MainForm.DB.LoadFromFiles.cs | 11 +- Project/Source/Forms/MainForm/MainForm.cs | 56 ++--- Project/Source/Forms/MainForm/MainForm.resx | 5 +- README.md | 4 - Setup/OrdisoftwareHebrewWordsSetup.iss | 2 +- 12 files changed, 30 insertions(+), 699 deletions(-) delete mode 100644 Project/Source/Forms/Import/ImportVerseForm.Analyse.cs delete mode 100644 Project/Source/Forms/Import/ImportVerseForm.Designer.cs delete mode 100644 Project/Source/Forms/Import/ImportVerseForm.Ghost.cs delete mode 100644 Project/Source/Forms/Import/ImportVerseForm.cs delete mode 100644 Project/Source/Forms/Import/ImportVerseForm.resx diff --git a/Project/Hebrew Words (vs2017).csproj b/Project/Hebrew Words (vs2017).csproj index ab79f217f..1e22ad47e 100644 --- a/Project/Hebrew Words (vs2017).csproj +++ b/Project/Hebrew Words (vs2017).csproj @@ -60,18 +60,6 @@ True DataSet.xsd - - Form - - - Form - - - Form - - - ImportVerseForm.cs - @@ -267,9 +255,6 @@ GrammarGuideForm.cs - - ImportVerseForm.cs - AboutBox.cs @@ -359,7 +344,6 @@ DataSet.xsd - SettingsSingleFileGenerator Settings.Designer.cs diff --git a/Project/Properties/AssemblyInfo.cs b/Project/Properties/AssemblyInfo.cs index f550cc87b..cb3d198fa 100644 --- a/Project/Properties/AssemblyInfo.cs +++ b/Project/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut // en utilisant '*', comme indiqué ci-dessous : // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.0.0")] -[assembly: AssemblyFileVersion("2.1.0.0")] +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] diff --git a/Project/Source/Forms/Import/ImportVerseForm.Analyse.cs b/Project/Source/Forms/Import/ImportVerseForm.Analyse.cs deleted file mode 100644 index c25c6fc6c..000000000 --- a/Project/Source/Forms/Import/ImportVerseForm.Analyse.cs +++ /dev/null @@ -1,113 +0,0 @@ -/// -/// This file is part of Ordisoftware Hebrew Words. -/// Copyright 2012-2019 Olivier Rogier. -/// See www.ordisoftware.com for more information. -/// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. -/// If a copy of the MPL was not distributed with this file, You can obtain one at -/// https://mozilla.org/MPL/2.0/. -/// If it is not possible or desirable to put the notice in a particular file, -/// then You may include the notice in a location(such as a LICENSE file in a -/// relevant directory) where a recipient would be likely to look for such a notice. -/// You may add additional accurate notices of copyright ownership. -/// -/// 2019-09 -/// 2019-09 -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using Ordisoftware.Core; - -namespace Ordisoftware.HebrewWords -{ - - public class ImportResult - { - public string Hebrew { get; set; } - public string OriginalTranslation { get; set; } - public string NewTranslation { get; set; } - } - - public class ImportResults : List - { - public ImportResults() { } - public ImportResults(int capacity) : base(capacity) { } - public ImportResults(IEnumerable collection) : base(collection) { } - } - - public partial class ImportVerseForm : Form - { - - private const char ElementsSeparator = '|'; - - private ImportResults ImportResults = new ImportResults(); - - private void DoAnalyse() - { - var FounWords = new List(); - var FoundTranslation = new List(); - DataGridView.DataSource = null; - FounWords.Clear(); - FoundTranslation.Clear(); - ImportResults.Clear(); - var lines = EditSource.Lines.Where(line => line != "").ToList(); - if ( lines.Count % 2 != 0 ) - { - IsResultValid = false; - DisplayManager.ShowError("Incorrect input lines count: must be even."); - return; - } - for ( int indexLineEven = 0; indexLineEven < lines.Count; indexLineEven += 2 ) - { - string lineHebrew = lines[indexLineEven]; - string lineTranslation = lines[indexLineEven + 1]; - var lineHebrewElements = lineHebrew.Split(ElementsSeparator); - var lineTranslationElements = lineTranslation.Split(ElementsSeparator); - for ( int index = 0; index < lineHebrewElements.Length; index++ ) - lineHebrewElements[index] = lineHebrewElements[index].Trim(); - for ( int index = 0; index < lineTranslationElements.Length; index++ ) - lineTranslationElements[index] = lineTranslationElements[index].Trim(); - if ( lineHebrewElements.Length == 0 - || lineTranslationElements.Length == 0 - || lineHebrewElements.Length != lineTranslationElements.Length ) - { - IsResultValid = false; - DisplayManager.ShowError("Incorrect elements count: hebrew words count and translations count does not match."); - return; - } - FounWords.AddRange(lineHebrewElements.Reverse()); - FoundTranslation.AddRange(lineTranslationElements.Reverse()); - } - var wordsReference = Reference.Verse.GetWordsRows(); - if ( wordsReference.Count() != FounWords.Count) - { - IsResultValid = false; - DisplayManager.ShowError("Incorrect element count: verse words count and imported words count does not match."); - return; - } - for ( int index = 0; index < FounWords.Count; index++ ) - { - if ( FounWords[index] != wordsReference[index].Hebrew ) - { - IsResultValid = false; - DisplayManager.ShowError("Incorrect hebrew words: verse words and imported words does not match."); - return; - } - var item = new ImportResult(); - item.Hebrew = wordsReference[index].Hebrew; - item.OriginalTranslation = wordsReference[index].Translation; - item.NewTranslation = FoundTranslation[index]; - ImportResults.Add(item); - } - DataGridView.DataSource = ImportResults; - IsResultValid = true; - } - - } - -} diff --git a/Project/Source/Forms/Import/ImportVerseForm.Designer.cs b/Project/Source/Forms/Import/ImportVerseForm.Designer.cs deleted file mode 100644 index 142a3bcfb..000000000 --- a/Project/Source/Forms/Import/ImportVerseForm.Designer.cs +++ /dev/null @@ -1,215 +0,0 @@ -namespace Ordisoftware.HebrewWords -{ - partial class ImportVerseForm - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if ( disposing && ( components != null ) ) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - this.panel1 = new System.Windows.Forms.Panel(); - this.ActionAnalyse = new System.Windows.Forms.Button(); - this.ActionOK = new System.Windows.Forms.Button(); - this.ActionCancel = new System.Windows.Forms.Button(); - this.PanelMain = new System.Windows.Forms.SplitContainer(); - this.EditSource = new System.Windows.Forms.TextBox(); - this.DataGridView = new System.Windows.Forms.DataGridView(); - this.importResultsBindingSource = new System.Windows.Forms.BindingSource(this.components); - this.hebrewDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.originalTranslationDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.newTranslationDataGridViewTextBoxColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.panel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.PanelMain)).BeginInit(); - this.PanelMain.Panel1.SuspendLayout(); - this.PanelMain.Panel2.SuspendLayout(); - this.PanelMain.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.importResultsBindingSource)).BeginInit(); - this.SuspendLayout(); - // - // panel1 - // - this.panel1.Controls.Add(this.ActionAnalyse); - this.panel1.Controls.Add(this.ActionOK); - this.panel1.Controls.Add(this.ActionCancel); - this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.panel1.Location = new System.Drawing.Point(10, 628); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(772, 28); - this.panel1.TabIndex = 37; - // - // ActionAnalyse - // - this.ActionAnalyse.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.ActionAnalyse.Enabled = false; - this.ActionAnalyse.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.ActionAnalyse.Location = new System.Drawing.Point(3, 2); - this.ActionAnalyse.Name = "ActionAnalyse"; - this.ActionAnalyse.Size = new System.Drawing.Size(75, 24); - this.ActionAnalyse.TabIndex = 0; - this.ActionAnalyse.Text = "Analyse"; - this.ActionAnalyse.Click += new System.EventHandler(this.ActionAnalyse_Click); - // - // ActionOK - // - this.ActionOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ActionOK.DialogResult = System.Windows.Forms.DialogResult.OK; - this.ActionOK.Enabled = false; - this.ActionOK.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.ActionOK.Location = new System.Drawing.Point(613, 2); - this.ActionOK.Name = "ActionOK"; - this.ActionOK.Size = new System.Drawing.Size(75, 24); - this.ActionOK.TabIndex = 0; - this.ActionOK.Text = "OK"; - this.ActionOK.Click += new System.EventHandler(this.ActionOK_Click); - // - // ActionCancel - // - this.ActionCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.ActionCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.ActionCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.ActionCancel.Location = new System.Drawing.Point(694, 2); - this.ActionCancel.Name = "ActionCancel"; - this.ActionCancel.Size = new System.Drawing.Size(75, 24); - this.ActionCancel.TabIndex = 0; - this.ActionCancel.Text = "Cancel"; - // - // PanelMain - // - this.PanelMain.Dock = System.Windows.Forms.DockStyle.Fill; - this.PanelMain.Location = new System.Drawing.Point(10, 10); - this.PanelMain.Name = "PanelMain"; - this.PanelMain.Orientation = System.Windows.Forms.Orientation.Horizontal; - // - // PanelMain.Panel1 - // - this.PanelMain.Panel1.Controls.Add(this.EditSource); - this.PanelMain.Panel1.Padding = new System.Windows.Forms.Padding(10); - // - // PanelMain.Panel2 - // - this.PanelMain.Panel2.Controls.Add(this.DataGridView); - this.PanelMain.Panel2.Padding = new System.Windows.Forms.Padding(10); - this.PanelMain.Size = new System.Drawing.Size(772, 618); - this.PanelMain.SplitterDistance = 300; - this.PanelMain.TabIndex = 38; - // - // EditSource - // - this.EditSource.Dock = System.Windows.Forms.DockStyle.Fill; - this.EditSource.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.EditSource.Location = new System.Drawing.Point(10, 10); - this.EditSource.Multiline = true; - this.EditSource.Name = "EditSource"; - this.EditSource.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.EditSource.Size = new System.Drawing.Size(752, 280); - this.EditSource.TabIndex = 0; - this.EditSource.WordWrap = false; - this.EditSource.TextChanged += new System.EventHandler(this.EditSource_TextChanged); - // - // DataGridView - // - this.DataGridView.AutoGenerateColumns = false; - this.DataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.DataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.hebrewDataGridViewTextBoxColumn, - this.originalTranslationDataGridViewTextBoxColumn, - this.newTranslationDataGridViewTextBoxColumn}); - this.DataGridView.DataSource = this.importResultsBindingSource; - this.DataGridView.Dock = System.Windows.Forms.DockStyle.Fill; - this.DataGridView.Location = new System.Drawing.Point(10, 10); - this.DataGridView.Name = "DataGridView"; - this.DataGridView.Size = new System.Drawing.Size(752, 294); - this.DataGridView.TabIndex = 0; - // - // importResultsBindingSource - // - this.importResultsBindingSource.DataSource = typeof(Ordisoftware.HebrewWords.ImportResults); - // - // hebrewDataGridViewTextBoxColumn - // - this.hebrewDataGridViewTextBoxColumn.DataPropertyName = "Hebrew"; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleRight; - dataGridViewCellStyle1.Font = new System.Drawing.Font("Hebrew", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.hebrewDataGridViewTextBoxColumn.DefaultCellStyle = dataGridViewCellStyle1; - this.hebrewDataGridViewTextBoxColumn.HeaderText = "Hebrew"; - this.hebrewDataGridViewTextBoxColumn.Name = "hebrewDataGridViewTextBoxColumn"; - this.hebrewDataGridViewTextBoxColumn.Width = 150; - // - // originalTranslationDataGridViewTextBoxColumn - // - this.originalTranslationDataGridViewTextBoxColumn.DataPropertyName = "OriginalTranslation"; - this.originalTranslationDataGridViewTextBoxColumn.HeaderText = "OriginalTranslation"; - this.originalTranslationDataGridViewTextBoxColumn.Name = "originalTranslationDataGridViewTextBoxColumn"; - this.originalTranslationDataGridViewTextBoxColumn.Width = 250; - // - // newTranslationDataGridViewTextBoxColumn - // - this.newTranslationDataGridViewTextBoxColumn.DataPropertyName = "NewTranslation"; - this.newTranslationDataGridViewTextBoxColumn.HeaderText = "NewTranslation"; - this.newTranslationDataGridViewTextBoxColumn.Name = "newTranslationDataGridViewTextBoxColumn"; - this.newTranslationDataGridViewTextBoxColumn.Width = 250; - // - // ImportVerseForm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.ActionCancel; - this.ClientSize = new System.Drawing.Size(792, 666); - this.Controls.Add(this.PanelMain); - this.Controls.Add(this.panel1); - this.MinimumSize = new System.Drawing.Size(800, 600); - this.Name = "ImportVerseForm"; - this.Padding = new System.Windows.Forms.Padding(10); - this.Text = "Import console"; - this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.ImportVerseForm_FormClosed); - this.panel1.ResumeLayout(false); - this.PanelMain.Panel1.ResumeLayout(false); - this.PanelMain.Panel1.PerformLayout(); - this.PanelMain.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.PanelMain)).EndInit(); - this.PanelMain.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.DataGridView)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.importResultsBindingSource)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.SplitContainer PanelMain; - private System.Windows.Forms.Button ActionOK; - private System.Windows.Forms.Button ActionCancel; - private System.Windows.Forms.TextBox EditSource; - private System.Windows.Forms.Button ActionAnalyse; - private System.Windows.Forms.DataGridView DataGridView; - private System.Windows.Forms.DataGridViewTextBoxColumn hebrewDataGridViewTextBoxColumn; - private System.Windows.Forms.DataGridViewTextBoxColumn originalTranslationDataGridViewTextBoxColumn; - private System.Windows.Forms.DataGridViewTextBoxColumn newTranslationDataGridViewTextBoxColumn; - private System.Windows.Forms.BindingSource importResultsBindingSource; - } -} \ No newline at end of file diff --git a/Project/Source/Forms/Import/ImportVerseForm.Ghost.cs b/Project/Source/Forms/Import/ImportVerseForm.Ghost.cs deleted file mode 100644 index 70677decc..000000000 --- a/Project/Source/Forms/Import/ImportVerseForm.Ghost.cs +++ /dev/null @@ -1,82 +0,0 @@ -/// -/// This file is part of Ordisoftware Hebrew Words. -/// Copyright 2012-2019 Olivier Rogier. -/// See www.ordisoftware.com for more information. -/// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. -/// If a copy of the MPL was not distributed with this file, You can obtain one at -/// https://mozilla.org/MPL/2.0/. -/// If it is not possible or desirable to put the notice in a particular file, -/// then You may include the notice in a location(such as a LICENSE file in a -/// relevant directory) where a recipient would be likely to look for such a notice. -/// You may add additional accurate notices of copyright ownership. -/// -/// 2019-09 -/// 2019-09 -using System; -using System.Data; -using System.Linq; -using System.Windows.Forms; - -namespace Ordisoftware.HebrewWords -{ - - public partial class ImportVerseForm : Form - { - - private Data.DataSet.BooksRow GhostBook; - private Data.DataSet.ChaptersRow GhostChapter; - private Data.DataSet.VersesRow GhostVerse; - private Data.DataSet.WordsRow[] GhostWords; - - private void CreateGhost() - { - GhostBook = DataSet.Books.NewBooksRow(); - GhostBook.ID = Guid.NewGuid().ToString(); - GhostBook.Number = 0; - GhostBook.Original = ""; - GhostBook.Hebrew = ""; - GhostBook.Name = ""; - GhostBook.Translation = ""; - GhostBook.Memo = ""; - DataSet.Books.AddBooksRow(GhostBook); - GhostChapter = DataSet.Chapters.NewChaptersRow(); - GhostChapter.ID = Guid.NewGuid().ToString(); - GhostChapter.BookID = GhostBook.ID; - GhostChapter.Number = 0; - GhostChapter.ELS50 = ""; - GhostChapter.Memo = ""; - DataSet.Chapters.AddChaptersRow(GhostChapter); - GhostVerse = DataSet.Verses.NewVersesRow(); - GhostVerse.ID = Guid.NewGuid().ToString(); - GhostVerse.ChapterID = GhostChapter.ID; - GhostVerse.Number = 0; - GhostVerse.Comment = ""; - DataSet.Verses.AddVersesRow(GhostVerse); - var words = Reference.Verse.GetWordsRows(); - for ( int i = 0; i < words.Count(); i++ ) - { - var word = DataSet.Words.NewWordsRow(); - word.ID = Guid.NewGuid().ToString(); - word.VerseID = GhostVerse.ID; - word.Number = words[i].Number; - word.Original = words[i].Original; - word.Hebrew = words[i].Hebrew; - word.Translation = words[i].Translation; - DataSet.Words.AddWordsRow(word); - } - GhostWords = GhostVerse.GetWordsRows(); - ActionOK.Enabled = false; - } - - private void DeleteGhost() - { - foreach ( var word in GhostWords.ToList() ) - DataSet.Words.RemoveWordsRow(word); - DataSet.Verses.RemoveVersesRow(GhostVerse); - DataSet.Chapters.RemoveChaptersRow(GhostChapter); - DataSet.Books.RemoveBooksRow(GhostBook); - } - - } - -} diff --git a/Project/Source/Forms/Import/ImportVerseForm.cs b/Project/Source/Forms/Import/ImportVerseForm.cs deleted file mode 100644 index 7cc16685c..000000000 --- a/Project/Source/Forms/Import/ImportVerseForm.cs +++ /dev/null @@ -1,98 +0,0 @@ -/// -/// This file is part of Ordisoftware Hebrew Words. -/// Copyright 2012-2019 Olivier Rogier. -/// See www.ordisoftware.com for more information. -/// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. -/// If a copy of the MPL was not distributed with this file, You can obtain one at -/// https://mozilla.org/MPL/2.0/. -/// If it is not possible or desirable to put the notice in a particular file, -/// then You may include the notice in a location(such as a LICENSE file in a -/// relevant directory) where a recipient would be likely to look for such a notice. -/// You may add additional accurate notices of copyright ownership. -/// -/// 2019-09 -/// 2019-09 -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -namespace Ordisoftware.HebrewWords -{ - - public partial class ImportVerseForm : Form - { - - static public void Run(ReferenceItem reference) - { - var form = new ImportVerseForm(reference); - var result = form.ShowDialog(); - if ( result == DialogResult.Cancel ) - form.DataSet.RejectChanges(); - else - { - if ( form.DataSet.HasChanges() ) - { - MainForm.Instance.TableAdapterManager.UpdateAll(form.DataSet); - foreach ( WordControl c in MainForm.Instance.PanelViewVerses.Controls.OfType() ) - c.EditTranslation.Text = c.Word.Translation; - } - MainForm.Instance.ActionSave.PerformClick(); - } - } - - private bool IsResultValid; - - private Data.DataSet DataSet; - - private ReferenceItem Reference; - - private ImportVerseForm() - { - InitializeComponent(); - Icon = MainForm.Instance.Icon; - } - - private ImportVerseForm(ReferenceItem reference) - : this() - { - DataSet = MainForm.Instance.DataSet; - Reference = reference; - CreateGhost(); - } - - private void ImportVerseForm_FormClosed(object sender, FormClosedEventArgs e) - { - DeleteGhost(); - } - - private void EditSource_TextChanged(object sender, EventArgs e) - { - ActionAnalyse.Enabled = EditSource.Text != ""; - IsResultValid = false; - ActionOK.Enabled = false; - } - - private void ActionAnalyse_Click(object sender, EventArgs e) - { - DoAnalyse(); - ActionOK.Enabled = IsResultValid; - } - - private void ActionOK_Click(object sender, EventArgs e) - { - var wordsReference = Reference.Verse.GetWordsRows(); - for ( int index = 0; index < ImportResults.Count; index++ ) - if ( ImportResults[index].Hebrew == wordsReference[index].Hebrew ) - wordsReference[index].Translation = ImportResults[index].NewTranslation; - Close(); - } - - } - -} diff --git a/Project/Source/Forms/Import/ImportVerseForm.resx b/Project/Source/Forms/Import/ImportVerseForm.resx deleted file mode 100644 index 9a5a9d4f9..000000000 --- a/Project/Source/Forms/Import/ImportVerseForm.resx +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - \ No newline at end of file diff --git a/Project/Source/Forms/MainForm/MainForm.DB.LoadFromFiles.cs b/Project/Source/Forms/MainForm/MainForm.DB.LoadFromFiles.cs index bc6b48541..a1402e7fe 100644 --- a/Project/Source/Forms/MainForm/MainForm.DB.LoadFromFiles.cs +++ b/Project/Source/Forms/MainForm/MainForm.DB.LoadFromFiles.cs @@ -58,11 +58,9 @@ void nextChapter() book = DataSet.Books.NewBooksRow(); book.ID = Guid.NewGuid().ToString(); book.Number = (int)bookid + 1; - book.Original = BooksNames.Original[bookid]; book.Hebrew = BooksNames.Hebrew[bookid]; book.Name = bookid.ToString().Replace("_", " "); book.Translation = ""; - book.Memo = ""; DataSet.Books.AddBooksRow(book); int countChapters = 0; int countVerses = 0; @@ -75,10 +73,9 @@ void nextChapter() if ( chapter != null ) nextChapter(); countVerses = 0; chapter = DataSet.Chapters.NewChaptersRow(); - chapter.ID = Guid.NewGuid().ToString(); - chapter.BookID = book.ID; chapter.Number = ++countChapters; - chapter.Memo = ""; + chapter.ID = Guid.NewGuid().ToString(); ; + chapter.BookID = book.ID; } else { @@ -90,9 +87,9 @@ void nextChapter() { countWords = 0; verse = DataSet.Verses.NewVersesRow(); + verse.Number = ++countVerses; verse.ID = Guid.NewGuid().ToString(); verse.ChapterID = chapter.ID; - verse.Number = ++countVerses; verse.Comment = ""; listWordsOriginal = list[0].Replace("-", " ").Split(' ').Reverse().ToArray(); listWordsHebrew = Letters.ConvertToHebrewFont(list[0]).Split(' ').Reverse().ToArray(); @@ -107,9 +104,9 @@ void nextChapter() if ( listWordsHebrew[i] != "" ) { word = DataSet.Words.NewWordsRow(); + word.Number = ++countWords; word.ID = Guid.NewGuid().ToString(); word.VerseID = verse.ID; - word.Number = ++countWords; word.Original = new string(listWordsOriginal[i].Reverse().ToArray()); word.Hebrew = listWordsHebrew[i]; word.Translation = ""; diff --git a/Project/Source/Forms/MainForm/MainForm.cs b/Project/Source/Forms/MainForm/MainForm.cs index ebad3fdb4..1ede31b52 100644 --- a/Project/Source/Forms/MainForm/MainForm.cs +++ b/Project/Source/Forms/MainForm/MainForm.cs @@ -871,54 +871,26 @@ private void ActionAddToBookmarks_Click(object sender, EventArgs e) { var menuitem = (ToolStripMenuItem)sender; var control = ( (ContextMenuStrip)menuitem.Owner ).SourceControl; - ReferenceItem reference = null; + ReferenceItem item = null; if ( control is LinkLabel && Program.Settings.CurrentView == ViewModeType.Search ) { - reference = (ReferenceItem)control.Tag; - reference = new ReferenceItem(reference.Book.Number, - reference.Chapter.Number, - reference.Verse.Number); + var reference = (ReferenceItem)control.Tag; + item = new ReferenceItem(reference.Book.Number, + reference.Chapter.Number, + reference.Verse.Number); } else if ( control is Label && Program.Settings.CurrentView == ViewModeType.Verses ) { int index = Convert.ToInt32(control.Text) - 1; - reference = new ReferenceItem(CurrentReference.Book.Number, - CurrentReference.Chapter.Number, - CurrentReference.Chapter.GetVersesRows()[index].Number); + item = new ReferenceItem(CurrentReference.Book.Number, + CurrentReference.Chapter.Number, + CurrentReference.Chapter.GetVersesRows()[index].Number); } - Bookmarks.Add(reference); + Bookmarks.Add(item); UpdateBookmarks(); } - /// - /// Event handler. Called by ActionImportConsole for click events. - /// - /// Source of the event. - /// Event information. - private void ActionImportConsole_Click(object sender, EventArgs e) - { - var menuitem = (ToolStripMenuItem)sender; - var control = ( (ContextMenuStrip)menuitem.Owner ).SourceControl; - ReferenceItem reference = null; - if ( control is LinkLabel && Program.Settings.CurrentView == ViewModeType.Search ) - { - reference = (ReferenceItem)control.Tag; - reference = new ReferenceItem(reference.Book.Number, - reference.Chapter.Number, - reference.Verse.Number); - } - else - if ( control is Label && Program.Settings.CurrentView == ViewModeType.Verses ) - { - int index = Convert.ToInt32(control.Text) - 1; - reference = new ReferenceItem(CurrentReference.Book.Number, - CurrentReference.Chapter.Number, - CurrentReference.Chapter.GetVersesRows()[index].Number); - } - ImportVerseForm.Run(reference); - } - /// /// Event handler. Called by ActionClearBookmarks for click events. /// @@ -935,6 +907,16 @@ private void ActionClearBookmarks_Click(object sender, EventArgs e) UpdateBookmarks(); } + /// + /// Event handler. Called by ActionImportConsole for click events. + /// + /// Source of the event. + /// Event information. + private void ActionImportConsole_Click(object sender, EventArgs e) + { + DisplayManager.ShowAdvert(Translations.NotYetAvailableText.GetLang()); + } + /// /// Search a hebrew word. /// diff --git a/Project/Source/Forms/MainForm/MainForm.resx b/Project/Source/Forms/MainForm/MainForm.resx index 1db45ae4d..99afb077b 100644 --- a/Project/Source/Forms/MainForm/MainForm.resx +++ b/Project/Source/Forms/MainForm/MainForm.resx @@ -3947,8 +3947,11 @@ A verse is founded if the translation of one of its words contains an expression Import console + + False + - 201, 176 + 201, 154 ContextMenuStripVerse diff --git a/README.md b/README.md index cb2452f34..d0bc8958f 100644 --- a/README.md +++ b/README.md @@ -57,10 +57,6 @@ Watch the [video](https://www.youtube.com/watch?v=WPVF8pj9I3E). ## Changelog -#### __________ - Version 2.1 - -- Add import verse console. - #### 2019.09.19 - Version 2.0 - Add context menu on hebrew words, on verses numbers and on search reference found. diff --git a/Setup/OrdisoftwareHebrewWordsSetup.iss b/Setup/OrdisoftwareHebrewWordsSetup.iss index 02acf27cf..36ec6f979 100644 --- a/Setup/OrdisoftwareHebrewWordsSetup.iss +++ b/Setup/OrdisoftwareHebrewWordsSetup.iss @@ -3,7 +3,7 @@ #define MyAppName "Hebrew Words" #define MyAppNameNoSpace "HebrewWords" -#define MyAppVersion "2.1" +#define MyAppVersion "2.0" #define MyAppPublisher "Ordisoftware" #define MyAppURL "http://www.ordisoftware.com/projects/hebrew-words" #define MyAppExeName "Ordisoftware.HebrewWords.exe"