public void LoadDatabase(DataBase.Tables.ItemSet row) { this.TitleYomi.Value = row.TitleYomi; this.Authors.Value = row.Authors?.Select(x => x.Name).ToArray(); this.Note.Value = row.Note; this.Min.Value = row.Min; this.Max.Value = row.Max; this.OrdinalRegex.Value = row.OrdinalRegex; this.Completed.Value = row.Completed; this.NextReleaseDate.Value = row.NextReleaseDate; this._itemSetId = row.ItemSetId; }
/// <summary> /// データベースレコードの作成 /// </summary> public void Create() { var row = new DataBase.Tables.ItemSet { DirectoryPath = this.DirectoryPath, OrdinalRegex = this.OrdinalRegex.Value }; lock (this._database) { this._database.ItemSets.Add(row); this._database.SaveChanges(); } this.TitleYomi.Value = JapanesePhoneticAnalyzer.GetWords(this.Title.Value).Select(x => x.YomiText).Aggregate((x, y) => x + y); this._itemSetId = row.ItemSetId; }