Ejemplo n.º 1
0
        /// <summary>
        /// BRE debugger
        /// </summary>
        /// <param name="sources"></param>
        public BreDebugger(DebuggerParameters parms) : base(parms.WorkingDirectory)
        {
            Console.WriteLine("Starting debugger...");
            DebugApplicationContext.Start(parms);
            ApplicationServiceContext.Current = ApplicationContext.Current;
            ApplicationContext.Current.AddServiceProvider(typeof(FileSystemResolver));
            ApplicationContext.Current.AddServiceProvider(typeof(ServiceManager));
            Tracer.AddWriter(new ConsoleTraceWriter(EventLevel.LogAlways, "dbg"), EventLevel.LogAlways);

            if (!String.IsNullOrEmpty(parms.WorkingDirectory))
            {
                ApplicationContext.Current.GetService <FileSystemResolver>().RootDirectory = parms.WorkingDirectory;
            }
            var rootPath = ApplicationContext.Current.GetService <FileSystemResolver>().RootDirectory;

            // Load debug targets
            Console.WriteLine("Loading debuggees...");
            if (parms.Sources != null)
            {
                foreach (var rf in parms.Sources)
                {
                    var f = rf.Replace("~", rootPath);
                    if (!File.Exists(f))
                    {
                        Console.Error.WriteLine("Can't find file {0}", f);
                    }
                    else
                    {
                        this.Execute(f);
                    }
                }
            }
            JavascriptBusinessRulesEngine.SetDebugMode(true);
            JavascriptBusinessRulesEngine.Current.Engine.Step += JreStep;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// BRE debugger
        /// </summary>
        /// <param name="sources"></param>
        public ProtoDebugger(DebuggerParameters parms) : base(parms.WorkingDirectory)
        {
            Console.WriteLine("Starting debugger...");

            DebugApplicationContext.Start(parms);
            ApplicationServiceContext.Current = ApplicationContext.Current;
            try
            {
                ApplicationContext.Current.RemoveServiceProvider(typeof(IClinicalProtocolRepositoryService));
            }
            catch { }

            ApplicationContext.Current.AddServiceProvider(typeof(FileSystemResolver));
            ApplicationContext.Current.AddServiceProvider(typeof(ServiceManager));
            ApplicationContext.Current.AddServiceProvider(typeof(DebugProtocolRepository));
            Tracer.AddWriter(new ConsoleTraceWriter(EventLevel.LogAlways, "dbg"), EventLevel.LogAlways);

            if (!String.IsNullOrEmpty(parms.WorkingDirectory))
            {
                ApplicationContext.Current.GetService <FileSystemResolver>().RootDirectory = parms.WorkingDirectory;
            }
            var rootPath = ApplicationContext.Current.GetService <FileSystemResolver>().RootDirectory;

            // Load debug targets
            Console.WriteLine("Loading debuggees...");
            if (parms.Sources != null)
            {
                foreach (var rf in parms.Sources)
                {
                    var f = rf.Replace("~", rootPath);
                    if (!File.Exists(f))
                    {
                        Console.Error.WriteLine("Can't find file {0}", f);
                    }
                    else
                    {
                        this.Add(f);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// BRE debugger
        /// </summary>
        /// <param name="sources"></param>
        public BreDebugger(DebuggerParameters parms) : base(parms.WorkingDirectory)
        {
            this.m_parms = parms;
            Console.WriteLine("Starting debugger...");
            DebugApplicationContext.Start(parms);
            ApplicationServiceContext.Current = ApplicationContext.Current;
            ApplicationServiceContext.Current.GetService <IServiceManager>().AddServiceProvider(typeof(FileSystemResolver));
            Tracer.AddWriter(new ConsoleTraceWriter(EventLevel.LogAlways, "dbg", null), EventLevel.LogAlways);

            if (!String.IsNullOrEmpty(parms.WorkingDirectory))
            {
                ApplicationContext.Current.GetService <FileSystemResolver>().RootDirectory = parms.WorkingDirectory;
            }
            var rootPath = ApplicationContext.Current.GetService <FileSystemResolver>().RootDirectory;

            // Load debug targets
            Console.WriteLine("Loading debuggees...");

            JavascriptExecutorPool.Current.ExecuteGlobal(o => o.Engine.Step += JreStep);
            JavascriptExecutorPool.Current.ExecuteGlobal(j => j.AddExposedObject("SanteDBDcg", new DisconnectedGatewayJni()));

            if (parms.Sources != null)
            {
                foreach (var rf in parms.Sources)
                {
                    var f = rf.Replace("~", rootPath);
                    if (!File.Exists(f))
                    {
                        Console.Error.WriteLine("Can't find file {0}", f);
                    }
                    else
                    {
                        this.Execute(f);
                    }
                }
            }
        }