Example #1
0
 /// <summary>
 /// Links to exists return values, where one is caused by another
 /// </summary>
 /// <param name="orignal"></param>
 /// <param name="handler"></param>
 public static ReturnValue ErrorHandlerFail(ReturnValue orignal, ReturnValue handler, string context ="")
 {
     handler.Inner = orignal;
     var fail = FailResult(string.Format("Error handler cascade failure: {0}",context));
     fail.Inner = handler;
     return fail;
 }
Example #2
0
 public static void AssertResult(ReturnValue result)
 {
     if (!result.Success)
     {
         Assert.Fail(result.ToString());
     }
 }
Example #3
0
 protected bool ShowStatus(ReturnValue result, string context)
 {
     if (!result.Success)
     {
         MessageBox.Show(result.ToString(), context,
             MessageBoxButtons.OK, MessageBoxIcon.Error);
         ShowStatus(string.Format("{0} failed.", context), Color.Red);
         Debug.WriteLine(result);
     }
     ShowStatus(string.Format("{0} complete.", context));
     return result.Success;
 }
Example #4
0
        public AbortException(ReturnValue caller)
            : this()
        {
            Caller = caller;

        }
Example #5
0
 public static void Abort(ReturnValue getResult)
 {
     throw new AbortException(getResult);
 }
Example #6
0
 /// <summary>
 /// creates an error chain and returns failure.
 /// </summary>
 /// <param name="inner">ReturnValue containing error information that is the cause of this failure</param>
 /// <returns></returns>
 public static ReturnValue Cascade(ReturnValue inner, string context = "")
 {
     var fail = FailResult(string.IsNullOrEmpty(context) ? "Cascade failure" : context);
     fail.Inner = inner;
     return fail;
 }
 private void AddResult(string imageKey, string key, string schema, string desc, ReturnValue<TableDiff> tdiffResult )
 {
     var groupKey = imageKey;
     if (imageKey == "dataschemadiff")
         groupKey = "datadiff";
     var li = new ListViewItem(new[] {key, schema, desc}, imageKey, Groups[groupKey])
     {
         Tag = tdiffResult
     };
     if (li.Group.Name != "error" && li.Group.Name != "equal")
     {
         li.Checked = true;
     }
     Items.Add(li);
 }