public PgAttributesStyleVM(PgAtVM.PgAttributesVM attributeVM) { _attributeVM = attributeVM; _isDebug = attributeVM.IsDebug; _connect = attributeVM.Connect; _isReadOnly = attributeVM.IsReadOnly; _table = attributeVM.Table; _pkAttribute = attributeVM.AttributesListVM.PkAttribute; _style = new PgM.PgStyleObjectM(_table, _pkAttribute.Value); }
public PgAttributeFilesVM(PgAtVM.PgAttributesVM attributeVM) { _files = new MTObservableCollection <PgAtM.PgAttributeFileM>(); _filesSelected = new ObservableCollection <PgAtM.PgAttributeFileM>(); if (attributeVM.Table.FileInfo == null) { throw new ArgumentNullException("attributeVM.Table.FileInfo"); } _attributeVM = attributeVM; _isDebug = AttributeVM.IsDebug; _connect = attributeVM.Connect; _isReadOnly = attributeVM.IsReadOnly; }
/// <summary> /// Работы с атрибутами объекта /// </summary> /// <param name="table">Ссылка на таблицу</param> /// <param name="idObject">Идентификатор объекта с атрибутами. /// Если он null создается новый</param> /// <exception cref="ArgumentNullException"/> public PgAttributesListVM(PgAtVM.PgAttributesVM attributeVM, object idObject, bool loadStyle = true) { LoadStyle = loadStyle; _attributeVM = attributeVM; _isDebug = attributeVM.IsDebug; _connect = attributeVM.Connect; _isReadOnly = attributeVM.IsReadOnly; _table = attributeVM.Table; if (!String.IsNullOrEmpty(_table.GeomField)) { _geomAttribute = new PgAtM.PgAttributeM(this, (PgM.PgFieldM)_table.Fields.First(p => p.Name == _table.GeomField)); } _pkAttribute = new PgAtM.PgAttributeM(this, (PgM.PgFieldM)_table.PrimaryKeyField, idObject); if (idObject == null) { _isNew = true; } _attributes = new ObservableCollection <PgAtM.PgAttributeM>(); }