protected void ThrowOnInconsistentCommands(IInOutCommand command, IInOutImageCommand innerCommand) { var properties = command as ICreateOrMergePatchOrDeleteInOut; var innerProperties = innerCommand as ICreateOrMergePatchOrRemoveInOutImage; if (properties == null || innerProperties == null) { return; } if (innerProperties.InOutDocumentNumber == default(string)) { innerProperties.InOutDocumentNumber = properties.DocumentNumber; } else { var outerDocumentNumberName = "DocumentNumber"; var outerDocumentNumberValue = properties.DocumentNumber; var innerInOutDocumentNumberName = "InOutDocumentNumber"; var innerInOutDocumentNumberValue = innerProperties.InOutDocumentNumber; ThrowOnInconsistentIds(innerProperties, innerInOutDocumentNumberName, innerInOutDocumentNumberValue, outerDocumentNumberName, outerDocumentNumberValue); } }// END ThrowOnInconsistentCommands /////////////////////
}// END ThrowOnInconsistentCommands ///////////////////// protected virtual IInOutImageEvent Map(IInOutImageCommand c, IInOutCommand outerCommand, long version, IInOutState outerState) { var create = (c.CommandType == CommandType.Create) ? (c as ICreateInOutImage) : null; if (create != null) { return(MapCreate(create, outerCommand, version, outerState)); } var merge = (c.CommandType == CommandType.MergePatch || c.CommandType == null) ? (c as IMergePatchInOutImage) : null; if (merge != null) { return(MapMergePatch(merge, outerCommand, version, outerState)); } var remove = (c.CommandType == CommandType.Remove) ? (c as IRemoveInOutImage) : null; if (remove != null) { return(MapRemove(remove, outerCommand, version)); } throw new NotSupportedException(); }
public void Remove(IInOutImageCommand c) { _innerCommands.Remove(c); }
public void Add(IInOutImageCommand c) { _innerCommands.Add(c); }
void IInOutImageCommands.Remove(IInOutImageCommand c) { _innerCommands.Remove((CreateOrMergePatchOrRemoveInOutImageDto)c); }