Beispiel #1
0
        /// <summary>Click event handler of the Close button.</summary>
        /// <param name="sender">Sender Object.</param>
        /// <param name="e">Event parameters.</param>
        private void btnClose_Click(object sender, RoutedEventArgs e)
        {
            if (_wndWing != null)
            {
                _wndWing.Close();
                _wndWing = null;
            }

            Close();
        }
Beispiel #2
0
        /// <summary>Closing event handler.</summary>
        /// <param name="sender">Sender Object.</param>
        /// <param name="e">Event parameters.</param>
        private void wndMain_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (_wndWing != null)
            {
                _wndWing.Close();
                _wndWing = null;
            }

            _naviConfig.NaviWidth  = Width;
            _naviConfig.NaviHeight = Height;
            _naviConfig.Save();
        }
Beispiel #3
0
        /// <summary>Click event handler of each information item.</summary>
        /// <param name="sender">Sender Object.</param>
        /// <param name="e">Event parameters.</param>
        public void infoItem_Click(object sender, MouseButtonEventArgs e)
        {
            if (_selPanel != null)
            {
                _selPanel.SetSelected(false);
            }

            _selPanel = (IInfoItemPanel)sender;
            _selPanel.SetSelected(true);

            if (_wndWing == null)
            {
                _wndWing        = new WndWing();
                _wndWing.Owner  = this;
                _wndWing.Width  = _naviConfig.WingWidth;
                _wndWing.Height = _naviConfig.WingHeight;

                System.Drawing.Rectangle rec = Screen.GetWorkingArea(new System.Drawing.Point(0, 0));
                double workAreaWidth         = SystemParameters.WorkArea.Width;
                double workAreaHeight        = SystemParameters.WorkArea.Height;
                double marginLeft            = this.Left;
                double marginRight           = workAreaWidth - (this.Left + this.Width);
                if (marginLeft > marginRight)
                {
                    _wndWing.Left = this.Left - _wndWing.Width;
                }
                else
                {
                    _wndWing.Left = this.Left + this.Width;
                }
                _wndWing.Top = this.Top + 30.0;
                if (workAreaHeight - _wndWing.Top < _wndWing.Height)
                {
                    _wndWing.Top = workAreaHeight - _wndWing.Height;
                }
                _wndWing.Show();
            }

            if (_wndWing.InfoItemPanel != null &&
                _wndWing.InfoItemPanel.GetInfoItem() == _selPanel.GetInfoItem())
            {
                _wndWing.Close();
                _wndWing = null;
            }
            else
            {
                _wndWing.chkUnread.IsChecked = false;

                _wndWing.ShowInfoItem(_selPanel);
                markRead(_selPanel, true);
            }
        }
Beispiel #4
0
        /// <summary>Reloads list of information items.</summary>
        private void _Reload()
        {
            if (_wndWing != null)
            {
                _wndWing.Close();
                _wndWing = null;
            }

            ClearFeed();
            _AddFeedItems(_infoManager.Load());
            _LoadThumbs();

            this.Focus();
        }
Beispiel #5
0
        public void SetMenuMode(MENU_MODE mode)
        {
            switch (mode)
            {
            case MENU_MODE.MENU_MODE_FEED:
                UpdateMenuPanel(btnMenuFeed);
                viewFeed.Visibility    = Visibility.Visible;
                viewZeptair.Visibility = Visibility.Hidden;
                btnReload.Visibility   = Visibility.Visible;
                btnCheckAll.Visibility = Visibility.Visible;
#if ZEPTAIR
                if (_wndZeptDistFolders != null)
                {
                    _wndZeptDistFolders.Close();
                    _wndZeptDistFolders = null;
                }
#endif
                break;

            case MENU_MODE.MENU_MODE_ZEPTAIR:
                UpdateMenuPanel(btnMenuZeptair);
                viewFeed.Visibility    = Visibility.Hidden;
                viewZeptair.Visibility = Visibility.Visible;
                btnReload.Visibility   = Visibility.Hidden;
                btnCheckAll.Visibility = Visibility.Hidden;
                if (_wndWing != null)
                {
                    _wndWing.Close();
                    _wndWing = null;
                }

#if ZEPTAIR
                if (stpZeptair.Children.Count <= 0)
                {
                    System.Resources.ResourceManager rm = new System.Resources.ResourceManager(
                        "ThetisCoreNavi",
                        System.Reflection.Assembly.GetExecutingAssembly());
                    MenuItemPanel[] panels = new MenuItemPanel[] {
//                              new MenuItemPanel(Properties.Resources.MENUITEM_ZEPT_HISTORY, new MouseButtonEventHandler(menuItemZeptDistFolders_Click)),
                        new MenuItemPanel(Properties.Resources.MENUITEM_ZEPT_DIST_FOLDERS, new MouseButtonEventHandler(menuItemZeptDistFolders_Click))
                    };
                    foreach (MenuItemPanel panel in panels)
                    {
                        panel.Width = stpZeptair.Width;
                        stpZeptair.Children.Add(panel);
                    }
                }
#endif

/*
 *                  BrowserConfig browserConfig = BrowserConfig.Load();
 *                  if (browserConfig.Url == null
 || browserConfig.Url.Length <= 0)
 ||                 {
 ||                     System.Windows.Forms.MessageBox.Show(
 ||                                         Properties.Resources.ERR_ZEPTMENU_URL_NOT_SET,
 ||                                         @"ERROR",
 ||                                         MessageBoxButtons.OK,
 ||                                         MessageBoxIcon.Error
 ||                                     );
 ||                     break;
 ||                 }
 ||                 RssTargetEntry targetEntry = new RssTargetEntry();
 ||                 targetEntry.Url = browserConfig.Url.Split('?')[0].Replace(@"/rss/rss", @"/rss/zeptmenu");
 ||                 if (browserConfig.UserName != null
 ||                     && browserConfig.UserName.Length > 0)
 ||                 {
 ||                     targetEntry.SetAuth(browserConfig.UserName, browserConfig.Password);
 ||                 }
 ||                 ZeptMenuAgent.GetMenu(targetEntry);
 */
                break;

            default:
                break;
            }
        }
Beispiel #6
0
 /// <summary>Clears the reference to the Wing Window.</summary>
 public void ClearWndWind()
 {
     _wndWing = null;
 }