private void SendPageInfo(VMuktiGrid.ctlPage.TabItem objSelectedPage, string buddyname) { try { clsPageInfo objPageInfo = new clsPageInfo(); //if (this.AddBuddy(buddyname, this.SelectedIndex)) if (objSelectedPage.AddBuddy(buddyname)) { VMuktiGrid.ctlTab.TabItem objSelectedTab = null; objPageInfo.intPageID = objSelectedPage.ObjectID; objPageInfo.strPageTitle = ((VMuktiGrid.CustomMenu.ctlPgTabHeader)objSelectedPage.Header).Title; objPageInfo.intOwnerID = VMuktiAPI.VMuktiInfo.CurrentPeer.ID; objPageInfo.intOwnerPageIndex = objSelectedPage.OwnerPageIndex; objPageInfo.ConfID = objSelectedPage.ConfID; objPageInfo.strDropType = "OnPage"; List<string> lstBuddyList = new List<string>(); StackPanel stPageBuddyList = ((ctlMenu)objSelectedPage.Template.FindName("objMenu", objSelectedPage)).objEMIBuddyList.objBuddyList.stBuddyPanel; for (int i = 0; i < stPageBuddyList.Children.Count; i++) { lstBuddyList.Add(((VMuktiGrid.Buddy.ctlBuddy)stPageBuddyList.Children[i]).Title); } objPageInfo.straPageBuddies = lstBuddyList.ToArray(); objSelectedPage.NoOfPODs = 0; List<clsTabInfo> lstTabInfos = new List<clsTabInfo>(); for (int tCnt = 0; tCnt < ((VMuktiGrid.ctlTab.TabControl)objSelectedPage.Content).Items.Count; tCnt++) { objSelectedTab = ((VMuktiGrid.ctlTab.TabItem)((VMuktiGrid.ctlTab.TabControl)objSelectedPage.Content).Items[tCnt]); objSelectedTab.NoOfPODs = 0; lstTabInfos.Add(new clsTabInfo()); lstTabInfos[lstTabInfos.Count - 1].intTabID = objSelectedTab.ObjectID; lstTabInfos[lstTabInfos.Count - 1].strTabTitle = ((VMuktiGrid.CustomMenu.ctlPgTabHeader)objSelectedTab.Header).Title; StackPanel stTabBuddyList = ((ctlMenu)objSelectedTab.Template.FindName("objMenu", objSelectedTab)).objEMIBuddyList.objBuddyList.stBuddyPanel; lstBuddyList.Clear(); for (int i = 0; i < stTabBuddyList.Children.Count; i++) { lstBuddyList.Add(((VMuktiGrid.Buddy.ctlBuddy)stTabBuddyList.Children[i]).Title); } lstTabInfos[lstTabInfos.Count - 1].straTabBuddies = lstBuddyList.ToArray(); //lstTabInfos[lstTabInfos.Count - 1].intOwnerTabIndex = tCnt; lstTabInfos[lstTabInfos.Count - 1].intOwnerTabIndex = objSelectedTab.OwnerTabIndex; lstTabInfos[lstTabInfos.Count - 1].dblC1Width = ((VMuktiGrid.CustomGrid.ctlGrid)objSelectedTab.Content).LeftPanelContainer.ActualWidth; lstTabInfos[lstTabInfos.Count - 1].dblC2Width = ((VMuktiGrid.CustomGrid.ctlGrid)objSelectedTab.Content).CentralPanelContainer.ActualWidth; lstTabInfos[lstTabInfos.Count - 1].dblC3Width = ((VMuktiGrid.CustomGrid.ctlGrid)objSelectedTab.Content).RightPanelContainer.ActualWidth; lstTabInfos[lstTabInfos.Count - 1].dblC4Height = ((VMuktiGrid.CustomGrid.ctlGrid)objSelectedTab.Content).TopPanelContainer.ActualHeight; lstTabInfos[lstTabInfos.Count - 1].dblC5Height = ((VMuktiGrid.CustomGrid.ctlGrid)objSelectedTab.Content).BottomPanelContainer.ActualHeight; List<clsPodInfo> lstPodInfo = new List<clsPodInfo>(); VMuktiGrid.CustomGrid.ctlGrid objSelectedGrid = (VMuktiGrid.CustomGrid.ctlGrid)objSelectedTab.Content; for (int pCnt = 0; pCnt < objSelectedGrid.LeftPanelContainer.Items.Count; pCnt++) { if (objSelectedGrid.LeftPanelContainer.Items[pCnt].GetType() == typeof(VMuktiGrid.CustomGrid.ctlPOD)) { //lstPodInfo.Add(new clsPodInfo()); //fncGetPodInfo(lstPodInfo, lstPodInfo.Count - 1, ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.LeftPanelContainer.Items[pCnt])); //lstPodInfo[lstPodInfo.Count - 1].intColumnNumber = 1; //lstPodInfo[lstPodInfo.Count - 1].intOwnerPodIndex = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.LeftPanelContainer.Items[pCnt]).OwnerPodIndex; clsPodInfo objPodInfo = new clsPodInfo(); objPodInfo.intPodID = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.LeftPanelContainer.Items[pCnt]).ObjectID; objPodInfo.intModuleId = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.LeftPanelContainer.Items[pCnt]).ModuleID; objPodInfo.strPodTitle = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.LeftPanelContainer.Items[pCnt]).Title; objPodInfo.strUri = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.LeftPanelContainer.Items[pCnt]).WCFUri; objPodInfo.intColumnNumber = 1; lstBuddyList.Clear(); StackPanel stPodBuddyList = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.LeftPanelContainer.Items[pCnt]).objBuddyList.stPanel; for (int i = 0; i < stPodBuddyList.Children.Count; i++) { if (stPodBuddyList.Children[i].GetType() == typeof(VMuktiGrid.Buddy.ctlBuddy)) { lstBuddyList.Add(((VMuktiGrid.Buddy.ctlBuddy)stPodBuddyList.Children[i]).Title); } } //lstPodInfo[lstPodInfo.Count - 1].straPodBuddies = lstBuddyList.ToArray(); objPodInfo.straPodBuddies = lstBuddyList.ToArray(); lstPodInfo.Add(objPodInfo); ((VMuktiGrid.ctlPage.TabItem)this.SelectedItem).NoOfPODs++; objSelectedTab.NoOfPODs++; } } for (int pCnt = 0; pCnt < objSelectedGrid.CentralPanelContainer.Items.Count; pCnt++) { if (objSelectedGrid.CentralPanelContainer.Items[pCnt].GetType() == typeof(VMuktiGrid.CustomGrid.ctlPOD)) { clsPodInfo objPodInfo=new clsPodInfo(); objPodInfo.intPodID = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.CentralPanelContainer.Items[pCnt]).ObjectID; objPodInfo.intModuleId = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.CentralPanelContainer.Items[pCnt]).ModuleID; objPodInfo.strPodTitle = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.CentralPanelContainer.Items[pCnt]).Title; objPodInfo.strUri = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.CentralPanelContainer.Items[pCnt]).WCFUri; objPodInfo.intColumnNumber = 2; //fncGetPodInfo(lstPodInfo, lstPodInfo.Count - 1, ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.CentralPanelContainer.Items[pCnt])); //lstPodInfo[lstPodInfo.Count - 1].intColumnNumber = 2; lstBuddyList.Clear(); StackPanel stPodBuddyList = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.CentralPanelContainer.Items[pCnt]).objBuddyList.stPanel; for (int i = 0; i < stPodBuddyList.Children.Count; i++) { if (stPodBuddyList.Children[i].GetType() == typeof(VMuktiGrid.Buddy.ctlBuddy)) { lstBuddyList.Add(((VMuktiGrid.Buddy.ctlBuddy)stPodBuddyList.Children[i]).Title); } } objPodInfo.straPodBuddies = lstBuddyList.ToArray(); lstPodInfo.Add(objPodInfo); ((VMuktiGrid.ctlPage.TabItem)this.SelectedItem).NoOfPODs++; objSelectedTab.NoOfPODs++; } } for (int pCnt = 0; pCnt < objSelectedGrid.RightPanelContainer.Items.Count; pCnt++) { if (objSelectedGrid.RightPanelContainer.Items[pCnt].GetType() == typeof(VMuktiGrid.CustomGrid.ctlPOD)) { //lstPodInfo.Add(new clsPodInfo()); //fncGetPodInfo(lstPodInfo, lstPodInfo.Count - 1, ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.RightPanelContainer.Items[pCnt])); //lstPodInfo[lstPodInfo.Count - 1].intColumnNumber = 3; clsPodInfo objPodInfo = new clsPodInfo(); objPodInfo.intPodID = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.RightPanelContainer.Items[pCnt]).ObjectID; objPodInfo.intModuleId = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.RightPanelContainer.Items[pCnt]).ModuleID; objPodInfo.strPodTitle = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.RightPanelContainer.Items[pCnt]).Title; objPodInfo.strUri = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.RightPanelContainer.Items[pCnt]).WCFUri; objPodInfo.intColumnNumber = 3; lstBuddyList.Clear(); StackPanel stPodBuddyList = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.RightPanelContainer.Items[pCnt]).objBuddyList.stPanel; for (int i = 0; i < stPodBuddyList.Children.Count; i++) { if (stPodBuddyList.Children[i].GetType() == typeof(VMuktiGrid.Buddy.ctlBuddy)) { lstBuddyList.Add(((VMuktiGrid.Buddy.ctlBuddy)stPodBuddyList.Children[i]).Title); } } //lstPodInfo[lstPodInfo.Count - 1].straPodBuddies = lstBuddyList.ToArray(); objPodInfo.straPodBuddies = lstBuddyList.ToArray(); lstPodInfo.Add(objPodInfo); objSelectedPage.NoOfPODs++; objSelectedTab.NoOfPODs++; } } for (int pCnt = 0; pCnt < objSelectedGrid.TopPanelContainer.Items.Count; pCnt++) { if (objSelectedGrid.TopPanelContainer.Items[pCnt].GetType() == typeof(VMuktiGrid.CustomGrid.ctlPOD)) { //lstPodInfo.Add(new clsPodInfo()); //fncGetPodInfo(lstPodInfo, lstPodInfo.Count - 1, ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.TopPanelContainer.Items[pCnt])); //lstPodInfo[lstPodInfo.Count - 1].intColumnNumber = 4; clsPodInfo objPodInfo = new clsPodInfo(); objPodInfo.intPodID = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.TopPanelContainer.Items[pCnt]).ObjectID; objPodInfo.intModuleId = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.TopPanelContainer.Items[pCnt]).ModuleID; objPodInfo.strPodTitle = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.TopPanelContainer.Items[pCnt]).Title; objPodInfo.strUri = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.TopPanelContainer.Items[pCnt]).WCFUri; objPodInfo.intColumnNumber = 4; lstBuddyList.Clear(); StackPanel stPodBuddyList = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.TopPanelContainer.Items[pCnt]).objBuddyList.stPanel; for (int i = 0; i < stPodBuddyList.Children.Count; i++) { if (stPodBuddyList.Children[i].GetType() == typeof(VMuktiGrid.Buddy.ctlBuddy)) { lstBuddyList.Add(((VMuktiGrid.Buddy.ctlBuddy)stPodBuddyList.Children[i]).Title); } } //lstPodInfo[lstPodInfo.Count - 1].straPodBuddies = lstBuddyList.ToArray(); objPodInfo.straPodBuddies = lstBuddyList.ToArray(); lstPodInfo.Add(objPodInfo); ((VMuktiGrid.ctlPage.TabItem)this.SelectedItem).NoOfPODs++; objSelectedTab.NoOfPODs++; } } for (int pCnt = 0; pCnt < objSelectedGrid.BottomPanelContainer.Items.Count; pCnt++) { if (objSelectedGrid.BottomPanelContainer.Items[pCnt].GetType() == typeof(VMuktiGrid.CustomGrid.ctlPOD)) { //lstPodInfo.Add(new clsPodInfo()); //fncGetPodInfo(lstPodInfo, lstPodInfo.Count - 1, ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.BottomPanelContainer.Items[pCnt])); //lstPodInfo[lstPodInfo.Count - 1].intColumnNumber = 5; clsPodInfo objPodInfo = new clsPodInfo(); objPodInfo.intPodID = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.BottomPanelContainer.Items[pCnt]).ObjectID; objPodInfo.intModuleId = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.BottomPanelContainer.Items[pCnt]).ModuleID; objPodInfo.strPodTitle = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.BottomPanelContainer.Items[pCnt]).Title; objPodInfo.strUri = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.BottomPanelContainer.Items[pCnt]).WCFUri; objPodInfo.intColumnNumber = 5; lstBuddyList.Clear(); StackPanel stPodBuddyList = ((VMuktiGrid.CustomGrid.ctlPOD)objSelectedGrid.BottomPanelContainer.Items[pCnt]).objBuddyList.stPanel; for (int i = 0; i < stPodBuddyList.Children.Count; i++) { if (stPodBuddyList.Children[i].GetType() == typeof(VMuktiGrid.Buddy.ctlBuddy)) { lstBuddyList.Add(((VMuktiGrid.Buddy.ctlBuddy)stPodBuddyList.Children[i]).Title); } } //lstPodInfo[lstPodInfo.Count - 1].straPodBuddies = lstBuddyList.ToArray(); //((VMuktiGrid.ctlPage.TabItem)this.SelectedItem).NoOfPODs++; objPodInfo.straPodBuddies = lstBuddyList.ToArray(); lstPodInfo.Add(objPodInfo); objSelectedPage.NoOfPODs++; objSelectedTab.NoOfPODs++; } } lstTabInfos[lstTabInfos.Count - 1].objaPods = lstPodInfo.ToArray(); objSelectedTab.SetMaxCounter(objSelectedTab.NoOfPODs, buddyname); } objPageInfo.objaTabs = lstTabInfos.ToArray(); objPageInfo.strFrom = VMuktiAPI.VMuktiInfo.CurrentPeer.DisplayName; objPageInfo.strTo = buddyname; objPageInfo.strMsg = "OPEN_PAGE"; this.SetMaxCounter(objSelectedPage.NoOfPODs, buddyname); } objPage = objPageInfo; } catch (Exception exp) { MessageBox.Show("exp" + exp.Message); //return null; } }
void fncGetPodInfoForDrop(List<clsPodInfo> lstPodInfo, int index, VMuktiGrid.CustomGrid.ctlPOD objPod) { lstPodInfo[index].intModuleId = objPod.ModuleID; lstPodInfo[index].strPodTitle = objPod.Title; lstPodInfo[index].strUri = objPod.WCFUri; lstPodInfo[index].intOwnerPodIndex = objPod.OwnerPodIndex; }
public clsPageInfo SendPage(VMuktiGrid.ctlPage.TabItem objSelectedPage, string buddyname) { try { objPage = new clsPageInfo(); this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, objSendPageInfo, objSelectedPage, buddyname); return objPage; } catch (Exception exp) { MessageBox.Show("SendPage" + exp.Message); return null; } }