Exemple #1
0
 public QuickLinksReName(QuickLinksModel quickLinksModel)
     : this()
 {
     QuickLink             = quickLinksModel;
     OriginalQuickLinkName = quickLinksModel.QuickLinkName;
     this.DataContext      = QuickLink;
 }
Exemple #2
0
        private void bt_QuickLink_Click(object sender, RoutedEventArgs e)
        {
            HyperlinkButton linkBT    = sender as HyperlinkButton;
            QuickLinksModel linkModel = linkBT.DataContext as QuickLinksModel;

            string menuURL = linkModel.BaseUrl.Trim();

            //
            if (menuURL.IndexOf("#") >= 0)
            {
                menuURL = menuURL.Substring(menuURL.IndexOf("#") + 1);
            }

            if (linkModel.UserState != null)
            {
                CPApplication.Current.Browser.Navigate(menuURL, linkModel.UserState);
            }
            else
            {
                CPApplication.Current.Browser.Navigate(menuURL);
            }

            ComponentFactory.GetComponent <IEventTracker>().TraceEvent(CPApplication.Current.DefaultPage, "Click", "QuickLink");

            if (RichContentPopup.IsOpen == true)
            {
                RichContentPopup.IsOpen = false;
            }
        }
Exemple #3
0
        void riverContextMenu_OnRightMenuRenameClick(object sender)
        {
            QuickLinksModel LinkModel = sender as QuickLinksModel;

            QuickLinksReName QuickLinksRenameElement = new QuickLinksReName(LinkModel);
            var diglog = CPApplication.Current.CurrentPage.Context.Window.ShowDialog(PageResource.LbRenameTitle, QuickLinksRenameElement);

            QuickLinksRenameElement.diglog = diglog;
            diglog.Closed += new EventHandler(diglog_Closed);
        }
Exemple #4
0
        private void bt_QuickLink_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
        {
            QuickLinksModel item = (QuickLinksModel)((FrameworkElement)sender).DataContext;

            QuickLinksRightMenu riverContextMenu = new QuickLinksRightMenu();

            riverContextMenu.DataContext = item;
            ContextMenu menu = riverContextMenu.menu;

            menu.VerticalOffset   = e.GetPosition(null).Y + 10;
            menu.HorizontalOffset = e.GetPosition(null).X + 10;
            menu.IsOpen           = true;

            riverContextMenu.OnRightMenuDeleteClick -= new QuickLinksRightMenu.DeleteEventHandler(riverContextMenu_OnRightMenuDeleteClick);
            riverContextMenu.OnRightMenuRenameClick -= new QuickLinksRightMenu.ReNameEventHandler(riverContextMenu_OnRightMenuRenameClick);
            riverContextMenu.OnDeleteAllClick       -= new QuickLinksRightMenu.DeleteAllEventHandler(riverContextMenu_OnDeleteAllClick);
            riverContextMenu.OnRightMenuDeleteClick += new QuickLinksRightMenu.DeleteEventHandler(riverContextMenu_OnRightMenuDeleteClick);
            riverContextMenu.OnRightMenuRenameClick += new QuickLinksRightMenu.ReNameEventHandler(riverContextMenu_OnRightMenuRenameClick);
            riverContextMenu.OnDeleteAllClick       += new QuickLinksRightMenu.DeleteAllEventHandler(riverContextMenu_OnDeleteAllClick);
        }
Exemple #5
0
        void riverContextMenu_OnRightMenuDeleteClick(object sender)
        {
            this.m_menuContextInvoke = true;
            CPApplication.Current.CurrentPage.Context.Window.Confirm(null, PageResource.LblDeleteQuickLinksConfirm, (elem, result) =>
            {
                if (result.DialogResult == DialogResultType.OK)
                {
                    QuickLinksModel LinkModel = sender as QuickLinksModel;
                    int DeleteIndex           = LinkModel.OrderIndex;

                    string ViewStatus = LinkModel.ViewStatus;

                    ListItems.Remove(LinkModel);

                    int ItemCount = ListItems.Count;

                    for (int j = ItemCount - 1; j >= 0; j--)
                    {
                        var _LinkModel = ListItems[j] as QuickLinksModel;

                        if (_LinkModel.OrderIndex > DeleteIndex && _LinkModel.ViewStatus == ViewStatus)
                        {
                            _LinkModel.OrderIndex--;
                        }
                        //如果删除的时第一横向显示的quicklink的话,则把横向的最新的第一quicklink的SplitBarVisibable改为不可见。
                        if (_LinkModel.OrderIndex == 0 && _LinkModel.ViewStatus == "Y")
                        {
                            _LinkModel.IsVisibable = false;
                        }
                    }

                    ComponentFactory.GetComponent <IUserProfile>().Set(UserProfileKey.Key_QuickLink, ListItems, true);

                    LoadListBox();

                    OnSizeDelArrangeLine();
                }
            });
        }