예제 #1
0
        //[Fx.Tag.SecurityNote(Critical = "Overrides critical inherited method")]
        //[SecurityCritical]
        ////[SuppressMessage(FxCop.Category.Security, FxCop.Rule.SecureGetObjectDataOverrides,
        //    //Justification = "Method is SecurityCritical")]
        //public override void GetObjectData(SerializationInfo info, StreamingContext context)
        //{
        //    base.GetObjectData(info, context);
        //    info.AddValue(InstanceKeyName, (InstanceKey != null && InstanceKey.IsValid) ? InstanceKey.Value : Guid.Empty, typeof(Guid));
        //}

        private static string ToMessage(InstanceKey instanceKey)
        {
            if (instanceKey != null && instanceKey.IsValid)
            {
                return(SR.KeyCompleteSpecific(instanceKey.Value));
            }
            return(SR.KeyCompleteDefault);
        }
        //[Fx.Tag.SecurityNote(Critical = "Overrides critical inherited method")]
        //[SecurityCritical]
        ////[SuppressMessage(FxCop.Category.Security, FxCop.Rule.SecureGetObjectDataOverrides,
        //    //Justification = "Method is SecurityCritical")]
        //public override void GetObjectData(SerializationInfo info, StreamingContext context)
        //{
        //    base.GetObjectData(info, context);
        //    info.AddValue(ConflictingInstanceIdName, ConflictingInstanceId, typeof(Guid));
        //    info.AddValue(InstanceKeyName, (InstanceKey != null && InstanceKey.IsValid) ? InstanceKey.Value : Guid.Empty, typeof(Guid));
        //}

        private static string ToMessage(Guid instanceId, InstanceKey instanceKey, Guid conflictingInstanceId)
        {
            if (instanceKey != null && instanceKey.IsValid)
            {
                if (instanceId != Guid.Empty && conflictingInstanceId != Guid.Empty)
                {
                    return(SR.KeyCollisionSpecific(instanceId, instanceKey.Value, conflictingInstanceId));
                }
                return(SR.KeyCollisionSpecificKeyOnly(instanceKey.Value));
            }
            return(SR.KeyCollisionDefault);
        }
예제 #3
0
 public InstanceKeyCompleteException(XName commandName, Guid instanceId, InstanceKey instanceKey, string message, Exception innerException)
     : base(commandName, instanceId, message, innerException)
 {
     InstanceKey = instanceKey;
 }
예제 #4
0
 public InstanceKeyCompleteException(XName commandName, InstanceKey instanceKey, Exception innerException)
     : this(commandName, Guid.Empty, instanceKey, ToMessage(instanceKey), innerException)
 {
 }
예제 #5
0
 public InstanceKeyCompleteException(XName commandName, InstanceKey instanceKey)
     : this(commandName, instanceKey, null)
 {
 }
 public InstanceKeyNotReadyException(XName commandName, InstanceKey instanceKey)
     : this(commandName, instanceKey, null)
 {
 }
 public InstanceKeyCollisionException(XName commandName, Guid instanceId, InstanceKey instanceKey, Guid conflictingInstanceId, string message, Exception innerException)
     : base(commandName, instanceId, message, innerException)
 {
     ConflictingInstanceId = conflictingInstanceId;
     InstanceKey           = instanceKey;
 }
 public InstanceKeyCollisionException(XName commandName, Guid instanceId, InstanceKey instanceKey, Guid conflictingInstanceId, Exception innerException)
     : this(commandName, instanceId, instanceKey, conflictingInstanceId, ToMessage(instanceId, instanceKey, conflictingInstanceId), innerException)
 {
 }
 public InstanceKeyCollisionException(XName commandName, Guid instanceId, InstanceKey instanceKey, Guid conflictingInstanceId)
     : this(commandName, instanceId, instanceKey, conflictingInstanceId, null)
 {
 }