void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.CtlPOD = ((VMuktiGrid.CustomGrid.ctlPOD)(target)); #line 4 "..\..\..\..\..\Controls\VMuktiGrid\Grid\ctlPOD.xaml" this.CtlPOD.AddHandler(System.Windows.Input.Mouse.MouseMoveEvent, new System.Windows.Input.MouseEventHandler(this.ctlPOD_MouseMove)); #line default #line hidden return; case 2: this.OnMouseEnter1_BeginStoryboard = ((System.Windows.Media.Animation.BeginStoryboard)(target)); return; case 3: this.OnMouseLeave1_BeginStoryboard = ((System.Windows.Media.Animation.BeginStoryboard)(target)); return; case 4: this.grdMain = ((System.Windows.Controls.Grid)(target)); return; case 5: this.grdSub = ((System.Windows.Controls.Grid)(target)); return; case 6: this.colDef1 = ((System.Windows.Controls.ColumnDefinition)(target)); return; case 7: this.rowDef1 = ((System.Windows.Controls.RowDefinition)(target)); return; case 8: this.rowDef2 = ((System.Windows.Controls.RowDefinition)(target)); return; case 9: this.Rectangle = ((System.Windows.Shapes.Rectangle)(target)); return; case 10: this.brdPOD = ((System.Windows.Controls.Border)(target)); #line 107 "..\..\..\..\..\Controls\VMuktiGrid\Grid\ctlPOD.xaml" this.brdPOD.AddHandler(System.Windows.Input.Mouse.MouseEnterEvent, new System.Windows.Input.MouseEventHandler(this.brdPOD_MouseEnter)); #line default #line hidden #line 109 "..\..\..\..\..\Controls\VMuktiGrid\Grid\ctlPOD.xaml" this.brdPOD.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.grdTitle_PreviewMouseDown); #line default #line hidden return; case 11: this.grdTitle = ((System.Windows.Controls.Grid)(target)); return; case 12: this.imgPODIcon = ((System.Windows.Controls.Image)(target)); return; case 13: this.lblTitle = ((System.Windows.Controls.Label)(target)); return; case 14: this.btnClose = ((System.Windows.Controls.Button)(target)); #line 122 "..\..\..\..\..\Controls\VMuktiGrid\Grid\ctlPOD.xaml" this.btnClose.Click += new System.Windows.RoutedEventHandler(this.btnClose_Click); #line default #line hidden return; case 15: this.objBuddyList = ((VMuktiGrid.Buddy.ctlPodBuddyList)(target)); return; case 16: this.btnMinPanel = ((System.Windows.Controls.Button)(target)); #line 150 "..\..\..\..\..\Controls\VMuktiGrid\Grid\ctlPOD.xaml" this.btnMinPanel.Click += new System.Windows.RoutedEventHandler(this.btnMinPanel_Click); #line default #line hidden return; case 17: this.grdBody = ((System.Windows.Controls.Grid)(target)); return; case 18: this.Rct1 = ((System.Windows.Shapes.Rectangle)(target)); return; case 19: this.animImage = ((ReissSoftware.ImageAnim)(target)); return; case 20: this.btnHidePanel = ((System.Windows.Controls.Button)(target)); #line 175 "..\..\..\..\..\Controls\VMuktiGrid\Grid\ctlPOD.xaml" this.btnHidePanel.Click += new System.Windows.RoutedEventHandler(this.btnHidePanel_Click); #line default #line hidden return; case 21: this.btnMinPanel1 = ((System.Windows.Controls.Button)(target)); #line 186 "..\..\..\..\..\Controls\VMuktiGrid\Grid\ctlPOD.xaml" this.btnMinPanel1.Click += new System.Windows.RoutedEventHandler(this.btnMinPanel1_Click); #line default #line hidden return; } this._contentLoaded = true; }
//checking wheather perticular pod is in the itemscontrol or not private bool IsPanelInItemsControl(ctlPOD panel, ItemsControl itemsControl) { try { for (int i = 0; i < itemsControl.Items.Count; i++) { if (itemsControl.Items[i].GetType() == typeof(ctlPOD) && itemsControl.Items[i] == panel) { return true; } } } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "IsPanelInItemControl()", "Controls\\VmuktiGrid\\Grid\\CtlGrid.xaml.cs"); } return false; }
//to add the pod on grid from another person(host)when dropped. public void AddControl(int intModID, string strModTitle, string strIsCollaborative, string strURI, int[] arrPermissionValue, bool flag, string strFromWhere) { try { if (LeftPanelContainer.Items.Count == 0 || (LeftPanelContainer.Items.Count < CentralPanelContainer.Items.Count && LeftPanelContainer.Items.Count < RightPanelContainer.Items.Count) || (LeftPanelContainer.Items.Count == CentralPanelContainer.Items.Count && LeftPanelContainer.Items.Count == RightPanelContainer.Items.Count)) { ctlPOD objPod = new ctlPOD(intModID, strModTitle, strIsCollaborative, strURI, arrPermissionValue, flag, strFromWhere, LeftPanelContainer, true, null); objPod.OwnerPodIndex = VMukti.App.podCounter++; } else if (CentralPanelContainer.Items.Count == 0 || (CentralPanelContainer.Items.Count < LeftPanelContainer.Items.Count && CentralPanelContainer.Items.Count < RightPanelContainer.Items.Count)) { ctlPOD objPod = new ctlPOD(intModID, strModTitle, strIsCollaborative, strURI, arrPermissionValue, flag, strFromWhere, CentralPanelContainer, true, null); objPod.OwnerPodIndex = VMukti.App.podCounter++; } else if (RightPanelContainer.Items.Count == 0 || (RightPanelContainer.Items.Count < LeftPanelContainer.Items.Count && RightPanelContainer.Items.Count < CentralPanelContainer.Items.Count)) { ctlPOD objPod = new ctlPOD(intModID, strModTitle, strIsCollaborative, strURI, arrPermissionValue, flag, strFromWhere, RightPanelContainer, true, null); objPod.OwnerPodIndex = VMukti.App.podCounter++; } } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "addControl()--1", "Controls\\VmuktiGrid\\Grid\\CtlGrid.xaml.cs"); } }
//void fncChangItemControl() //{ // try // { // for (int i = 0; i < CentralPanelContainer.Items.Count; i++) // { // if (CentralPanelContainer.Items[i].GetType() == typeof(ctlPOD)) // { // ctlPOD objpod = CentralPanelContainer.Items[i] as ctlPOD; // CentralPanelContainer.Items.RemoveAt(i); // RightPanelContainer.Items.Add(objpod); // } // } // } // catch (Exception ex) // { // VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "fncChangItemControl", "Controls\\VmuktiGrid\\Grid\\CtlGrid.xaml.cs"); // } //} #endregion //it will return the ItemsControl on which current pod is - hit testing private ItemsControl GetItemsControlContainingPanel(ctlPOD panel) { try { if (this.IsPanelInItemsControl(panel, this.LeftPanelContainer)) { return this.LeftPanelContainer; } else if (this.IsPanelInItemsControl(panel, this.CentralPanelContainer)) { return this.CentralPanelContainer; } else if (this.IsPanelInItemsControl(panel, this.RightPanelContainer)) { return this.RightPanelContainer; } else if (this.IsPanelInItemsControl(panel, this.TopPanelContainer)) { return this.TopPanelContainer; } else if (this.IsPanelInItemsControl(panel, this.BottomPanelContainer)) { return this.BottomPanelContainer; } else { return null; } } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "GetItemsControlContainingPanel()", "Controls\\VmuktiGrid\\Grid\\CtlGrid.xaml.cs"); return null; } }
public void FncDrop(string caption, string tag, MouseButtonEventArgs e) { try { targetItemsControl = null; VisualTreeHelper.HitTest(this.DocumentRoot, new HitTestFilterCallback(this.FilterHitTestResultsCallback), new HitTestResultCallback(this.HitTestResultCallback), new PointHitTestParameters(Mouse.PrimaryDevice.GetPosition(this.DocumentRoot))); string[] strTag = tag.Split(','); if (targetItemsControl != null) { ClsPermissionCollection objCPC = ClsPermissionCollection.Get_PermissionRefModule(int.Parse(strTag[0]), VMuktiAPI.VMuktiInfo.CurrentPeer.RoleID); int[] arrPermissionValue = new int[objCPC.Count]; for (int percount = 0; percount < objCPC.Count; percount++) { arrPermissionValue[percount] = objCPC[percount].PermissionValue; } ctlPOD objTempPOD = new ctlPOD(int.Parse(strTag[0]), caption, strTag[2], null, arrPermissionValue, false, "fromLeftPane", targetItemsControl, true, null,0); objTempPOD.OwnerPodIndex = VMukti.App.podCounter++; } } catch (Exception ex) { } }
private void OnModuleDrop(object o, RoutedEventArgs args) { try { string parameter = args.OriginalSource.ToString(); string[] strTag = parameter.ToString().Split(','); if (strTag.Length == 4) { ClsPermissionCollection objCPC = ClsPermissionCollection.Get_PermissionRefModule(int.Parse(strTag[0]), VMuktiAPI.VMuktiInfo.CurrentPeer.RoleID); int[] arrPermissionValue = new int[objCPC.Count]; for (int percount = 0; percount < objCPC.Count; percount++) { arrPermissionValue[percount] = objCPC[percount].PermissionValue; } ctlPOD objTempPOD = new ctlPOD(int.Parse(strTag[0]), strTag[3], strTag[2], null, arrPermissionValue, false, "fromLeftPane", CentralPanelContainer, true, null); objTempPOD.OwnerPodIndex = VMukti.App.podCounter++; } } catch (Exception ex) { } }
//to load whole grid design from another person/host from new page object from object of clsPageInfo class (pages are not saved) when same page is not found. public void LoadNewMeetingGrid(clsPageInfo objPageInfo, int intTabIndex) { try { clsTabInfo objTabInfo = objPageInfo.objaTabs[intTabIndex]; DocumentRoot.ColumnDefinitions[0].Width = new GridLength(objTabInfo.dblC1Width, GridUnitType.Star); DocumentRoot.ColumnDefinitions[1].Width = new GridLength(objTabInfo.dblC2Width, GridUnitType.Star); DocumentRoot.ColumnDefinitions[2].Width = new GridLength(objTabInfo.dblC3Width, GridUnitType.Star); DocumentRoot.RowDefinitions[0].Height = new GridLength(objTabInfo.dblC4Height, GridUnitType.Pixel); DocumentRoot.RowDefinitions[2].Height = new GridLength(objTabInfo.dblC5Height, GridUnitType.Pixel); foreach (clsPodInfo item in objTabInfo.objaPods) { //AddControl(item.ModuleId, item.PodTitle, item.ModuleId item.ColumnId); VMukti.Business.VMuktiGrid.ClsModule objModule = VMukti.Business.VMuktiGrid.ClsModule.GetPodModule(item.intModuleId); ClsPermissionCollection objCPC = ClsPermissionCollection.Get_PermissionRefModule(item.intModuleId, VMuktiAPI.VMuktiInfo.CurrentPeer.RoleID); int[] arrPermissionValue = new int[objCPC.Count]; for (int percount = 0; percount < objCPC.Count; percount++) { arrPermissionValue[percount] = objCPC[percount].PermissionValue; } ctlPOD objPod = null; if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.BootStrap || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.SuperNode || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.NodeWithNetP2P) { objPod = new ctlPOD(item.intModuleId, item.strPodTitle, objModule.IsCollaborative, item.strUri[0], arrPermissionValue, false, "fromOtherPeer", null, true, objPageInfo); } else if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.NodeWithHttp) { objPod = new ctlPOD(item.intModuleId, item.strPodTitle, objModule.IsCollaborative, item.strUri[1], arrPermissionValue, false, "fromOtherPeer", null, true, objPageInfo); } if (item.intColumnNumber == 1) { //LeftPanelContainer.Items.Add(objPod); //objPod.ColNo = 1; objPod.ObjectID = item.intPodID; objPod.Tag = item.intPodID; objPod.ColNo = 1; LeftPanelContainer.Items.Add(objPod); } else if (item.intColumnNumber == 2) { //CentralPanelContainer.Items.Add(objPod); //objPod.ColNo = 2; objPod.ObjectID = item.intPodID; objPod.Tag = item.intPodID; objPod.ColNo = 2; CentralPanelContainer.Items.Add(objPod); } else if (item.intColumnNumber == 3) { //RightPanelContainer.Items.Add(objPod); //objPod.ColNo = 3; objPod.ObjectID = item.intPodID; objPod.Tag = item.intPodID; objPod.ColNo = 3; objPod.IsTwoPanel = true; RightPanelContainer.Items.Add(objPod); } else if (item.intColumnNumber == 4) { //TopPanelContainer.Items.Add(objPod); //objPod.ColNo = 4; objPod.ObjectID = item.intPodID; objPod.Tag = item.intPodID; objPod.ColNo = 4; TopPanelContainer.Items.Add(objPod); } else if (item.intColumnNumber == 5) { //BottomPanelContainer.Items.Add(objPod); //objPod.ColNo = 5; objPod.ObjectID = item.intPodID; objPod.Tag = item.intPodID; objPod.ColNo = 5; BottomPanelContainer.Items.Add(objPod); } objPod.OwnerPodIndex = item.intOwnerPodIndex; foreach (string strBuddyName in item.straPodBuddies) { //objPod.AddBuddy(strBuddyName); //objPod.SetMaxCounter(1, strBuddyName); if (strBuddyName != VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName) { objPod.AddBuddy(strBuddyName); objPod.SetMaxCounter(1, strBuddyName); } } } } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "LoadNewMeetinggrid()", "Controls\\VmuktiGrid\\Grid\\CtlGrid.xaml.cs"); } }
//to load whole grid design from another person/host from relative tabindex from object of clsPageInfo class (pages are not saved)... when we already in meeting with another user for widget and u drop another widget on same tab and drop the same use again this function will ensure new widget opens in the same meeting tab instead into new tab. public void LoadMeetingGrid(clsPageInfo objPageInfo, int intTabIndex) { try { clsTabInfo objTabInfo = objPageInfo.objaTabs[intTabIndex]; DocumentRoot.ColumnDefinitions[0].Width = new GridLength(objTabInfo.dblC1Width, GridUnitType.Star); DocumentRoot.ColumnDefinitions[1].Width = new GridLength(objTabInfo.dblC2Width, GridUnitType.Star); DocumentRoot.ColumnDefinitions[2].Width = new GridLength(objTabInfo.dblC3Width, GridUnitType.Star); DocumentRoot.RowDefinitions[0].Height = new GridLength(objTabInfo.dblC4Height, GridUnitType.Pixel); DocumentRoot.RowDefinitions[2].Height = new GridLength(objTabInfo.dblC5Height, GridUnitType.Pixel); int i = 0; int j = 0; for (i = 0; i < objTabInfo.objaPods.Length; i++) { VMukti.Business.VMuktiGrid.ClsModule objModule = VMukti.Business.VMuktiGrid.ClsModule.GetPodModule(objTabInfo.objaPods[i].intModuleId); ClsPermissionCollection objCPC = ClsPermissionCollection.Get_PermissionRefModule(objTabInfo.objaPods[i].intModuleId, VMuktiAPI.VMuktiInfo.CurrentPeer.RoleID); int[] arrPermissionValue = new int[objCPC.Count]; for (int percount = 0; percount < objCPC.Count; percount++) { arrPermissionValue[percount] = objCPC[percount].PermissionValue; } if (objTabInfo.objaPods[i].intColumnNumber == 1) { for (j = 0; j < LeftPanelContainer.Items.Count; j++) { if (((ctlPOD)LeftPanelContainer.Items[j]).OwnerPodIndex == objTabInfo.objaPods[i].intOwnerPodIndex && objPageInfo.strDropType != "OnBuddyClick") { break; } } if (j == LeftPanelContainer.Items.Count) { ctlPOD objPod = null; if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.BootStrap || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.SuperNode || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.NodeWithNetP2P) { objPod = new ctlPOD(objTabInfo.objaPods[i].intModuleId, objTabInfo.objaPods[i].strPodTitle, objModule.IsCollaborative, objTabInfo.objaPods[i].strUri[0], arrPermissionValue, false, "fromOtherPeer", LeftPanelContainer, true, objPageInfo); } else if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.NodeWithHttp) { objPod = new ctlPOD(objTabInfo.objaPods[i].intModuleId, objTabInfo.objaPods[i].strPodTitle, objModule.IsCollaborative, objTabInfo.objaPods[i].strUri[1], arrPermissionValue, false, "fromOtherPeer", LeftPanelContainer, true, objPageInfo); } objPod.OwnerPodIndex = objTabInfo.objaPods[i].intOwnerPodIndex; objPod.IsTwoPanel = true; } } else if (objTabInfo.objaPods[i].intColumnNumber == 2) { for (j = 0; j < CentralPanelContainer.Items.Count; j++) { if (((ctlPOD)CentralPanelContainer.Items[j]).OwnerPodIndex == objTabInfo.objaPods[i].intOwnerPodIndex && objPageInfo.strDropType != "OnBuddyClick") { break; } } if (j == CentralPanelContainer.Items.Count) { ctlPOD objPod = null; if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.BootStrap || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.SuperNode || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.NodeWithNetP2P) { objPod = new ctlPOD(objTabInfo.objaPods[i].intModuleId, objTabInfo.objaPods[i].strPodTitle, objModule.IsCollaborative, objTabInfo.objaPods[i].strUri[0], arrPermissionValue, false, "fromOtherPeer", CentralPanelContainer, true, objPageInfo); } else if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.NodeWithHttp) { objPod = new ctlPOD(objTabInfo.objaPods[i].intModuleId, objTabInfo.objaPods[i].strPodTitle, objModule.IsCollaborative, objTabInfo.objaPods[i].strUri[1], arrPermissionValue, false, "fromOtherPeer", CentralPanelContainer, true, objPageInfo); } objPod.OwnerPodIndex = objTabInfo.objaPods[i].intOwnerPodIndex; } } else if (objTabInfo.objaPods[i].intColumnNumber == 3) { for (j = 0; j < RightPanelContainer.Items.Count; j++) { if (((ctlPOD)RightPanelContainer.Items[j]).OwnerPodIndex == objTabInfo.objaPods[i].intOwnerPodIndex && objPageInfo.strDropType != "OnBuddyClick") { break; } } if (j == RightPanelContainer.Items.Count) { ctlPOD objPod = null; if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.BootStrap || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.SuperNode || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.NodeWithNetP2P) { objPod = new ctlPOD(objTabInfo.objaPods[i].intModuleId, objTabInfo.objaPods[i].strPodTitle, objModule.IsCollaborative, objTabInfo.objaPods[i].strUri[0], arrPermissionValue, false, "fromOtherPeer", RightPanelContainer, true, objPageInfo); } else if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.NodeWithHttp) { objPod = new ctlPOD(objTabInfo.objaPods[i].intModuleId, objTabInfo.objaPods[i].strPodTitle, objModule.IsCollaborative, objTabInfo.objaPods[i].strUri[1], arrPermissionValue, false, "fromOtherPeer", RightPanelContainer, true, objPageInfo); } objPod.OwnerPodIndex = objTabInfo.objaPods[i].intOwnerPodIndex; } } else if (objTabInfo.objaPods[i].intColumnNumber == 4) { for (j = 0; j < TopPanelContainer.Items.Count; j++) { if (((ctlPOD)TopPanelContainer.Items[j]).OwnerPodIndex == objTabInfo.objaPods[i].intOwnerPodIndex && objPageInfo.strDropType != "OnBuddyClick") { break; } } if (j == TopPanelContainer.Items.Count) { ctlPOD objPod = null; if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.BootStrap || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.SuperNode || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.NodeWithNetP2P) { objPod = new ctlPOD(objTabInfo.objaPods[i].intModuleId, objTabInfo.objaPods[i].strPodTitle, objModule.IsCollaborative, objTabInfo.objaPods[i].strUri[0], arrPermissionValue, false, "fromOtherPeer", TopPanelContainer, true, objPageInfo); } else if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.NodeWithHttp) { objPod = new ctlPOD(objTabInfo.objaPods[i].intModuleId, objTabInfo.objaPods[i].strPodTitle, objModule.IsCollaborative, objTabInfo.objaPods[i].strUri[1], arrPermissionValue, false, "fromOtherPeer", TopPanelContainer, true, objPageInfo); } objPod.OwnerPodIndex = objTabInfo.objaPods[i].intOwnerPodIndex; } } else if (objTabInfo.objaPods[i].intColumnNumber == 5) { for (j = 0; j < BottomPanelContainer.Items.Count; j++) { if (((ctlPOD)BottomPanelContainer.Items[j]).OwnerPodIndex == objTabInfo.objaPods[i].intOwnerPodIndex && objPageInfo.strDropType != "OnBuddyClick") { break; } } if (j == BottomPanelContainer.Items.Count) { ctlPOD objPod = null; if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.BootStrap || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.SuperNode || VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.NodeWithNetP2P) { objPod = new ctlPOD(objTabInfo.objaPods[i].intModuleId, objTabInfo.objaPods[i].strPodTitle, objModule.IsCollaborative, objTabInfo.objaPods[i].strUri[0], arrPermissionValue, false, "fromOtherPeer", BottomPanelContainer, true, objPageInfo); } else if (VMuktiAPI.VMuktiInfo.CurrentPeer.CurrPeerType == PeerType.NodeWithHttp) { objPod = new ctlPOD(objTabInfo.objaPods[i].intModuleId, objTabInfo.objaPods[i].strPodTitle, objModule.IsCollaborative, objTabInfo.objaPods[i].strUri[1], arrPermissionValue, false, "fromOtherPeer", BottomPanelContainer, true, objPageInfo); } objPod.OwnerPodIndex = objTabInfo.objaPods[i].intOwnerPodIndex; } } } } catch (Exception ex) { VMuktiAPI.VMuktiHelper.ExceptionHandler(ex, "LoadMeetingGrid()", "Controls\\VmuktiGrid\\Grid\\CtlGrid.xaml.cs"); } }