public static void Register(Type type, RegisterCall registerCall) { // SetTweakPersistenceEntry sets the key for you in the current registry key. // We set a Netoffice default tweak and a custom tweak. SetTweakPersistenceEntry(type, "ShowTray", "yes", false); SetTweakPersistenceEntry(type, "NOConsoleMode", "trace", false); }
public static void Register(Type type, RegisterCall registerCall) { // SetTweakPersistenceEntry sets the key for you in the current registry key. // We set a custom tweak and a Netoffice default tweak. SetTweakPersistenceEntry(type, "ShowTray", "yes", false); SetTweakPersistenceEntry(type, "NOConsoleMode", "trace", false); }
public static void ShowUnRegister(Type type, RegisterCall registerCall, string from) { string text = String.Format("Type:{0}{2}RegisterCall:{0}{2}", type, registerCall, Environment.NewLine); if (_enabled) MessageBox.Show(text, "Unregister " + from); else Console.WriteLine("Unregister " + from + " :" + text); }
public static void ShowUnRegister(Type type, RegisterCall registerCall, InstallScope scope, OfficeUnRegisterKeyState keyState, string from) { string text = String.Format( "Register Type:{1}{0}Assembly Name:{2}{0}Assembly Version:{3}{0}RegisterCall:{4}{0}Scope:{5}{0}KeyState:{6}{0}", Environment.NewLine, type, type.Assembly.GetName().Name, type.Assembly.GetName().Version, registerCall, scope, keyState); if (_enabled) MessageBox.Show(text, "Unregister " + from); else Console.WriteLine("Unregister " + from + " :" + text); }
public static void ShowUnRegister(Type type, RegisterCall registerCall, string from) { string text = String.Format("Type:{0}{2}RegisterCall:{0}{2}", type, registerCall, Environment.NewLine); if (_enabled) { MessageBox.Show(text, "Unregister " + from); } else { Console.WriteLine("Unregister " + from + " :" + text); } }
/// <summary> /// Derived Register Call Helper /// </summary> /// <param name="registerMethod">the method to call</param> /// <param name="type">type for derived class</param> /// <param name="callType">kind of call, defined in Register attribute</param> /// <param name="scope">current register scope</param> /// <param name="keyState">office reg key state</param> /// <returns>true if no exception occurs, otherwise false</returns> public static bool CallDerivedRegisterMethod(MethodInfo registerMethod, Type type, RegisterCall callType, InstallScope scope, OfficeRegisterKeyState keyState) { try { ParameterInfo[] arguments = registerMethod.GetParameters(); int argumentsCount = arguments.Length; switch (argumentsCount) { case 0: registerMethod.Invoke(null, new object[0]); break; case 1: if (arguments[0].ParameterType.GUID == typeof(InstallScope).GUID) { registerMethod.Invoke(null, new object[] { scope }); } else if (arguments[0].ParameterType.GUID == typeof(RegisterCall).GUID) { registerMethod.Invoke(null, new object[] { callType }); } else { registerMethod.Invoke(null, new object[] { type }); } break; case 2: registerMethod.Invoke(null, new object[] { type, callType }); break; case 3: registerMethod.Invoke(null, new object[] { type, callType, scope }); break; case 4: registerMethod.Invoke(null, new object[] { type, callType, scope, keyState }); break; default: break; } return(true); } catch (Exception) { return(false); } }
private static void UnRegister(Type type, RegisterCall registerCall, InstallScope scope, OfficeRegisterKeyState keyState) { try { using (CdeclHandle libray = CdeclHandle.LoadLibrary <Addin>("Excel06AddinCS4.Shim.dll")) { SayHello hello = libray.GetDelegateForFunctionPointer <SayHello>("SayHelloToTheWorld"); hello("Unregister Excel06AddinCS4"); } } catch (Exception ex) { Office.Tools.Contribution.DialogUtils.ShowMessageBox(ex.ToString()); } }
public static void ShowUnRegister(Type type, RegisterCall registerCall, InstallScope scope, OfficeUnRegisterKeyState keyState, string from) { string text = String.Format( "Register Type:{1}{0}Assembly Name:{2}{0}Assembly Version:{3}{0}RegisterCall:{4}{0}Scope:{5}{0}KeyState:{6}{0}", Environment.NewLine, type, type.Assembly.GetName().Name, type.Assembly.GetName().Version, registerCall, scope, keyState); if (_enabled) { MessageBox.Show(text, "Unregister " + from); } else { Console.WriteLine("Unregister " + from + " :" + text); } }
private static void Register(Type type, RegisterCall registerCall, InstallScope scope, OfficeRegisterKeyState keyState) { try { // requires NetOffice 1.7.4.2+ using (CdeclHandle libray = CdeclHandle.LoadLibrary(typeof(Addin), "Excel06AddinCS4.Shim.dll")) { SayHello hello = libray.GetDelegateForFunctionPointer("SayHelloToTheWorld", typeof(SayHello)) as SayHello; hello("Excel06AddinCS4"); } } catch (Exception ex) { Office.Tools.Contribution.DialogUtils.ShowMessageBox(ex.ToString()); } }
public static void Register(Type type, RegisterCall registerCall) { switch (registerCall) { case RegisterCall.CallAfter: break; case RegisterCall.CallBefore: break; case RegisterCall.Replace: break; default: break; } }
public static void Register(Type type, RegisterCall registerCall) { SetTweakPersistenceEntry(type, "NOExceptionMessage", "TestMessage", false); SetTweakPersistenceEntry(type, "NOConsoleMode", "trace", false); SetTweakPersistenceEntry(type, "ShowMessageBoxAtStartUp", "yes", false); }
public static void UnRegister(Type type, RegisterCall registerCall) { switch (registerCall) { case RegisterCall.CallAfter: break; case RegisterCall.CallBefore: break; case RegisterCall.Replace: break; default: break; } }
public static void Register(Type type, RegisterCall registerCall) { SetTweakPersistenceEntry(type, "NOExceptionMessage", "Test09TweakCS", false); }
/// <summary> /// Derived Register Call Helper /// </summary> /// <param name="registerMethod">the method to call</param> /// <param name="type">type for derived class</param> /// <param name="callType">kind of call, defined in Register attribute</param> /// <param name="scope">current register scope</param> /// <param name="keyState">office reg key state</param> /// <returns>true if no exception occurs</returns> private static bool CallDerivedRegisterMethod(MethodInfo registerMethod, Type type, RegisterCall callType, InstallScope scope, OfficeRegisterKeyState keyState) { try { ParameterInfo[] arguments = registerMethod.GetParameters(); int argumentsCount = arguments.Length; switch (argumentsCount) { case 0: registerMethod.Invoke(null, new object[0]); break; case 1: if(arguments[0].ParameterType.GUID == typeof(InstallScope).GUID) registerMethod.Invoke(null, new object[] { scope }); else if (arguments[0].ParameterType.GUID == typeof(RegisterCall).GUID) registerMethod.Invoke(null, new object[] { callType }); else registerMethod.Invoke(null, new object[] { type }); break; case 2: registerMethod.Invoke(null, new object[] { type, callType }); break; case 3: registerMethod.Invoke(null, new object[] { type, callType, scope }); break; case 4: registerMethod.Invoke(null, new object[] { type, callType, scope, keyState }); break; default: break; } return true; } catch (Exception) { return true; } }
[UnRegisterFunction(RegisterMode.CallBeforeAndAfter)] // We want that NetOffice call this method before and after unregister private static void UnRegister(Type type, RegisterCall registerCall, InstallScope scope, OfficeUnRegisterKeyState keyState) { }
public static void Register(Type type, RegisterCall registerCall) { SetTweakPersistenceEntry(type, "NOExceptionMessage", "WordTweakCS", false); }
private static void UnRegister(Type type, RegisterCall registerCall, InstallScope scope, OfficeUnRegisterKeyState keyState) { MessageDialog.ShowUnRegister(type, registerCall, scope, keyState, "Excel"); }