private static ComponentProperty ParseProperty(ComponentHeader CurrentComponent, LineReader Reader) { string Line = Reader.ReadLine().Trim(); int IndexDD = Line.IndexOf(':'); string PropertyName = Line.Substring(0, IndexDD).Trim(); string Arguments = Line.Substring(IndexDD + 1).Trim(); var ComponentArgs = ComponentArgument.Parse(Arguments); return(new ComponentProperty(CurrentComponent.Name, PropertyName, ComponentArgs.Single())); /*string Name = Line.Substring(0, IndexDD).Trim(); * string Remainder = Line.Substring(IndexDD + 1).Trim(); * int IndexArguments = Remainder.IndexOf('('); * string GeneratorName; * ComponentArgument[] Arguments; * if(IndexArguments == -1) { * Arguments = new ComponentArgument[] { new ComponentArgument(Remainder.Trim()) }; * GeneratorName = "Identity"; * } else { * GeneratorName = Remainder.Substring(0, IndexArguments).Trim(); * int CloseParen = GetMatchedBracketIndex(Remainder, IndexArguments); * string ArgumentText = Remainder.Substring(IndexArguments + 1, CloseParen - IndexArguments - 1).Trim(); * Arguments = ParseArguments(ArgumentText).ToArray(); * } * var Generator = GetGenerator(GeneratorName); * return new ComponentProperty(CurrentComponent.Name, Name, Generator, Arguments);*/ }
/*public ComponentProperty(string ComponentName, string PropertyName, PropertyValueGenerator ValueGenerator, ComponentArgument[] GeneratorArguments) { this._ComponentName = ComponentName; this._PropertyName = PropertyName; this._GeneratorArguments = GeneratorArguments; this._ValueGenerator = ValueGenerator; }*/ public ComponentProperty(string ComponentName, string PropertyName, ComponentArgument GeneratorArgument) { this._ComponentName = ComponentName; this._PropertyName = PropertyName; this._GeneratorArgument = GeneratorArgument; }
/*public ComponentProperty(string ComponentName, string PropertyName, PropertyValueGenerator ValueGenerator, ComponentArgument[] GeneratorArguments) { * this._ComponentName = ComponentName; * this._PropertyName = PropertyName; * this._GeneratorArguments = GeneratorArguments; * this._ValueGenerator = ValueGenerator; * }*/ public ComponentProperty(string ComponentName, string PropertyName, ComponentArgument GeneratorArgument) { this._ComponentName = ComponentName; this._PropertyName = PropertyName; this._GeneratorArgument = GeneratorArgument; }