public static void Set(String api, object value, object targetObj) { try { QuickReflection.Set(api, value, targetObj); } catch { } }
public static object Invoke(String api, object targetObj) { try { return(QuickReflection.Invoke(api, targetObj)); } catch { return(null); } }
//获得一个Win32颜色的整型数值 public int Win32Color(string api) { int def = (int)double.Parse(QuickReflection.Invoke(api, comObject).ToString()); try { ColorDialog cd = new ColorDialog(); cd.Color = ColorTranslator.FromWin32(def); if (cd.ShowDialog() == DialogResult.OK) { return(ColorTranslator.ToWin32(cd.Color)); } return(def); } catch { return(def); } }
private void ContextHotkey_OnHotkey(int HotKeyID) { try { object obj = GetActiveObject(false); if (QuickConfig.ThisConfig.ContextMenuToogle) { var textObject = QuickReflection.Invoke(m_currentModel.Search, obj); if (textObject != null) { m_quickContextWindow.Show(textObject.ToString()); QuickVitality.UpdateVitality("context", m_currentModel.ProgramName, textObject.ToString()); } } } catch { } }
public object GetObject(string api) { return(QuickReflection.Invoke(api, comObject)); }
// Utilities的方法返回值一定要为String[] public String[] AuthorAndContent(string api, String str) { return(new String[] { QuickReflection.Invoke(api, comObject) + ":" + Environment.NewLine + str }); }