Example #1
0
        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 /////////////////////
Example #2
0
        }// 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();
        }
Example #3
0
 public void Remove(IInOutImageCommand c)
 {
     _innerCommands.Remove(c);
 }
Example #4
0
 public void Add(IInOutImageCommand c)
 {
     _innerCommands.Add(c);
 }
Example #5
0
 void IInOutImageCommands.Remove(IInOutImageCommand c)
 {
     _innerCommands.Remove((CreateOrMergePatchOrRemoveInOutImageDto)c);
 }