Example #1
0
 /// <summary>
 /// Invoke method support navigation.
 /// </summary>
 /// <param name="t"></param>
 /// <param name="obj"></param>
 /// <param name="e"></param>
 private static void InvokeMethod(Type t, object obj, NavBarLinkEventArgs e)
 {
     try
     {
         AppModule objModule = e.Link.Item.Tag as AppModule;
         if (objModule != null)
         {
             if (objModule.IsMethodInvoke)
             {
                 MethodInfo mi = FindMethod(t, objModule.MethodName, objModule.Parameter);
                 if (mi != null)
                 {
                     if (objModule.IsParameter)
                     {
                         mi.Invoke(obj, objModule.Parameter.Split(','));
                     }
                     else
                     {
                         mi.Invoke(obj, null);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #2
0
 /// <summary>
 /// Invoke method.
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="t"></param>
 /// <param name="module"></param>
 private static void InvokeMethod(object obj, Type t, AppModule module)
 {
     try
     {
         if (module.IsMethodInvoke)
         {
             MethodInfo mi = FindMethod(t, module.MethodName, module.Parameter);
             if (mi != null)
             {
                 if (module.IsParameter)
                 {
                     mi.Invoke(obj, module.Parameter.Split(','));
                 }
                 else
                 {
                     mi.Invoke(obj, null);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         XtraMessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }