public override object EXECUTE(params object[] po) { object obj = echo(po); try { string rpt = obj.GetType().Name.ToLower(); if (rpt.EndsWith("[]")) { obj = print(MiMFa_Convert.ToArray(obj)); } else if (obj is IList) { obj = print(MiMFa_Convert.ToList(obj).ToArray()); } else if (obj is IDictionary) { obj = print(MiMFa_Convert.ToDictionary(obj)); } else if (rpt.EndsWith("collection")) { obj = print(MiMFa_Convert.ToArray(obj).ToArray()); } else { obj = print(obj); } } catch { obj = print(obj); } return(obj); }
public virtual object TryDone(object obj) { if (obj == null) { return(""); } Type t = obj.GetType(); string tn = t.Name.ToLower(); if (AllowDictionary && (t is IDictionary || tn.StartsWith("dictionary") || tn.StartsWith("mimfa_dictionary"))) { return(Done(MiMFa_Convert.ToDictionary(obj))); } if (AllowDictionary && (tn.StartsWith("mimfa_matrix"))) { return(Done(MiMFa_Convert.ToMiMFaMatrix(obj))); } if (AllowKeyValuePair && tn.StartsWith("keyvaluepair")) { return(Done(MiMFa_Convert.ToKeyValuePair(obj))); } if (AllowList && (t is IList || tn.StartsWith("list") || tn.StartsWith("mimfa_list"))) { return(Done(MiMFa_Convert.ToList(obj))); } if (AllowByte && AllowArray && t == typeof(byte[])) { return(Done((byte[])obj)); } if (AllowArray && tn.EndsWith("[]")) { return(Done(MiMFa_Convert.ToArray(obj))); } if (AllowCollection && t is ICollection) { return(Done(MiMFa_Convert.ToArray(obj))); } if (AllowStack && tn.StartsWith("stack")) { return(Done(MiMFa_Convert.ToStack(obj))); } if (AllowStack && tn.StartsWith("queue")) { return(Done(MiMFa_Convert.ToQueue(obj))); } if (AllowDataTable && tn.StartsWith("datatable")) { return(Done((DataTable)obj)); } if (AllowDataRow && tn.StartsWith("datarow")) { return(Done((DataRow)obj)); } if (AllowEnum && obj is Enum) { return(Done(obj + "")); } if (AllowBitmap && obj is Bitmap) { return(Done((Bitmap)obj)); } if (AllowUri && obj is Uri) { return(Done((Uri)obj)); } if (AllowEventPack && obj is EventPack) { return(Done((EventPack)obj)); } if (AllowByte && obj is byte) { return(Done((byte)obj)); } if (AllowString && obj is String) { return(Done(obj + "")); } if (double.NaN.Equals(obj)) { return("NaN"); } if (t == typeof(Int64) || t == typeof(long)) { return(Done(Convert.ToInt64(obj))); } if (t == typeof(UInt64) || t == typeof(Double)) { return(Done(Convert.ToDouble(obj))); } return(Normalization(obj)); }
public virtual object TrySearch(object inObj, bool showAll, bool highlight, params object[] theseObjects) { if (showAll && !highlight) { return(inObj); } if (inObj == null) { return(""); } Type t = inObj.GetType(); string tn = t.Name.ToLower(); try { if (AllowDictionary && (t is IDictionary || tn.StartsWith("dictionary") || tn.StartsWith("mimfa_dictionary"))) { return(Search(MiMFa_Convert.ToDictionary(inObj), showAll, highlight, theseObjects)); } if (AllowKeyValuePair && tn.StartsWith("keyvaluepair")) { return(Search(MiMFa_Convert.ToKeyValuePair(inObj), showAll, highlight, theseObjects)); } if (AllowList && (t is IList || tn.StartsWith("list") || tn.StartsWith("mimfa_list"))) { return(Search(MiMFa_Convert.ToList(inObj), showAll, highlight, theseObjects)); } if (AllowArray && tn.EndsWith("[]")) { return(Search(MiMFa_Convert.ToArray(inObj), showAll, highlight, theseObjects)); } if (AllowCollection && t is ICollection) { return(Search(MiMFa_Convert.ToArray(inObj), showAll, highlight, theseObjects)); } if (AllowStack && tn.StartsWith("stack")) { return(Search(MiMFa_Convert.ToStack(inObj), showAll, highlight, theseObjects)); } if (AllowDataTable && tn.StartsWith("datatable")) { return(Search((DataTable)inObj, showAll, highlight, theseObjects)); } if (AllowDataRow && tn.StartsWith("datarow")) { return(Search((DataRow)inObj, showAll, highlight, theseObjects)); } if (AllowEnum && inObj is Enum) { return(Search(inObj + "", showAll, highlight, theseObjects)); } if (AllowUri && inObj is Uri) { return(Search((Uri)inObj, showAll, highlight, theseObjects)); } if (AllowString && inObj is String) { return(Search(inObj + "", showAll, highlight, theseObjects)); } object o = null; foreach (var item in theseObjects) { if (o == null) { o = Find(inObj, highlight, theseObjects); } else { return(o); } } } catch { } return((showAll) ? inObj : null); }
public virtual dynamic TryDone(dynamic obj) { if (obj == null) { return(obj); } Type t = obj.GetType(); string tn = t.Name.ToLower(); try { if ((t is IDictionary || tn.StartsWith("dictionary") || tn.StartsWith("mimfa_dictionary"))) { return(Done(MiMFa_Convert.ToDictionary(obj))); } if (tn.StartsWith("keyvaluepair")) { return(Done(MiMFa_Convert.ToKeyValuePair(obj))); } if (t is IList || tn.StartsWith("list") || tn.StartsWith("mimfa_list")) { return(Done(MiMFa_Convert.ToList(obj))); } if (tn.EndsWith("[]")) { return(Done(MiMFa_Convert.ToArray(obj))); } if (t is ICollection) { return(Done(MiMFa_Convert.ToArray(obj))); } if (tn.StartsWith("datatable")) { return(Done((DataTable)obj)); } if (tn.StartsWith("datarow")) { return(Done((DataRow)obj)); } if (obj is Enum) { return(Done(obj.ToString())); } if (obj is EventPack) { return(Done((EventPack)obj)); } if (obj is String) { return(Done(obj.ToString())); } if (obj is TextBox) { return(Done((TextBox)obj)); } if (obj is RichTextBox) { return(Done((RichTextBox)obj)); } if (obj is TabPage) { return(Done((TabPage)obj)); } if (obj is TabControl) { return(Done((TabControl)obj)); } if (obj is ToolStripDropDownButton) { return(Done((ToolStripDropDownButton)obj)); } if (obj is ToolStripDropDown) { return(Done((ToolStripDropDown)obj)); } if (obj is ToolStripComboBox) { return(Done((ToolStripComboBox)obj)); } if (obj is ToolStripButton) { return(Done((ToolStripButton)obj)); } if (obj is ToolStripItem) { return(Done((ToolStripItem)obj)); } if (obj is ContextMenu) { return(Done((ContextMenu)obj)); } if (obj is ContextMenuStrip) { return(Done((ContextMenuStrip)obj)); } if (obj is ToolStrip) { return(Done((ToolStrip)obj)); } if (obj is MenuStrip) { return(Done((MenuStrip)obj)); } if (obj is Menu) { return(Done((Menu)obj)); } if (obj is ComboBox) { return(Done((ComboBox)obj)); } if (obj is DataGridView) { return(Done((DataGridView)obj)); } if (obj is Chart) { return(Done((Chart)obj)); } if (obj is Control) { return(Done((Control)obj)); } } catch { } return(obj); }