コード例 #1
0
        public override void Initialize()
        {
            CurrentSession.AddInsLoadCompleted += (sender, e) =>
            {
                CurrentSession.AddInManager.GetAddIn<ConsoleAddIn>().RegisterContext<DLRContext>();
                ReloadScripts((fileName, ex) =>
                {
                    CurrentSession.Logger.Information("Script Executed: " + fileName);
                    if (ex != null)
                    {
                        CurrentSession.Logger.Error(ex.ToString());
                        if (ex is SyntaxErrorException)
                        {
                            SyntaxErrorException syntaxEx = ex as SyntaxErrorException;
                            CurrentSession.Logger.Error(String.Format("  行: {0}, 列 {1}, ファイル: {2}", syntaxEx.Line, syntaxEx.Column, syntaxEx.SourcePath));
                        }
                    }
                });
            };

            // DLRのイベントをすべて解除するためにこのアドイン用のRealProxyを取得する
            _sessionProxy = new EventManagedProxy<Session>(CurrentSession);
            _serverProxy = new EventManagedProxy<Server>(CurrentServer);
        }
コード例 #2
0
        public override void Initialize()
        {
            CurrentSession.AddInsLoadCompleted += (sender, e) =>
            {
                CurrentSession.AddInManager.GetAddIn <ConsoleAddIn>().RegisterContext <DLRContext>();
                ReloadScripts((fileName, ex) =>
                {
                    CurrentSession.Logger.Information("Script Executed: " + fileName);
                    if (ex != null)
                    {
                        CurrentSession.Logger.Error(ex.ToString());
                        if (ex is SyntaxErrorException)
                        {
                            SyntaxErrorException syntaxEx = ex as SyntaxErrorException;
                            CurrentSession.Logger.Error(String.Format("  行: {0}, 列 {1}, ファイル: {2}", syntaxEx.Line, syntaxEx.Column, syntaxEx.SourcePath));
                        }
                    }
                });
            };

            // DLRのイベントをすべて解除するためにこのアドイン用のRealProxyを取得する
            _sessionProxy = new EventManagedProxy <Session>(CurrentSession);
            _serverProxy  = new EventManagedProxy <Server>(CurrentServer);
        }