Exemple #1
0
 public static void Set(String api, object value, object targetObj)
 {
     try
     {
         QuickReflection.Set(api, value, targetObj);
     }
     catch { }
 }
Exemple #2
0
 public static object Invoke(String api, object targetObj)
 {
     try
     {
         return(QuickReflection.Invoke(api, targetObj));
     }
     catch
     {
         return(null);
     }
 }
Exemple #3
0
        //获得一个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); }
        }
Exemple #4
0
 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 { }
 }
Exemple #5
0
 public object GetObject(string api)
 {
     return(QuickReflection.Invoke(api, comObject));
 }
Exemple #6
0
 // Utilities的方法返回值一定要为String[]
 public String[] AuthorAndContent(string api, String str)
 {
     return(new String[] { QuickReflection.Invoke(api, comObject) + ":" + Environment.NewLine + str });
 }