//------------------------------ void getTrunkReport(object pSender, EventArgs pArgs) { currentlyMaximizedPanel = TrunkReport; if (trunkReportLoaded) { return; } trunkReportLoaded = true; service.GetTrunkReportAsync(0, reportDate); Cursor = Cursors.Wait; }
//------------------------------ void getNodesReport(object sender, EventArgs e) { currentlyMaximizedPanel = NodesReport; if (nodeReportLoaded) { return; } nodeReportLoaded = true; service.GetNodeReportAsync(reportDate); Cursor = Cursors.Wait; }
//管理匿名事件 //EventHandler<ViewModel.LoadModuleEventArgs> LoadTaskHandler = null; //private void CheckeDepends(string moduleName) //{ // var module = ViewModel.Context.Managed.Catalog.FirstOrDefault(item => item.ModuleName == moduleName); // if (module != null) // { // ViewModel.Context.Managed.OnSystemLoadModuleCompleted += LoadTaskHandler = (o, e) => // { // ViewModel.Context.Managed.OnSystemLoadModuleCompleted -= LoadTaskHandler; // if (e.Error == null) // { // AddOAWebPart(); // } // }; // ViewModel.Context.Managed.LoadModule(moduleName); // } //} private void AddOAWebPart() { var OAWebPaer = CreateOAWebPart(); if (OAWebPaer != null) { DragDockPanel item6 = new DragDockPanel(); //item6.TileState = TileViewItemState.Minimized; item6.Header = "公司发文"; item6.Content = OAWebPaer; radtileview.AddPanel(item6); } }
private void PopulatePanels(string strSecType) { DragDockPanel childDDPanel; int panelId = new Random((int)((DateTime.Now.Ticks) % (Int32.MaxValue))).Next(); switch (strSecType) { case "Security": childDDPanel = new DragDockPanel { Content = GetListSecurity("Share"), Header = new string[] { "Security Basket", panelId.ToString() } }; childDDPanel.Closed += childDDPanel_Closed; PopulateUserPreferences(panelId, childDDPanel, "Security Basket"); LayoutGrid.Children.Add(childDDPanel); return; case "Currency": childDDPanel = new DragDockPanel { Content = GetListSecurity("Currency"), Header = new string[] { "Currency Basket", panelId.ToString() } }; childDDPanel.Closed += childDDPanel_Closed; PopulateUserPreferences(panelId, childDDPanel, "Currency Basket"); LayoutGrid.Children.Add(childDDPanel); return; case "Commodity": childDDPanel = new DragDockPanel { Content = GetListSecurity("Commodity"), Header = new string[] { "Commodity Basket", panelId.ToString() } }; childDDPanel.Closed += childDDPanel_Closed; PopulateUserPreferences(panelId, childDDPanel, "Commodity Basket"); LayoutGrid.Children.Add(childDDPanel); return; default: childDDPanel = new DragDockPanel { Content = GetListSecurity("Share"), Header = new string[] { "Security Basket", panelId.ToString() } }; childDDPanel.Closed += childDDPanel_Closed; PopulateUserPreferences(panelId, childDDPanel, "Security Basket"); LayoutGrid.Children.Add(childDDPanel); return; } }
private void PopulateUserPreferences(int id, DragDockPanel child, string header) { if (!isPopulatingPref) { persistDDPanel = new PersistPreference(); persistDDPanel.Id = id; persistDDPanel.Content = child; persistDDPanel.Header = header; userPreference.Add(persistDDPanel); } else { persistDDPanel = new PersistPreference(); persistDDPanel.Id = id; persistDDPanel.Content = child; persistDDPanel.Header = header; userPreferenceDeserialize.Add(persistDDPanel); } }
private void homePanel_PanelClosed(object sender, EventArgs e) { DragDockPanel currentPanel = sender as DragDockPanel; foreach (DragDockPanel panel in this.dragDockPanelHost.Items) { if (panel.PanelIndex == currentPanel.PanelIndex) { this.dragDockPanelHost.Width -= 360; this.dragDockPanelHost.Items.Remove(currentPanel); switch (panel.PanelIndex) { case 0: ConfigurationSettings.FriendTimelinClose = true; break; case 1: ConfigurationSettings.UserCommentClose = true; break; case 2: ConfigurationSettings.UserFavoriteClose = true; break; case 3: ConfigurationSettings.UserMentionClose = true; break; case 4: ConfigurationSettings.UserProfileClose = true; break; case 5: ConfigurationSettings.UserFollowerClose = true; break; } break; } } }
/// <summary> /// Puts all of the panel back to a grid view. /// </summary> /// <param name="sender">The minimising panel.</param> /// <param name="e">Event args.</param> private void DragDockPanel_Restored(object sender, EventArgs e) { // Set max'ed panel to null this.maximizedPanel = null; // Loop through children to disable dragging foreach (UIElement child in this.panels) { DragDockPanel panel = child as DragDockPanel; panel.Restore(); panel.DraggingEnabled = true; } // Update sizes and layout this.AnimatePanelSizes(); this.AnimatePanelLayout(); }
/// <summary> /// Maximises a panel. /// </summary> /// <param name="sender">the panel to maximise.</param> /// <param name="e">Event args.</param> private void DragDockPanel_Maximized(object sender, EventArgs e) { DragDockPanel maximizedPanel = sender as DragDockPanel; // Store max'ed panel this.maximizedPanel = maximizedPanel; // Loop through children to disable dragging foreach (UIElement child in this.panels) { DragDockPanel panel = child as DragDockPanel; panel.DraggingEnabled = false; if (panel != this.maximizedPanel) { panel.Minimize(); } } // Update sizes and layout this.AnimatePanelSizes(); this.AnimatePanelLayout(); }
/// <summary> /// Keeps a reference to the dragging panel. /// </summary> /// <param name="sender">The dragging panel.</param> /// <param name="args">Drag event args.</param> private void DragDockPanel_DragStarted(object sender, DragEventArgs args) { DragDockPanel panel = sender as DragDockPanel; // Keep reference to dragging panel this.draggingPanel = panel; }
/// <summary> /// Drops the dragging panel. /// </summary> /// <param name="sender">The dragging panel.</param> /// <param name="args">Drag event args.</param> private void DragDockPanel_DragFinished(object sender, DragEventArgs args) { // Set dragging panel back to null this.draggingPanel = null; // Update the layout (to reset all panel positions) this.UpdatePanelLayout(); }
/// <summary> /// Unprepares a panel for the UI. Override for hooking custom events. /// </summary> /// <param name="panel">The panel to prepare.</param> protected virtual void UnpreparePanel(DragDockPanel panel) { if (panel.PanelState == PanelState.Maximized) { this.DragDockPanel_Restored(null, null); } // Hook up panel events panel.DragStarted -= new DragEventHander(this.DragDockPanel_DragStarted); panel.DragFinished -= new DragEventHander(this.DragDockPanel_DragFinished); panel.DragMoved -= new DragEventHander(this.DragDockPanel_DragMoved); panel.Maximized -= new EventHandler(this.DragDockPanel_Maximized); panel.Restored -= new EventHandler(this.DragDockPanel_Restored); }
/// <summary> /// Prepares a panel for the UI. Override for hooking custom events. /// </summary> /// <param name="panel">The panel to prepare.</param> protected virtual void PreparePanel(DragDockPanel panel) { // Hook up panel events panel.DragStarted += new DragEventHander(this.DragDockPanel_DragStarted); panel.DragFinished += new DragEventHander(this.DragDockPanel_DragFinished); panel.DragMoved += new DragEventHander(this.DragDockPanel_DragMoved); panel.Maximized += new EventHandler(this.DragDockPanel_Maximized); panel.Restored += new EventHandler(this.DragDockPanel_Restored); if (panel.PanelState == PanelState.Maximized) { this.maximizedPanel = panel; foreach (DragDockPanel dragDockPanel in this.panels) { if (panel != dragDockPanel) { dragDockPanel.Minimize(); } } } }
//modify by 安凯航.2011年9月5日 //如果radtileview有值则表示不进行初始化 private void LoadWebPartData() { if (radtileview == null) { radtileview = new DragDockPanelHost(); DragDockPanel item2 = new DragDockPanel(); item2.Header = "待办任务"; item2.Content = new SMT.SAAS.Platform.WebParts.Views.PendingTask(); IWebPart currentContent = item2.Content as IWebPart; item2.Maximized += (obj, args) => { currentContent.ShowMaxiWebPart(); }; item2.Minimized += (obj1, args1) => { currentContent.ShowMiniWebPart(); }; item2.PanelState = PanelState.Maximized; //currentContent.OnMoreChanged += (obj3, arg3) => //{ // item2.PanelState = PanelState.Maximized; //}; item2.Style = Application.Current.Resources["WebPartDragDockPanelStyle1"] as Style; radtileview.AddPanel(item2); DragDockPanel item5 = new DragDockPanel(); item5.Header = "我的单据"; item5.Content = new SMT.SAAS.Platform.WebParts.Views.MyRecord(); currentContent = item5.Content as SMT.SaaS.Platform.IWebPart; item5.Maximized += (obj, args) => { currentContent.ShowMaxiWebPart(); }; item5.Minimized += (obj1, args1) => { currentContent.ShowMiniWebPart(); }; //currentContent.OnMoreChanged += (obj3, arg3) => //{ // item5.PanelState = PanelState.Minimized; //}; item5.Style = Application.Current.Resources["WebPartDragDockPanelStyle1"] as Style; radtileview.AddPanel(item5); //RadTileViewItem item3 = new RadTileViewItem(); //item3.TileState = TileViewItemState.Minimized; //item3.Header = "消息提醒"; //item3.Content = new SMT.SAAS.Platform.WebParts.Views.NoteRemind(); //radtileview.Items.Add(item3); DragDockPanel item4 = new DragDockPanel(); item4.Header = "新闻动态"; item4.Content = new SMT.SAAS.Platform.WebParts.Views.News(); currentContent = item4.Content as SMT.SaaS.Platform.IWebPart; item4.Maximized += (obj, args) => { currentContent.ShowMaxiWebPart(); }; item4.Minimized += (obj1, args1) => { currentContent.ShowMiniWebPart(); }; //currentContent.OnMoreChanged += (obj3, arg3) => //{ // item4.PanelState = PanelState.Minimized; //}; item4.Style = Application.Current.Resources["WebPartDragDockPanelStyle1"] as Style; radtileview.AddPanel(item4); //CheckeDepends("SMT.SaaS.OA.UI"); DragDockPanel item6 = new DragDockPanel(); //item6.TileState = TileViewItemState.Minimized; item6.Header = "公司发文"; item6.Content = new SMT.SAAS.Platform.WebParts.Views.OAWebPart(); currentContent = item6.Content as SMT.SaaS.Platform.IWebPart; item6.Maximized += (obj, args) => { currentContent.ShowMaxiWebPart(); }; item6.Minimized += (obj1, args1) => { currentContent.ShowMiniWebPart(); }; //currentContent.OnMoreChanged += (obj3, arg3) => //{ // item6.PanelState = PanelState.Minimized; //}; item6.Style = Application.Current.Resources["WebPartDragDockPanelStyle1"] as Style; radtileview.AddPanel(item6); Root.Children.Add(radtileview); } else { foreach (DragDockPanel item in radtileview.Children) { IWebpart webPart = item.Content as IWebpart; if (webPart != null) { webPart.Initialize(); } } } }