コード例 #1
0
ファイル: ProxyGenerator.cs プロジェクト: mmooney/MMDB.UITest
		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;
				}
			}
		}
コード例 #2
0
ファイル: ProxyGenerator.cs プロジェクト: mmooney/MMDB.UITest
        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;
                }
            }
        }
コード例 #3
0
		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;
		}
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
		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;
		}