private void FillTree(int UserId) { LUser = (User)Session["LUser"]; Functions F = new Functions(); User CU = F.GetUser(UserId); Sections SS = CU.AllMemberSections; Session["Members"] = SS; tv.Nodes[0].Text = CU.Description; tv.Nodes[0].Type = "User"; tv.Nodes[0].NodeData = CU.ID.ToString() + ":" + "-999"; tv.Nodes[0].Expanded = true; tv.Nodes[0].Nodes.Clear(); TreeNode L = new TreeNode(); L.Text = "Current Sections"; L.Type = "Label"; L.Expanded = true; tv.Nodes[0].Nodes.Add(L); TreeNode U = new TreeNode(); U.Text = "Unassigned Recordings"; U.Type = "Label"; U.DefaultStyle.Add("color","brown"); U.Expanded = true; //Current Sections if(CU.ID == LUser.ID) { foreach(Section CurrentSection in SS) { if(CurrentSection.IsDefault == false) { // Sections AOS = LUser.AllOwnedSections; // if(AOS == null) goto SkipSections; //Add this Section to the treeview and the users recordings in it. TreeNode N = new TreeNode(); N.Text = CurrentSection.Description; N.Type = "Section"; N.DefaultStyle.Add("color","DarkGreen"); N.NodeData = CurrentSection.ID.ToString(); N.ImageUrl = tv.TreeNodeTypes[4].ImageUrl; Recordings CurrentRecordings = F.ALLRecordings(UserId,CurrentSection.ID); int SessionCount = 0; TreeNode[] NSession = new TreeNode[1]; ListBox LB = new ListBox(); string NData = ""; foreach(Recording R in CurrentRecordings) { NData = R.SessionID + ":" + CU.ID.ToString() +":" + CurrentSection.ID.ToString(); if(R.SessionID != "") { bool SkipThis = false; foreach(ListItem LI in LB.Items) { if(LI.Text == NData) { SkipThis = true; } } if(SkipThis == false) { SessionCount++; ListItem LI = new ListItem(NData,R.SessionName); LB.Items.Add(LI); } } } NSession = new TreeNode[SessionCount]; int FillItem = 0; foreach(ListItem LI in LB.Items) { NSession[FillItem] = new TreeNode(); NSession[FillItem].Text = LI.Value; NSession[FillItem].NodeData = LI.Text; NSession[FillItem].Type = "RecordingSession"; NSession[FillItem].DefaultStyle.Add("color","DarkBlue"); NSession[FillItem].ImageUrl = tv.TreeNodeTypes[2].ImageUrl; N.Nodes.Add(NSession[FillItem]); FillItem++; } foreach(Recording R in CurrentRecordings) { TreeNode N2 = new TreeNode(); N2.Text = R.DisplayName; N2.Type = "Recording"; N2.DefaultStyle.Add("color","Blue"); N2.NodeData = R.ID.ToString()+ ":" + CU.ID.ToString() + ":" + CurrentSection.ID.ToString(); N2.ImageUrl = tv.TreeNodeTypes[1].ImageUrl; if(R.SessionID != null) { for(int i = 0; i< SessionCount;i++) { string[] SID = NSession[i].NodeData.Split(':'); if(R.SessionID == SID[0]) { NSession[i].Nodes.Add(N2); } } } } foreach(Recording R in CurrentRecordings) { TreeNode N2 = new TreeNode(); N2.Text = R.DisplayName; if(!R.IsReady) { N2.Type = "Label"; N2.DefaultStyle.Add("color","Gray"); } else { N2.Type = "Recording"; N2.DefaultStyle.Add("color","Blue"); } N2.NodeData = R.ID.ToString()+ ":" + CU.ID.ToString() + ":" + CurrentSection.ID.ToString(); N2.ImageUrl = tv.TreeNodeTypes[1].ImageUrl; if(R.SessionID == "") { N.Nodes.Add(N2); } } L.Nodes.Add(N); } // SkipSections:{} } } else { foreach(Section CurrentSection in SS) { if(CurrentSection.IsDefault == false) { Sections AOS = LUser.AllOwnedSections; if(AOS == null) goto SkipSections; foreach(Section LoginUserSection in AOS) { if(LoginUserSection.IsDefault == false) { bool Addit = F.IsInMyHierarchy(LoginUserSection.ID,CurrentSection.ID); if(Addit == true) { //Add this Section to the treeview and the users recordings in it. TreeNode N = new TreeNode(); N.Text = CurrentSection.Description; N.Type = "Section"; N.DefaultStyle.Add("color","DarkGreen"); N.NodeData = CurrentSection.ID.ToString(); N.ImageUrl = tv.TreeNodeTypes[4].ImageUrl; Recordings CurrentRecordings = F.ALLRecordings(UserId,CurrentSection.ID); int SessionCount = 0; TreeNode[] NSession = new TreeNode[1]; ListBox LB = new ListBox(); string NData = ""; foreach(Recording R in CurrentRecordings) { NData = R.SessionID + ":" + CU.ID.ToString() +":" + LoginUserSection.ID.ToString(); if(R.SessionID != "") { bool SkipThis = false; foreach(ListItem LI in LB.Items) { if(LI.Text == NData) { SkipThis = true; } } if(SkipThis == false) { SessionCount++; ListItem LI = new ListItem(NData,R.SessionName); LB.Items.Add(LI); } } } NSession = new TreeNode[SessionCount]; int FillItem = 0; foreach(ListItem LI in LB.Items) { NSession[FillItem] = new TreeNode(); NSession[FillItem].Text = LI.Value; NSession[FillItem].NodeData = LI.Text; NSession[FillItem].Type = "RecordingSession"; NSession[FillItem].DefaultStyle.Add("color","DarkBlue"); NSession[FillItem].ImageUrl = tv.TreeNodeTypes[2].ImageUrl; N.Nodes.Add(NSession[FillItem]); FillItem++; } foreach(Recording R in CurrentRecordings) { TreeNode N2 = new TreeNode(); N2.Text = R.DisplayName; N2.Type = "Recording"; N2.DefaultStyle.Add("color","Blue"); N2.NodeData = R.ID.ToString()+ ":" + CU.ID.ToString() + ":" + CurrentSection.ID.ToString(); N2.ImageUrl = tv.TreeNodeTypes[1].ImageUrl; if(R.SessionID != null) { for(int i = 0; i< SessionCount;i++) { string[] SID = NSession[i].NodeData.Split(':'); if(R.SessionID == SID[0]) { NSession[i].Nodes.Add(N2); } } } } foreach(Recording R in CurrentRecordings) { TreeNode N2 = new TreeNode(); N2.Text = R.DisplayName; if(!R.IsReady) { N2.Type = "Label"; N2.DefaultStyle.Add("color","Gray"); } else { N2.Type = "Recording"; N2.DefaultStyle.Add("color","Blue"); } N2.NodeData = R.ID.ToString()+ ":" + CU.ID.ToString() + ":" + CurrentSection.ID.ToString(); N2.ImageUrl = tv.TreeNodeTypes[1].ImageUrl; if(R.SessionID == "") { N.Nodes.Add(N2); } } L.Nodes.Add(N); } } } } SkipSections:{} } } if(L.Nodes.Count == 0) L.Text = "No Member Sections"; // Owned Sections foreach(Section CurrentSection in CU.AllOwnedSections) { if(CurrentSection.IsDefault == true) { bool CanView = false; foreach(Permission P in LUser.HighestAuthorityLevel.CanViewUnassignedRecordings) { CanView = true; } if((CanView == true)||(LUser.ID == UserId)) { Recordings CurrentRecordings = CurrentSection.CurrentRecordings; int SessionCount = 0; TreeNode[] NSession = new TreeNode[1]; ListBox LB = new ListBox(); string NData = ""; foreach(Recording R in CurrentRecordings) { NData = R.SessionID + ":" + CU.ID.ToString() +":" + CurrentSection.ID.ToString(); if(R.SessionID != "") { bool SkipThis = false; foreach(ListItem LI in LB.Items) { if(LI.Text == NData) { SkipThis = true; } } if(SkipThis == false) { SessionCount++; ListItem LI = new ListItem(NData,R.SessionName); LB.Items.Add(LI); } } } NSession = new TreeNode[SessionCount]; int FillItem = 0; foreach(ListItem LI in LB.Items) { NSession[FillItem] = new TreeNode(); NSession[FillItem].Text = LI.Value; NSession[FillItem].NodeData = LI.Text; NSession[FillItem].Type = "RecordingSession"; NSession[FillItem].DefaultStyle.Add("color","DarkBlue"); NSession[FillItem].ImageUrl = tv.TreeNodeTypes[2].ImageUrl; U.Nodes.Add(NSession[FillItem]); FillItem++; } foreach(Recording R in CurrentRecordings) { TreeNode N2 = new TreeNode(); N2.Text = R.DisplayName; N2.Type = "Recording"; N2.DefaultStyle.Add("color","Blue"); N2.NodeData = R.ID.ToString()+ ":" + CU.ID.ToString() + ":" + CurrentSection.ID.ToString(); N2.ImageUrl = tv.TreeNodeTypes[1].ImageUrl; if(R.SessionID != "") { for(int i = 0; i< SessionCount;i++) { string[] SID = NSession[i].NodeData.Split(':'); if(R.SessionID == SID[0]) { NSession[i].Nodes.Add(N2); } } } } foreach(Recording R in CurrentRecordings) { TreeNode N2 = new TreeNode(); N2.Text = R.DisplayName; if(!R.IsReady) { N2.Type = "Label"; N2.DefaultStyle.Add("color","Gray"); } else { N2.Type = "Recording"; N2.DefaultStyle.Add("color","Blue"); } N2.NodeData = R.ID.ToString()+ ":" + CU.ID.ToString() + ":" + CurrentSection.ID.ToString(); N2.ImageUrl = tv.TreeNodeTypes[1].ImageUrl; if(R.SessionID == "") { U.Nodes.Add(N2); } } if(U.Nodes.Count == 0) U.Text = "No Unassigned Recordings"; tv.Nodes[0].Nodes.Add(U); } } } //Groups OysterClassLibrary.Groups GPS = null; if(LUser.HighestAuthorityLevel.ID == OSystem.SectionTypeSysAdmin.ID) GPS = OSystem.GetALLGroups(false); else GPS = LUser.CurrentGroups; TreeNode NodeGroups = new TreeNode(); NodeGroups.Text = "Current Groups"; NodeGroups.DefaultStyle.Add("color","Green"); NodeGroups.Type = "labelGroup"; tv.Nodes[0].Nodes.Add(NodeGroups); TreeNode NPublic = new TreeNode(); TreeNode NPrivate = new TreeNode(); NPublic.Text = "Public Groups"; NPrivate.Text = "Private Groups"; NPublic.Type = "GroupName"; NPrivate.Type = "GroupName"; NPublic.DefaultStyle.Add("color","DarkBlue"); NPrivate.DefaultStyle.Add("color","DarkGreen"); NodeGroups.Nodes.Add(NPublic); NodeGroups.Nodes.Add(NPrivate); foreach(OysterClassLibrary.Group G in GPS) { TreeNode GNode = new TreeNode(); GNode.Text = G.Description; GNode.NodeData = G.ID.ToString(); if(G.IsPublicAccess) { GNode.DefaultStyle.Add("color","Blue"); NPublic.Nodes.Add(GNode); } else { GNode.DefaultStyle.Add("color","Green"); NPrivate.Nodes.Add(GNode); } if(G.CurrentRecordings.Count == 0) { TreeNode NoRecs = new TreeNode(); NoRecs.Text = "No available recordings"; NoRecs.DefaultStyle.Add("color","#696969"); GNode.Nodes.Add(NoRecs); } else //if(G.CurrentRecordings.Count > 0) { Recordings CurrentRecordings = G.CurrentRecordings; int SessionCount = 0; TreeNode[] NSession = new TreeNode[1]; ListBox LB = new ListBox(); string NData = ""; foreach(Recording R in CurrentRecordings) { NData = R.SessionID + ":" + CU.ID.ToString() +":0"; if(R.SessionID != "") { bool SkipThis = false; foreach(ListItem LI in LB.Items) { if(LI.Text == NData) { SkipThis = true; } } if(SkipThis == false) { SessionCount++; ListItem LI = new ListItem(NData,R.SessionName); LB.Items.Add(LI); } } } NSession = new TreeNode[SessionCount]; int FillItem = 0; foreach(ListItem LI in LB.Items) { NSession[FillItem] = new TreeNode(); NSession[FillItem].Text = LI.Value; NSession[FillItem].NodeData = LI.Text; NSession[FillItem].Type = "RecordingSession"; NSession[FillItem].DefaultStyle.Add("color","DarkBlue"); NSession[FillItem].ImageUrl = tv.TreeNodeTypes[2].ImageUrl; GNode.Nodes.Add(NSession[FillItem]); FillItem++; } foreach(Recording R in CurrentRecordings) { TreeNode N2 = new TreeNode(); N2.Text = R.DisplayName; N2.Type = "Recording"; N2.DefaultStyle.Add("color","Blue"); N2.NodeData = R.ID.ToString()+ ":" + CU.ID.ToString() + ":0"; N2.ImageUrl = tv.TreeNodeTypes[1].ImageUrl; if(R.SessionID != "") { for(int i = 0; i< SessionCount;i++) { string[] SID = NSession[i].NodeData.Split(':'); if(R.SessionID == SID[0]) { NSession[i].Nodes.Add(N2); } } } } foreach(Recording R in CurrentRecordings) { TreeNode N2 = new TreeNode(); N2.Text = R.DisplayName; if(!R.IsReady) { N2.Type = "Label"; N2.DefaultStyle.Add("color","Gray"); } else { N2.Type = "Recording"; N2.DefaultStyle.Add("color","Blue"); } N2.NodeData = R.ID.ToString()+ ":" + CU.ID.ToString() + ":0"; N2.ImageUrl = tv.TreeNodeTypes[1].ImageUrl; if(R.SessionID == "") { GNode.Nodes.Add(N2); } } //NodeGroups.Nodes.Add(GNode); } } if(NPublic.Nodes.Count == 0) { TreeNode NPNGroups = new TreeNode(); NPNGroups.Text = "No groups available"; NPNGroups.DefaultStyle.Add("color","#696969"); NPublic.Nodes.Add(NPNGroups); } if(NPrivate.Nodes.Count == 0) { TreeNode NPriGroups = new TreeNode(); NPriGroups.Text = "No groups available"; NPriGroups.DefaultStyle.Add("color","#696969"); NPrivate.Nodes.Add(NPriGroups); } }
private void cbUsers_SelectedIndexChanged(object sender, System.EventArgs e) { PostActivity(); CurrentUsersRecordings.Items.Clear(); //Variables used to get Video Information SelectedUser = (OysterClassLibrary.User)UserCollection[cbUsers.Text]; if(SelectedUser == null) return; OysterClassLibrary.Sections SS = SelectedUser.AllMemberSections; Msg("Loading " + SelectedUser.Description + "'s recordings... please wait"); MyGlobals.Logger.WriteLog("Loading " + SelectedUser.Description + "'s recordings"); tvVSS.BeginUpdate(); tvVSS.Nodes.Clear(); TreeNode URecordings = new TreeNode(); OysterClassLibrary.Functions F = new OysterClassLibrary.Functions(); foreach(OysterClassLibrary.Section CurrentSection in SS) { if (SelectedUser.ID != LUser.ID) { foreach(OysterClassLibrary.Section LoginUserSection in LUser.AllOwnedSections) { if (F.IsInMyHierarchy(LoginUserSection.ID,CurrentSection.ID)) { bool Addit = F.IsInMyHierarchy(LoginUserSection.ID,CurrentSection.ID); Recordings AR = CurrentSection.CurrentRecordings; if(Addit == true) { if((CurrentSection.IsDefault == false)&&(AR.Count > 0)) { TreeNode NodeX = tvVSS.Nodes.Add(CurrentSection.Description); NodeX.Tag = LUser.HighestAuthorityLevel; NodeX.ForeColor = System.Drawing.Color.DarkBlue; NodeX.ImageIndex = 6; NodeX.SelectedImageIndex = 6; ListView lvSessions = new ListView(); //foreach(OysterClassLibrary.Recording R in B.Recordings) foreach(OysterClassLibrary.Recording R in AR) { if(SelectedUser.ID == R.OwnerID) { if(R.SessionID != "") { foreach(ListViewItem LVI in lvSessions.Items) { if(LVI.Text == R.SessionName) goto SkipItem; } ListViewItem LCI = lvSessions.Items.Add(R.SessionName); LCI.Tag = R.SessionID; } } SkipItem:{} } TreeNode[] NodeSessions = new TreeNode[lvSessions.Items.Count]; int SessionCount = 0; foreach(ListViewItem LVI in lvSessions.Items) { NodeSessions[SessionCount] = NodeX.Nodes.Add(LVI.Text); NodeSessions[SessionCount].Tag = LVI.Tag; NodeSessions[SessionCount].ImageIndex = 2; NodeSessions[SessionCount].SelectedImageIndex = 2; SessionCount++; } //foreach(OysterClassLibrary.Recording DrawRecording in B.Recordings) foreach(OysterClassLibrary.Recording DrawRecording in AR) { // if(DrawRecording.DisplayName == null) // DrawRecording.DisplayName = DrawRecording.Created.ToString(); if(SelectedUser.ID == DrawRecording.OwnerID) { TreeNode NodeRecording = new TreeNode(); if(DrawRecording.SessionID == "") { NodeRecording = NodeX.Nodes.Add(DrawRecording.DisplayName); } else { for(int a=0; a < SessionCount;a++) { if(DrawRecording.SessionName == NodeSessions[a].Text) NodeRecording = NodeSessions[a].Nodes.Add(DrawRecording.DisplayName); } } //DrawRecording.Se = B.ID; ListViewItem LVI = CurrentUsersRecordings.Items.Add(DrawRecording.Description); LVI.Tag = DrawRecording; NodeRecording.Tag = DrawRecording; NodeRecording.ImageIndex = 3; NodeRecording.SelectedImageIndex = 3; NodeRecording.NodeFont = new Font("Arial",10,FontStyle.Regular); } } } } } } } else { foreach(OysterClassLibrary.Section B in SS) { OysterClassLibrary.Recordings AR = F.ALLRecordings(B.ID); if((B.IsDefault == false)&&(AR.Count > 0)) { TreeNode NodeX = tvVSS.Nodes.Add(B.Description); NodeX.Tag = LUser.HighestAuthorityLevel; NodeX.ForeColor = System.Drawing.Color.DarkBlue; NodeX.ImageIndex = 6; NodeX.SelectedImageIndex = 6; ListView lvSessions = new ListView(); //foreach(OysterClassLibrary.Recording R in B.Recordings) foreach(OysterClassLibrary.Recording R in AR) { if(SelectedUser.ID == R.OwnerID) { if(R.SessionID != "") { foreach(ListViewItem LVI in lvSessions.Items) { if(LVI.Text == R.SessionName) goto SkipItem; } ListViewItem LCI = lvSessions.Items.Add(R.SessionName); LCI.Tag = R.SessionID; } } SkipItem:{} } TreeNode[] NodeSessions = new TreeNode[lvSessions.Items.Count]; int SessionCount = 0; foreach(ListViewItem LVI in lvSessions.Items) { NodeSessions[SessionCount] = NodeX.Nodes.Add(LVI.Text); NodeSessions[SessionCount].Tag = LVI.Tag; NodeSessions[SessionCount].ImageIndex = 2; NodeSessions[SessionCount].SelectedImageIndex = 2; SessionCount++; } //foreach(OysterClassLibrary.Recording DrawRecording in B.Recordings) foreach(OysterClassLibrary.Recording DrawRecording in AR) { // if(DrawRecording.DisplayName == null) // DrawRecording.DisplayName = DrawRecording.Created.ToString(); if(SelectedUser.ID == DrawRecording.OwnerID) { TreeNode NodeRecording = new TreeNode(); if(DrawRecording.SessionID == "") { NodeRecording = NodeX.Nodes.Add(DrawRecording.DisplayName); } else { for(int a=0; a < SessionCount;a++) { if(DrawRecording.SessionName == NodeSessions[a].Text) NodeRecording = NodeSessions[a].Nodes.Add(DrawRecording.DisplayName); } } //DrawRecording.Se = B.ID; ListViewItem LVI = CurrentUsersRecordings.Items.Add(DrawRecording.Description); LVI.Tag = DrawRecording; NodeRecording.Tag = DrawRecording; NodeRecording.ImageIndex = 3; NodeRecording.SelectedImageIndex = 3; NodeRecording.NodeFont = new Font("Arial",10,FontStyle.Regular); } } } #region MovingCode // else if((B.IsDefault == true)&&(AR.Count > 0)) // { // TreeNode NodeX = new TreeNode(); // if(OSystem.SectionTypeSysAdmin.ID == LUser.HighestAuthorityLevel.ID) // { // NodeX = tvVSS.Nodes.Add("Recordings"); // // NodeX.Tag = OSystem.SectionTypeSysAdmin; // NodeX.Tag = LUser.HighestAuthorityLevel; // NodeX.ForeColor = System.Drawing.Color.DarkBlue; // NodeX.ImageIndex = 6; // NodeX.SelectedImageIndex = 6; // // } // else // { // NodeX = tvVSS.Nodes.Add("Unassigned Recordings"); // // NodeX.Tag = HighestSectionType; // NodeX.Tag = LUser.HighestAuthorityLevel; // NodeX.ForeColor = System.Drawing.Color.Brown; // NodeX.ImageIndex = 6; // NodeX.SelectedImageIndex = 6; // } // ListView lvSessions = new ListView(); // //foreach(OysterClassLibrary.Recording R in B.Recordings) // foreach(OysterClassLibrary.Recording R in AR) // { // if(SelectedUser.ID == R.OwnerID) // { // if(R.SessionID != "") // { // foreach(ListViewItem LVI in lvSessions.Items) // { // if(LVI.Text == R.SessionName) // goto SkipItem; // } // ListViewItem LCI = lvSessions.Items.Add(R.SessionName); // LCI.Tag = R.SessionID; // } // } // SkipItem:{} // } // TreeNode[] NodeSessions = new TreeNode[lvSessions.Items.Count]; // int SessionCount = 0; // foreach(ListViewItem LVI in lvSessions.Items) // { // NodeSessions[SessionCount] = NodeX.Nodes.Add(LVI.Text); // // NodeSessions[SessionCount].Tag = LVI.Tag; // NodeSessions[SessionCount].ImageIndex = 2; // NodeSessions[SessionCount].SelectedImageIndex = 2; // SessionCount++; // } // // //foreach(OysterClassLibrary.Recording DrawRecording in B.Recordings) // foreach(OysterClassLibrary.Recording DrawRecording in AR) // { // // // if(DrawRecording.DisplayName == null) // // DrawRecording.DisplayName = DrawRecording.Created.ToString(); // if(SelectedUser.ID == DrawRecording.OwnerID) // { // TreeNode NodeRecording = new TreeNode(); // if(DrawRecording.SessionID == "") // { // NodeRecording = NodeX.Nodes.Add(DrawRecording.DisplayName); // } // else // { // for(int a=0; a < SessionCount;a++) // { // if(DrawRecording.SessionName == NodeSessions[a].Text) // NodeRecording = NodeSessions[a].Nodes.Add(DrawRecording.DisplayName); // } // } // //DrawRecording.Se = B.ID; // ListViewItem LVI = CurrentUsersRecordings.Items.Add(DrawRecording.Description); // LVI.Tag = DrawRecording; // NodeRecording.Tag = DrawRecording; // NodeRecording.ImageIndex = 3; // NodeRecording.SelectedImageIndex = 3; // NodeRecording.NodeFont = new Font("Arial",10,FontStyle.Regular); // } // } // } #endregion } } } F.Dispose(); //Unassigned Recordings Section DefaultSection = null; if((LUser.ID == SelectedUser.ID)||(LUser.HighestAuthorityLevel.CanViewUnassignedRecordings.Count > 0)) DefaultSection = SelectedUser.DefaultSection; if(DefaultSection != null) { Recordings AR = DefaultSection.CurrentRecordings; if(AR.Count > 0) { TreeNode NodeX = new TreeNode(); if(OSystem.SectionTypeSysAdmin.ID == LUser.HighestAuthorityLevel.ID) { NodeX = tvVSS.Nodes.Add("Recordings"); // NodeX.Tag = OSystem.SectionTypeSysAdmin; NodeX.Tag = LUser.HighestAuthorityLevel; NodeX.ForeColor = System.Drawing.Color.DarkBlue; NodeX.ImageIndex = 6; NodeX.SelectedImageIndex = 6; } else { NodeX = tvVSS.Nodes.Add("Unassigned Recordings"); // NodeX.Tag = HighestSectionType; NodeX.Tag = LUser.HighestAuthorityLevel; NodeX.ForeColor = System.Drawing.Color.Brown; NodeX.ImageIndex = 6; NodeX.SelectedImageIndex = 6; } ListView lvSessions = new ListView(); //foreach(OysterClassLibrary.Recording R in B.Recordings) foreach(OysterClassLibrary.Recording R in AR) { if(SelectedUser.ID == R.OwnerID) { if(R.SessionID != "") { foreach(ListViewItem LVI in lvSessions.Items) { if(LVI.Text == R.SessionName) goto SkipItem; } ListViewItem LCI = lvSessions.Items.Add(R.SessionName); LCI.Tag = R.SessionID; } } SkipItem:{} } TreeNode[] NodeSessions = new TreeNode[lvSessions.Items.Count]; int SessionCount = 0; foreach(ListViewItem LVI in lvSessions.Items) { NodeSessions[SessionCount] = NodeX.Nodes.Add(LVI.Text); NodeSessions[SessionCount].Tag = LVI.Tag; NodeSessions[SessionCount].ImageIndex = 2; NodeSessions[SessionCount].SelectedImageIndex = 2; SessionCount++; } //foreach(OysterClassLibrary.Recording DrawRecording in B.Recordings) foreach(OysterClassLibrary.Recording DrawRecording in AR) { // if(DrawRecording.DisplayName == null) // DrawRecording.DisplayName = DrawRecording.Created.ToString(); if(SelectedUser.ID == DrawRecording.OwnerID) { TreeNode NodeRecording = new TreeNode(); if(DrawRecording.SessionID == "") { NodeRecording = NodeX.Nodes.Add(DrawRecording.DisplayName); } else { for(int a=0; a < SessionCount;a++) { if(DrawRecording.SessionName == NodeSessions[a].Text) NodeRecording = NodeSessions[a].Nodes.Add(DrawRecording.DisplayName); } } //DrawRecording.Se = B.ID; ListViewItem LVI = CurrentUsersRecordings.Items.Add(DrawRecording.Description); LVI.Tag = DrawRecording; NodeRecording.Tag = DrawRecording; NodeRecording.ImageIndex = 3; NodeRecording.SelectedImageIndex = 3; NodeRecording.NodeFont = new Font("Arial",10,FontStyle.Regular); } } } } Msg("Verifying recording availability. Please wait..."); HardCopy.DownloadInfo DI = new HardCopy.DownloadInfo(); DI.LV = CurrentUsersRecordings; DI.iLocalMBSAddress = 0; FDownload = new frmValidateRecordings(); FDownload.Tag = DI; if(IsLoading) FDownload.Opacity = 0; FDownload.ShowDialog(this); if(FDownload.DialogResult == DialogResult.OK) { } else MessageBox.Show("Returned failed!"); Msg("Recordings verified. Calculated total file sizes..."); DI =(HardCopy.DownloadInfo) FDownload.Tag; CurrentUsersRecordings = DI.LV; Total_File_SizeMH = DI.SizeOfAllFilesInBytes; CheckNodes(tvVSS.Nodes); tvVSS.EndUpdate(); //Total_File_SizeMH =1549035830; if(Total_File_SizeMH > 0) { lblSizeOnMediaHawk.Text = "Total File Size : " + ConvertByteToString(Total_File_SizeMH); } else { lblSizeOnMediaHawk.Text = "Total File Size : 0" + " Bytes"; } Msg(""); }