Example #1
0
 public object Any(GetEntryType request)
 {
     return(new GetEntryTypeResponse
     {
         KeyType = Redis.GetEntryType(request.Key).ToString()
     });
 }
        private void Add_Button_Click(object sender, RoutedEventArgs e)
        {
            MainWindow   main          = Application.Current.Windows.OfType <MainWindow>().First();
            incollection _incollection = new incollection()
            {
                bibtexkey = bibtexkey_Txt.Text,
                title     = title_Txt.Text,
                year      = year_Txt.Text != "" ? Convert.ToInt32(year_Txt.Text) : null as int?,
                month     = month_Txt.Text != "" ? Convert.ToInt32(month_Txt.Text) : null as int?,
                volume    = volume_Txt.Text != "" ? Convert.ToInt32(volume_Txt.Text) : null as int?,
                address   = address_Txt.Text,
                booktitle = booktitle_Txt.Text,
                chapter   = chapter_Txt.Text != "" ? Convert.ToInt32(chapter_Txt.Text) : null as int?,
                edition   = edition_Txt.Text != "" ? Convert.ToInt32(edition_Txt.Text) : null as int?,
                editor    = editor_Txt.Text,
                publisher = publisher_Txt.Text,
                series    = series_Txt.Text != "" ? Convert.ToInt32(series_Txt.Text):null as int?,
                type      = type_Txt.Text,
                author    = author_Txt.Text,
                pages     = pages_Txt.Text,
                note      = note_Txt.Text,
                entrytype = GetEntryType.GetValueByEnum(GetEntryType.EntryType.InCollection)
            };


            bool result = AllFieldEmpty();

            if (!result)
            {
                _iInCollectionService.Add(_incollection);
                SetFieldClear();
                UIElement parent = App.Current.MainWindow;
                parent.IsEnabled = true;
                main.DataGridMain.ItemsSource = GetEntryType.GetAllByTypes();
                this.Close();
            }
            else
            {
                if (MessageBox.Show("Are you Sure to create a empty .bib", "Question", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No)
                {
                    //do no stuff
                    return;
                }
                else
                {
                    _iInCollectionService.Add(_incollection);
                    SetFieldClear();
                    main.DataGridMain.ItemsSource = GetEntryType.GetAllByTypes();
                    UIElement parent = App.Current.MainWindow;
                    parent.IsEnabled = true;
                    this.Close();
                    //do yes stuff
                }
            }
        }
Example #3
0
        private void Add_Button_Click(object sender, RoutedEventArgs e)
        {
            MainWindow main     = Application.Current.Windows.OfType <MainWindow>().First();
            article    _article = new article()
            {
                bibtexkey = bibtexKey_Txt.Text,
                title     = title_Txt.Text,
                year      = year_Txt.Text != "" ? Convert.ToInt32(year_Txt.Text) : null as int?,
                number    = number_Txt.Text != "" ? Convert.ToInt32(number_Txt.Text) : null as int?,
                month     = month_Txt.Text != "" ? Convert.ToInt32(month_Txt.Text) : null as int?,
                volume    = volume_Txt.Text != "" ? Convert.ToInt32(volume_Txt.Text) : null as int?,
                author    = author_Txt.Text,
                journal   = journal_Txt.Text,
                pages     = pages_Txt.Text,
                note      = note_Txt.Text,
                doi       = doi_Txt.Text,
                entrytype = GetEntryType.GetValueByEnum(GetEntryType.EntryType.Article)
            };


            bool result = AllFieldEmpty();

            if (!result)
            {
                _iArticleService.Add(_article);
                SetFieldClear();
                UIElement parent = App.Current.MainWindow;
                parent.IsEnabled = true;
                main.DataGridMain.ItemsSource = GetEntryType.GetAllByTypes();
                this.Close();
            }
            else
            {
                if (MessageBox.Show("Are you Sure to create a empty .bib", "Question", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No)
                {
                    //do no stuff
                    return;
                }
                else
                {
                    _iArticleService.Add(_article);
                    SetFieldClear();
                    main.DataGridMain.ItemsSource = GetEntryType.GetAllByTypes();
                    UIElement parent = App.Current.MainWindow;
                    parent.IsEnabled = true;
                    this.Close();
                    //do yes stuff
                }
            }

            //var r=Application.Current.Windows.OfType<W_MessageBox>();
        }
Example #4
0
        private void Add_Button_Click(object sender, RoutedEventArgs e)
        {
            MainWindow main     = Application.Current.Windows.OfType <MainWindow>().First();
            booklet    _booklet = new booklet()
            {
                bibtexkey    = bibtexKey_Txt.Text,
                title        = title_Txt.Text,
                address      = address_Txt.Text,
                author       = author_Txt.Text,
                entrytype    = GetEntryType.GetValueByEnum(GetEntryType.EntryType.Booklet),
                howpublished = howpublished_Txt.Text,
                year         = year_Txt.Text != "" ? Convert.ToInt32(year_Txt.Text) : null as int?,
                month        = month_Txt.Text != "" ? Convert.ToInt32(month_Txt.Text) : null as int?,
                note         = note_Txt.Text
            };
            bool result = AllFieldEmpty();

            if (!result)
            {
                _iBookletService.Add(_booklet);
                SetFieldClear();
                UIElement parent = App.Current.MainWindow;
                parent.IsEnabled = true;
                main.DataGridMain.ItemsSource = GetEntryType.GetAllByTypes();
                this.Close();
            }
            else
            {
                if (MessageBox.Show("Are you Sure to create a empty .bib", "Question", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.No)
                {
                    //do no stuff
                    return;
                }
                else
                {
                    _iBookletService.Add(_booklet);
                    SetFieldClear();
                    main.DataGridMain.ItemsSource = GetEntryType.GetAllByTypes();
                    UIElement parent = App.Current.MainWindow;
                    parent.IsEnabled = true;
                    this.Close();
                    //do yes stuff
                }
            }
        }
Example #5
0
        // Convert to SidEntry. If failed, returns null.
        private static ParseResult GetEntry(SectionSplitter.SplitEntry entry)
        {
            var lines     = entry.Lines;
            var firstLine = lines[0].Split(',');

            if (firstLine.Length < 3)
            {
                return(null);
            }
            var rwyOrTransition = firstLine[2];
            var wpts            = lines.Skip(1).Select(line => GetWpt(line)).Where(w => w != null);

            return(new ParseResult()
            {
                Name = firstLine[1],
                RunwayOrTransition = rwyOrTransition,
                Type = GetEntryType.GetType(rwyOrTransition),
                Waypoints = wpts.ToList(),
                EndWithVector = !FixTypes.HasCorrds(lines.Last().Split(',')[0])
            });
        }