public void TryToEmulateCommandHandler(object s, EmulateCommandEventArgs e) { if (Type == PluginType.StandartPlugin) { try { TryToEmulateCommand.Invoke(this, e); } catch { } } }
private void TryEmulatingCommand(object sender, EmulateCommandEventArgs e) { try { bool isAuthorised = false; Plugin receiver = null; Plugin senderPlugin = sender as Plugin; foreach (var plugin in mPluginHandler.Plugins) { string pathToXls = plugin.PluginGrammarTreePath; if (RadTreeViewGrammarManager.MatchGrammarToPlugin(pathToXls, e.Command)) { receiver = plugin; } } if (receiver == null) { //throw new NullReferenceException(); } if (Mode == OperatingMode.OnlineNormal) { isAuthorised = checkPluginControlAuthorisation(senderPlugin, receiver); } else { isAuthorised = true; } if (isAuthorised) { try { commandToEmulate = "Melissa " + e.Command; StopAsyncRecognition(); } catch (Exception ex) { CrashReporter.Report(ex); } } } finally { // } }