Inheritance: System.EventArgs
コード例 #1
0
ファイル: Plugin.cs プロジェクト: ModernSteward/ModernSteward
 public void TryToEmulateCommandHandler(object s, EmulateCommandEventArgs e)
 {
     if (Type == PluginType.StandartPlugin)
     {
         try
         {
             TryToEmulateCommand.Invoke(this, e);
         }
         catch { }
     }
 }
コード例 #2
0
ファイル: Core.cs プロジェクト: ModernSteward/ModernSteward
        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
            {
                //
            }
        }