Example #1
0
            public DynamicPsHost(DynamicPowerShell powershell)
            {
                this.instanceId = Guid.NewGuid();
                this.powerShell = powershell ?? throw new ArgumentNullException("powershell");
                this.ui         = new DynamicPsUserInterface(this);

                this.log = LoggerProxy.Create(this.GetService <ILogger>(false), "Powershell");
            }             // ctor
Example #2
0
            public FileServiceSession(DirectoryFileServiceItem service, int sessionId)
            {
                this.sessionId = sessionId;
                this.service   = service;
                this.log       = LoggerProxy.Create(service.Log, sessionId.ToString());

                log.Info("Session started...");
                service.OnSessionStart();
            }             // ctor
Example #3
0
            private DEConfigItem currentItem = null;             // current node, that is used as parent

            public LuaDebugSession(LuaEngine engine, IDEWebSocketContext context)
            {
                this.engine  = engine;
                this.log     = LoggerProxy.Create(engine.Log, "Debug Session");
                this.context = context;

                cancelSessionTokenSource = new CancellationTokenSource();
                sessionTask = Task.Run(Execute, cancelSessionTokenSource.Token);

                UseNode("/");

                Info("Debug session established.");
            }             // ctor
Example #4
0
            protected LuaScript(LuaEngine engine, string scriptId, bool compileWithDebugger)
            {
                this.engine   = engine;
                this.log      = LoggerProxy.Create(engine.Log, scriptId);
                this.scriptId = scriptId;

                this.chunk = null;
                this.compiledWithDebugger = compileWithDebugger;

                // attach the script to the engine
                engine.AddScript(this);

                log.Info("HinzugefĆ¼gt.");
            }             // ctor
Example #5
0
            public LuaAttachedGlobal(LuaEngine engine, string scriptId, LuaTable table, bool autoRun)
            {
                this.engine    = engine;
                this.log       = LoggerProxy.Create(GetHostLog(table) ?? engine.Log, scriptId);
                this.scriptId  = scriptId;
                this.table     = table;
                this.autoRun   = autoRun;
                this.needToRun = autoRun;

                // Run the script
                if (needToRun && IsCompiled)
                {
                    Run(false);
                }
            }             // ctor
Example #6
0
            private readonly List <WeakReference <PrivateUserDataContext> > currentContexts = new List <WeakReference <PrivateUserDataContext> >();       // current active user contexts

            #region -- Ctor/Dtor/Idle -------------------------------------------------

            public PrivateUserData(PpsApplication application, long userId, PpsUserIdentity userIdentity)
            {
                this.application = application ?? throw new ArgumentNullException(nameof(application));
                this.userId      = userId;

                if (userId == sysUserId)                 // mark system user
                {
                    if (userIdentity != null)
                    {
                        throw new ArgumentException("UserIdentity must be null.", nameof(userIdentity));
                    }

                    userIdentity              =
                        localIdentity         = PpsUserIdentity.System;
                    this[UserContextFullName] = "System";
                }
                this.userIdentity = userIdentity;

                log = LoggerProxy.Create(application, userIdentity.Name);

                application.Server.RegisterUser(this); // register the user in http-server
            }                                          // ctor