Пример #1
0
 /// <summary>Constructs and Attaches a new StatusPair from the given errCode and errText.  Supports call chaining.</summary>
 public CarrierActionResult AttachStatus(ERRCODE errCode, String errText)
 {
     StatusList.Add(new StatusPair()
     {
         ErrCode = errCode, ErrText = errText
     }); return(this);
 }
Пример #2
0
        /// <summary>
        /// Throw a Contradiction.
        /// </summary>
        /// <param name="obj"></param>
        static public void Throw(ERRCODE err, object obj)
        {
            switch (err)
            {
            case ERRCODE.DIRECT:
                // Direct Contradiction
                // e.g. Apple is red VS Apple is blue
                //----------------------------------------
                Concept[] pairs = obj as Concept[];

                if ((object)pairs != null)
                {
                    // TODO
                }
                //----------------------------------------
                break;

            case ERRCODE.INHERITANCE:
                // Inheritance Contradiction
                // e.g. Foo is an apple VS Foo is blue
                //----------------------------------------
                pairs = obj as Concept[];

                if ((object)pairs != null)
                {
                    // TODO
                }
                //----------------------------------------
                break;

            case ERRCODE.RULE:
                // Rule Contradiction
                // e.g. VERB+NOUN=VP , VERB+NOUN=NOUN
                //----------------------------------------



                //----------------------------------------
                break;

            default:
                break;
            }
        }
Пример #3
0
 /// <summary>Sets the first CAACK to CAACK.RejectedInvalidState.  Attaches a StatusPair with the given errCode and errText.  Supports call chaining.</summary>
 public CarrierActionResult SetRejectedInvalidState(ERRCODE errCode, String errText)
 {
     SetFirstCAACK(CAACK.RejectedInvalidState); AttachStatus(errCode, errText); return(this);
 }
Пример #4
0
 /// <summary>Sets the first CAACK to CAACK.InvalidDataOrArgument.  Attaches a StatusPair with the given errCode and errText.  Supports call chaining.</summary>
 public CarrierActionResult SetInvalidDataOrArgument(ERRCODE errCode, String errText)
 {
     SetFirstCAACK(CAACK.InvalidDataOrArgument); AttachStatus(errCode, errText); return(this);
 }
Пример #5
0
 /// <summary>Sets the first CAACK to CAACK.CannotPerformNow.  Attaches a StatusPair with the given errCode and errText.  Supports call chaining.</summary>
 public CarrierActionResult SetCannotPerformNow(ERRCODE errCode, String errText)
 {
     SetFirstCAACK(CAACK.CannotPerformNow); AttachStatus(errCode, errText); return(this);
 }
Пример #6
0
 /// <summary>Sets the first CAACK to CAACK.InvalidCommand.  Attaches a StatusPair with the given errCode and errText.  Supports call chaining.</summary>
 public CarrierActionResult SetCommandInvalid(ERRCODE errCode, String errText)
 {
     SetFirstCAACK(CAACK.InvalidCommand); AttachStatus(errCode, errText); return(this);
 }
Пример #7
0
 /// <summary>Sets the first CAACK to CAACK.CommandPerformedWithErrors.  Attaches a StatusPair with the given errCode and errText.  Supports call chaining.</summary>
 public CarrierActionResult SetCommandFailed(ERRCODE errCode, String errText)
 {
     SetCommandFailed(); AttachStatus(errCode, errText); return(this);
 }
Пример #8
0
 /// <summary>Sets the first CAACK to CAACK.RejectedInvalidState.  Attaches a StatusPair with the given errCode and errText.  Supports call chaining.</summary>
 public CarrierActionResult SetRejectedInvalidState(ERRCODE errCode, String errText)
 {
     SetFirstCAACK(CAACK.RejectedInvalidState); AttachStatus(errCode, errText); return this;
 }
Пример #9
0
 /// <summary>Sets the first CAACK to CAACK.InvalidDataOrArgument.  Attaches a StatusPair with the given errCode and errText.  Supports call chaining.</summary>
 public CarrierActionResult SetInvalidDataOrArgument(ERRCODE errCode, String errText)
 {
     SetFirstCAACK(CAACK.InvalidDataOrArgument); AttachStatus(errCode, errText); return this;
 }
Пример #10
0
 /// <summary>Sets the first CAACK to CAACK.InvalidCommand.  Attaches a StatusPair with the given errCode and errText.  Supports call chaining.</summary>
 public CarrierActionResult SetCommandInvalid(ERRCODE errCode, String errText)
 {
     SetFirstCAACK(CAACK.InvalidCommand); AttachStatus(errCode, errText); return this;
 }
Пример #11
0
 /// <summary>Sets the first CAACK to CAACK.CommandPerformedWithErrors.  Attaches a StatusPair with the given errCode and errText.  Supports call chaining.</summary>
 public CarrierActionResult SetCommandFailed(ERRCODE errCode, String errText)
 {
     SetCommandFailed(); AttachStatus(errCode, errText); return this;
 }
Пример #12
0
 /// <summary>Sets the first CAACK to CAACK.CannotPerformNow.  Attaches a StatusPair with the given errCode and errText.  Supports call chaining.</summary>
 public CarrierActionResult SetCannotPerformNow(ERRCODE errCode, String errText)
 {
     SetFirstCAACK(CAACK.CannotPerformNow); AttachStatus(errCode, errText); return this;
 }
Пример #13
0
 /// <summary>Constructs and Attaches a new StatusPair from the given errCode and errText.  Supports call chaining.</summary>
 public CarrierActionResult AttachStatus(ERRCODE errCode, String errText)
 {
     StatusList.Add(new StatusPair() { ErrCode = errCode, ErrText = errText }); return this;
 }