Exemplo n.º 1
0
		public Profile(string filePath = null)
		{
			if(filePath != null)
				_filePath = filePath.Trim();

			_items = new ProfileItemCollection(this);
		}
		public ProfileSection(string name, int lineNumber = -1) : base(lineNumber)
		{
			if(string.IsNullOrWhiteSpace(name))
				throw new ArgumentNullException("name");

			if(Zongsoft.Common.StringExtension.ContainsCharacters(name, "/*?"))
				throw new ArgumentException();

			_name = name.Trim();
			_items = new ProfileItemCollection(this);
		}
Exemplo n.º 3
0
            public Field(PropertyInfo info)
            {
                MethodInfo xmlconversion = typeof(Field <T>).GetMethod("ConvertToString");

                Name      = info.Name;
                FieldType = info.PropertyType;
                SqlType   = _TypeMaps[FieldType].SqlType;
                var param  = Expression.Parameter(typeof(T), "obj");
                var member = Expression.PropertyOrField(param, info.Name);
                var obj    = (!info.PropertyType.Name.Equals("XmlDocument")) ? Expression.Convert(member, typeof(object)) : Expression.Convert(member, typeof(object), xmlconversion);
                var lambda = Expression.Lambda <Func <T, object> >(obj, param);

                Accessor = lambda.Compile();
                Items    = new ProfileItemCollection();
            }