public void SetPropertyName(string propertyName) { this.ResetParameters(); this.PropertyName = propertyName; if (!string.IsNullOrEmpty(this.PropertyName)) { if (!object.ReferenceEquals(this.TargetType, null)) { this.PropertyType = ReflectionUtils.GetPropertyType(this.TargetType, this.PropertyName); if (this.TargetType.IsSubclassOf(typeof(Object)) && !object.ReferenceEquals(this.PropertyType, null)) { this.ObjectParameter.ObjectType = this.PropertyType; } else { if (this.PropertyType.get_IsArray()) { this.ArrayParameter.ElementType = SkillVar.GetVariableType(this.PropertyType.GetElementType()); } } } } else { this.PropertyType = null; } this.Init(); }
public SkillVar(Type type) { this.type = SkillVar.GetVariableType(type); if (type.get_IsEnum()) { this.EnumType = type; return; } if (type.get_IsArray()) { Type elementType = type.GetElementType(); this.arrayValue = new SkillArray { ElementType = SkillVar.GetVariableType(elementType) }; if (elementType.get_IsEnum() || typeof(Object).IsAssignableFrom(elementType)) { this.arrayValue.ObjectType = elementType; return; } } else { if (type.IsSubclassOf(typeof(Object))) { this.ObjectType = type; } } }