Exemplo n.º 1
0
        private bool SubscribeToFeed(object sender, RoutedEventArgs e)
        {
            InstructionsLock          = true;
            this.InstructionsBox.Text = SubscribeToFeedInfo;

            SubscriptionWindow s = new SubscriptionWindow(program);

            s.Title           = "Add a subscription";
            s.inputAlias.Text = "New Subsription Name Here";
            s.inputURL.Text   = "RSS URL Here. Need a suggestion? http://rss.nytimes.com/services/xml/rss/nyt/World.xml";

            s.ShowDialog();

            InstructionsLock = false;
            return(true);
        }
Exemplo n.º 2
0
        private bool ViewFavorites(object sender, RoutedEventArgs e)
        {
            InstructionsLock          = true;
            this.InstructionsBox.Text = ViewFavoritesInfo;

            SubscriptionWindow s = new SubscriptionWindow(program);
            MainWindow         m = (main_window as MainWindow);

            m.tabControl.SelectedIndex = 0;

            object a = m.RSSTreeView.Items[0];

            DependencyObject dObject      = m.RSSTreeView.ItemContainerGenerator.ContainerFromItem(a);
            MethodInfo       selectMethod = typeof(TreeViewItem).GetMethod("Select", BindingFlags.NonPublic | BindingFlags.Instance);

            selectMethod.Invoke(dObject, new object[] { true });

            InstructionsLock = false;
            return(true);
        }
Exemplo n.º 3
0
        private void Modify_Click(object sender, RoutedEventArgs e)
        {
            Window modWindow = null;

            object item = treeView.SelectedItem;

            if (item is RSSFeed)
            {
                modWindow = new SubscriptionWindow(mainProgram, item as RSSFeed);
            }
            else if (item is Channel)
            {
                modWindow = new ChannelWindow(mainProgram, item as Channel);
            }

            if (modWindow != null)
            {
                modWindow.ShowDialog();
            }
        }