Пример #1
0
		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);
		}
Пример #2
0
 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);
 }
Пример #3
0
        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);
        }
Пример #4
0
		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;
		}