Esempio n. 1
0
        public ICommand ChangeMetaData(IEnumerable <DataRepository> observedData, MetaDataChanged metaDataChanged)
        {
            var macroCommand = new OSPSuiteMacroCommand <IOSPSuiteExecutionContext>
            {
                CommandType = Command.CommandTypeEdit,
                ObjectType  = ObjectTypes.ObservedData,
                Description = Command.MetaDataModifiedInDataRepositories
            };

            observedData.Each(x => macroCommand.Add(new ChangeObservedDataMetaDataCommand(x, metaDataChanged).Run(_executionContext)));
            return(macroCommand);
        }
Esempio n. 2
0
        public ICommand RemoveMetaData(IEnumerable <DataRepository> observedData, MetaDataKeyValue metaDataKeyValue)
        {
            var macroCommand = new OSPSuiteMacroCommand <IOSPSuiteExecutionContext>
            {
                CommandType = Command.CommandTypeDelete,
                ObjectType  = ObjectTypes.ObservedData,
                Description = Command.MetaDataRemovedFromDataRepositories
            };

            observedData.Each(x => macroCommand.Add(new RemoveObservedDataMetaDataCommand(x, metaDataKeyValue).Run(_executionContext)));
            return(macroCommand);
        }
        private bool deleteAll(IEnumerable <DataRepository> observedDataToDelete)
        {
            var macoCommand = new OSPSuiteMacroCommand <IOSPSuiteExecutionContext>
            {
                CommandType = Command.CommandTypeDelete,
                ObjectType  = ObjectTypes.ObservedData,
                Description = Command.ObservedDataDeletedFromProject,
            };

            observedDataToDelete.Each(x => macoCommand.Add(new RemoveObservedDataFromProjectCommand(x)));
            _executionContext.AddToHistory(macoCommand.Run(_executionContext));
            return(true);
        }
Esempio n. 4
0
        public ICommand UpdateMolWeight(IEnumerable <DataRepository> allDataRepositories, double oldMolWeightValue, double newMolWeightValue)
        {
            if (ValueComparer.AreValuesEqual(oldMolWeightValue, newMolWeightValue))
            {
                return(new OSPSuiteEmptyCommand <IOSPSuiteExecutionContext>());
            }

            var macroCommand = new OSPSuiteMacroCommand <IOSPSuiteExecutionContext>
            {
                CommandType = Command.CommandTypeEdit,
                ObjectType  = ObjectTypes.ObservedData,
                Description = Command.MolecularWeightModifiedInDataRepositories
            };

            allDataRepositories.Each(x => macroCommand.Add(new UpdateObservedDataMolWeightCommand(x, _molWeightDimension, oldMolWeightValue, newMolWeightValue).Run(_executionContext)));
            return(macroCommand);
        }