コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: xhumiq/BibleLive
        private void OnCNameSelected(object sender, SelectionChangedEventArgs e)
        {
            if (this.refreshing)
            {
                return;
            }
            if (e.AddedItems.Count <= 0)
            {
                return;
            }
            var bk = ((FrameworkElement)e.AddedItems[0]).Tag as BibleBook;

            if (bk == null)
            {
                return;
            }
            BibleName bkn = null;

            if (BibleStore.BibleStore.EngBookNames.TryGetValue(bk.Id.ToLower(), out bkn))
            {
                this.refreshing  = true;
                this.CEntry.Text = bkn.Full;
                try {
                    FindEn(bkn.Full);
                } catch (Exception E) {
                    TraceLogger.Send(E, "On Text Input");
                }
                this.refreshing = false;
            }
            //this.CEntry.Focus();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: xhumiq/BibleLive
 public static void Load_Names(CommandLine cmd)
 {
     cmd.AddAliases("names", "en");
     cmd.Run(a => {
         foreach (var n in BibleStore.BibleStore.ChiBookNames)
         {
             var ma = BibleStore.BibleStore.RE_CHVERSE.Match(n.Value);
             if (ma != null)
             {
                 var nm = new BibleName()
                 {
                     Id     = n.Key,
                     Volume = ma.Groups[1].Value.Trim().ToIntOrZero(),
                     Suffix = ma.Groups[2].Value.TrimNullIfEmpty(),
                     Full   = n.Value,
                 };
             }
         }
         return(0);
     });
 }