private static void PopulateWebPageObject(SourceWebPage pageObject, CSClass classObject) { pageObject.ClassFullName = classObject.ClassFullName; foreach (var fieldObject in classObject.FieldList) { switch (fieldObject.TypeFullName) { case "System.Web.UI.WebControls.Literal": { var control = new LiteralControl { FieldName = fieldObject.FieldName, ClassName = fieldObject.TypeName, NamespaceName = fieldObject.TypeNamespace }; pageObject.Controls.Add(control); } break; default: { var control = new SourceWebControl() { FieldName = fieldObject.FieldName, ClassName = fieldObject.TypeName, NamespaceName = fieldObject.TypeNamespace }; pageObject.Controls.Add(control); } break; } } }
private List<SourceWebControl> LoadControls(WebFormContainer webPage, CSClass csClass) { List<SourceWebControl> returnList = new List<SourceWebControl>(); foreach(var serverControl in webPage.Controls) { var classField = csClass.FieldList.SingleOrDefault(i=>i.FieldName == serverControl.ControlID); if(classField != null) { SourceWebControl sourceWebControl = new SourceWebControl { ClassFullName = classField.TypeFullName, FieldName = (serverControl.Prefix??string.Empty) + classField.FieldName }; returnList.Add(sourceWebControl); } } return returnList; }
private List <SourceWebControl> LoadControls(WebFormContainer webPage, CSClass csClass) { List <SourceWebControl> returnList = new List <SourceWebControl>(); foreach (var serverControl in webPage.Controls) { var classField = csClass.FieldList.SingleOrDefault(i => i.FieldName == serverControl.ControlID); if (classField != null) { SourceWebControl sourceWebControl = new SourceWebControl { ClassFullName = classField.TypeFullName, FieldName = (serverControl.Prefix ?? string.Empty) + classField.FieldName }; returnList.Add(sourceWebControl); } } return(returnList); }
private static EnumTargetControlType GetTargetControlType(SourceWebControl sourceControl) { EnumTargetControlType targetControlType; if (sourceControl.ClassFullName == typeof(System.Web.UI.WebControls.HyperLink).FullName) { targetControlType = EnumTargetControlType.Link; } else if (sourceControl.ClassFullName == typeof(System.Web.UI.WebControls.Label).FullName) { targetControlType = EnumTargetControlType.Label; } else if (sourceControl.ClassFullName == typeof(System.Web.UI.WebControls.TextBox).FullName) { targetControlType = EnumTargetControlType.TextBox; } else { targetControlType = EnumTargetControlType.Unknown; } return(targetControlType); }
private static EnumTargetControlType GetTargetControlType(SourceWebControl sourceControl) { EnumTargetControlType targetControlType; if (sourceControl.ClassFullName == typeof(System.Web.UI.WebControls.HyperLink).FullName) { targetControlType = EnumTargetControlType.Link; } else if (sourceControl.ClassFullName == typeof(System.Web.UI.WebControls.Label).FullName) { targetControlType = EnumTargetControlType.Label; } else if (sourceControl.ClassFullName == typeof(System.Web.UI.WebControls.TextBox).FullName) { targetControlType = EnumTargetControlType.TextBox; } else { targetControlType = EnumTargetControlType.Unknown; } return targetControlType; }