Esempio n. 1
0
        public ExecuteCommandLinkCatalogueItemToColumnInfo(IBasicActivateItems activator, ColumnInfoCombineable cmd, CatalogueItem catalogueItem) : base(activator)
        {
            _catalogueItem = catalogueItem;

            if (catalogueItem.ColumnInfo_ID != null)
            {
                SetImpossible("CatalogueItem " + catalogueItem + " is already associated with a different ColumnInfo");
            }

            if (cmd.ColumnInfos.Length > 1)
            {
                SetImpossible("Only one ColumnInfo can be associated with a CatalogueItem at a time");
                return;
            }

            _columnInfo = cmd.ColumnInfos[0];
        }
        public ExecuteCommandCreateNewPreLoadDiscardedColumn(IActivateItems activator, TableInfo tableInfo, ColumnInfoCombineable sourceColumnInfoCombineable) : this(activator, tableInfo)
        {
            _prototypes = sourceColumnInfoCombineable.ColumnInfos;

            var existing = tableInfo.PreLoadDiscardedColumns;

            foreach (ColumnInfo prototype in _prototypes)
            {
                var alreadyExists = existing.Any(c => c.GetRuntimeName().Equals(prototype.GetRuntimeName()));

                if (alreadyExists)
                {
                    SetImpossible("There is already a PreLoadDiscardedColumn called '" + prototype.GetRuntimeName() + "'");
                }
            }
        }
Esempio n. 3
0
 public ExecuteCommandAddNewCatalogueItem(IBasicActivateItems activator, Catalogue catalogue, ColumnInfoCombineable colInfo) : this(activator, catalogue, colInfo.ColumnInfos)
 {
 }