Interaction logic for NewFeed.xaml
        private void feedaddbtn_Click(object sender, RoutedEventArgs e)
        {
            var nf = new NewFeed();
            var dr = nf.ShowDialog();

            if (dr != true || nf.FeedConfig.Url.Trim().Length <= 0)
            {
                return;
            }
            FeedConfigItems.Add(nf.FeedConfig);
            SaveFeedSettings();
            ReloadFeedConfigItems();
        }
        private void feedtemplatebtn_Click(object sender, RoutedEventArgs e)
        {
            if (feedlistbox.SelectedItems.Count != 1)
            {
                return;
            }
            var fci = ((FeedConfigItem)feedlistbox.SelectedItem).Copy();

            fci.Url = "";
            var nf = new NewFeed(fci);
            var dr = nf.ShowDialog();

            if (dr != true || nf.FeedConfig.Url.Trim().Length <= 0)
            {
                return;
            }
            FeedConfigItems.Add(nf.FeedConfig);
            SaveFeedSettings();
            ReloadFeedConfigItems();
        }
        private void feededitbtn_Click(object sender, RoutedEventArgs e)
        {
            if (feedlistbox.SelectedItems.Count != 1)
            {
                return;
            }
            var oldguid = ((FeedConfigItem)feedlistbox.SelectedItem).Guid;
            var fci     = ((FeedConfigItem)feedlistbox.SelectedItem).Copy();
            var nf      = new NewFeed(fci);
            var dr      = nf.ShowDialog();

            if (dr != true || nf.FeedConfig.Url.Trim().Length <= 0)
            {
                return;
            }
            FeedConfigItems.Remove(((FeedConfigItem)feedlistbox.SelectedItem));
            FeedConfigItems.Add(nf.FeedConfig);
            SaveFeedSettings();

            if (windowlist.ContainsKey(oldguid) && windowlist[oldguid] != null)
            {
                ((FeedWin)windowlist[oldguid]).Close();
            }
            windowlist.Remove(nf.FeedConfig.Guid);

            var nfw = new FeedWin(nf.FeedConfig);

            windowlist.Add(nf.FeedConfig.Guid, nfw);
            nfw.Show();

            feedlistbox.Items.Clear();
            foreach (var fcil in FeedConfigItems.Items)
            {
                feedlistbox.Items.Add(fcil);
            }
        }
示例#4
0
        private void feedtemplatebtn_Click(object sender, RoutedEventArgs e)
        {
            if (feedlistbox.SelectedItems.Count != 1) return;
            var fci = ((FeedConfigItem)feedlistbox.SelectedItem).Copy();
            fci.Url = "";
            var nf = new NewFeed(fci);
            var dr = nf.ShowDialog();

            if (dr != true || nf.FeedConfig.Url.Trim().Length <= 0) return;
            FeedConfigItems.Add(nf.FeedConfig);
            SaveFeedSettings();
            ReloadFeedConfigItems();
        }
示例#5
0
        private void feededitbtn_Click(object sender, RoutedEventArgs e)
        {
            if (feedlistbox.SelectedItems.Count != 1) return;
            var oldguid = ((FeedConfigItem)feedlistbox.SelectedItem).Guid;
            var fci = ((FeedConfigItem)feedlistbox.SelectedItem).Copy();
            var nf = new NewFeed(fci);
            var dr = nf.ShowDialog();
            if (dr != true || nf.FeedConfig.Url.Trim().Length <= 0) return;
            FeedConfigItems.Remove(((FeedConfigItem)feedlistbox.SelectedItem));
            FeedConfigItems.Add(nf.FeedConfig);
            SaveFeedSettings();

            if (windowlist.ContainsKey(oldguid) && windowlist[oldguid] != null) ((FeedWin)windowlist[oldguid]).Close();
            windowlist.Remove(nf.FeedConfig.Guid);

            var nfw = new FeedWin(nf.FeedConfig);
            windowlist.Add(nf.FeedConfig.Guid, nfw);
            nfw.Show();

            feedlistbox.Items.Clear();
            foreach (var fcil in FeedConfigItems.Items)
            {
                feedlistbox.Items.Add(fcil);
            }
        }
示例#6
0
 private void feedaddbtn_Click(object sender, RoutedEventArgs e)
 {
     var nf = new NewFeed();
     var dr = nf.ShowDialog();
     if (dr != true || nf.FeedConfig.Url.Trim().Length <= 0) return;
     FeedConfigItems.Add(nf.FeedConfig);
     SaveFeedSettings();
     ReloadFeedConfigItems();
 }