Beispiel #1
0
        internal void Initialize(Model parentModel, Type declaringType, string name, ColumnKind kind, Action <Column> initializer)
        {
            if (Kind != ColumnKind.None)
            {
                throw new InvalidOperationException(DiagnosticMessages.Column_AlreadyInitialized);
            }

            Debug.Assert(parentModel != null);
            ConstructModelMember(parentModel, declaringType, name);
            Kind = kind;
            if (OriginalDeclaringType == null)
            {
                OriginalDeclaringType = DeclaringType;
            }
            if (string.IsNullOrEmpty(OriginalName))
            {
                OriginalName = name;
            }

            _initializer = initializer;
            Index        = ParentModel.Add(this);

            _initializer?.Invoke(this);
        }