private static void PopulateMasterPageObject(SourceMasterPage pageObject, CSClass classObject) { pageObject.ClassFullName = classObject.ClassFullName; foreach (var fieldObject in classObject.FieldList) { switch(fieldObject.TypeFullName) { case "System.Web.UI.WebControls.ContentPlaceHolder": pageObject.ContentHolderIDs.Add(fieldObject.FieldName); break; } } PopulateWebPageObject(pageObject, classObject); }
private static void PopulateMasterPageObject(SourceMasterPage pageObject, CSClass classObject) { pageObject.ClassFullName = classObject.ClassFullName; foreach (var fieldObject in classObject.FieldList) { switch (fieldObject.TypeFullName) { case "System.Web.UI.WebControls.ContentPlaceHolder": pageObject.ContentHolderIDs.Add(fieldObject.FieldName); break; } } PopulateWebPageObject(pageObject, classObject); }
public SourceWebProject LoadFromProjectFile(CSProjectFile csProject, string projectFilePath) { SourceWebProject returnValue = new SourceWebProject() { RootNamespace = csProject.RootNamespace }; var webPageList = csProject.WebFormContainers.Where(i => i.ContainerType == EnumWebFormContainerType.WebPage); foreach (var webPage in webPageList) { var csClass = csProject.ClassList.SingleOrDefault(i => i.ClassFullName == webPage.ClassFullName); if (csClass != null) { SourceWebPage sourceWebPage = new SourceWebPage() { ClassFullName = webPage.ClassFullName, PageUrl = ConvertToUrl(webPage.FilePath, projectFilePath), Controls = LoadControls(webPage, csClass) }; returnValue.WebPageList.Add(sourceWebPage); } } var masterPageList = csProject.WebFormContainers.Where(i => i.ContainerType == EnumWebFormContainerType.MasterPage); foreach (var masterPage in masterPageList) { SourceMasterPage sourceMasterPage = new SourceMasterPage() { ClassFullName = masterPage.ClassFullName, PageUrl = ConvertToUrl(masterPage.FilePath, projectFilePath) }; returnValue.MasterPageList.Add(sourceMasterPage); } var userControlList = csProject.WebFormContainers.Where(i => i.ContainerType == EnumWebFormContainerType.UserControl); foreach (var userControl in userControlList) { var csClass = csProject.ClassList.SingleOrDefault(i => i.ClassFullName == userControl.ClassFullName); SourceUserControl sourceUserControl = new SourceUserControl() { ClassFullName = userControl.ClassFullName, Controls = LoadControls(userControl, csClass) }; returnValue.UserControlList.Add(sourceUserControl); } return(returnValue); }
public SourceWebProject LoadFromProjectFile(CSProjectFile csProject, string projectFilePath) { SourceWebProject returnValue = new SourceWebProject() { RootNamespace = csProject.RootNamespace }; var webPageList = csProject.WebFormContainers.Where(i => i.ContainerType == EnumWebFormContainerType.WebPage); foreach (var webPage in webPageList) { var csClass = csProject.ClassList.SingleOrDefault(i => i.ClassFullName == webPage.ClassFullName); if (csClass != null) { SourceWebPage sourceWebPage = new SourceWebPage() { ClassFullName = webPage.ClassFullName, PageUrl = ConvertToUrl(webPage.FilePath, projectFilePath), Controls = LoadControls(webPage, csClass) }; returnValue.WebPageList.Add(sourceWebPage); } } var masterPageList = csProject.WebFormContainers.Where(i => i.ContainerType == EnumWebFormContainerType.MasterPage); foreach (var masterPage in masterPageList) { SourceMasterPage sourceMasterPage = new SourceMasterPage() { ClassFullName = masterPage.ClassFullName, PageUrl = ConvertToUrl(masterPage.FilePath, projectFilePath) }; returnValue.MasterPageList.Add(sourceMasterPage); } var userControlList = csProject.WebFormContainers.Where(i => i.ContainerType == EnumWebFormContainerType.UserControl); foreach (var userControl in userControlList) { var csClass = csProject.ClassList.SingleOrDefault(i => i.ClassFullName == userControl.ClassFullName); SourceUserControl sourceUserControl = new SourceUserControl() { ClassFullName = userControl.ClassFullName, Controls = LoadControls(userControl, csClass) }; returnValue.UserControlList.Add(sourceUserControl); } return returnValue; }