private void AddSelectedNodes(TreeNodeCollection nodes) { foreach (TreeNode tnode in nodes) { if (tnode.Checked) { Type t = tnode.Tag.GetType(); if (tnode.Tag.GetType() == typeof(SharePointWeb)) { SharePointExportObject exportObject = new SharePointExportObject(); exportObject.Id = ((SharePointWeb)tnode.Tag).ID.ToString(); exportObject.Url = ((SharePointWeb)tnode.Tag).Url; exportObject.Type = "Web"; // Microsoft.SharePoint.Deployment.SPDeploymentObjectType.Web; exportSettings.ExportObjects.Add(exportObject); } else if (tnode.Tag.GetType() == typeof(SharePointList)) { SharePointExportObject exportObject = new SharePointExportObject(); exportObject.Id = ((SharePointList)tnode.Tag).ID.ToString(); exportObject.Type = "List"; // Microsoft.SharePoint.Deployment.SPDeploymentObjectType.List; exportSettings.ExportObjects.Add(exportObject); } else if (tnode.Tag.GetType() == typeof(SharePointItem)) { SharePointExportObject exportObject = new SharePointExportObject(); exportObject.Id = ((SharePointItem)tnode.Tag).ID.ToString(); exportObject.Type = "ListItem"; // Microsoft.SharePoint.Deployment.SPDeploymentObjectType.ListItem; exportSettings.ExportObjects.Add(exportObject); } } AddSelectedNodes(tnode.Nodes); } }
private void AddSelectedNodes(TreeNodeCollection nodes) { foreach (TreeNode tnode in nodes) { if (tnode.Checked) { Type t = tnode.Tag.GetType(); if (tnode.Tag.GetType() == typeof(SharePointWeb)) { SharePointExportObject exportObject = new SharePointExportObject(); exportObject.Id = ((SharePointWeb)tnode.Tag).ID.ToString(); exportObject.Url = ((SharePointWeb)tnode.Tag).Url; exportObject.Type = "Web"; // Microsoft.SharePoint.Deployment.SPDeploymentObjectType.Web; exportSettings.ExportObjects.Add(exportObject); } else if (tnode.Tag.GetType() == typeof(SharePointList)) { SharePointExportObject exportObject = new SharePointExportObject(); exportObject.Id = ((SharePointList)tnode.Tag).ID.ToString(); exportObject.Type = "List"; // Microsoft.SharePoint.Deployment.SPDeploymentObjectType.List; exportSettings.ExportObjects.Add(exportObject); } else if (tnode.Tag.GetType() == typeof(SharePointItem)) { SharePointExportObject exportObject = new SharePointExportObject(); exportObject.Id = ((SharePointItem)tnode.Tag).ID.ToString(); exportObject.Type = "ListItem"; // Microsoft.SharePoint.Deployment.SPDeploymentObjectType.ListItem; exportSettings.ExportObjects.Add(exportObject); } } AddSelectedNodes(tnode.Nodes); } }