Пример #1
0
        public ScheduledTaskRunner(IFeedback <LogEntry> log, ICommandProcessor commandProcessor, IEntityContextConnection entityContextConnection, ITimeProvider timeProvider)
        {
            if (log == null)
            {
                throw new ArgumentNullException(nameof(log));
            }

            if (commandProcessor == null)
            {
                throw new ArgumentNullException(nameof(commandProcessor));
            }

            if (entityContextConnection == null)
            {
                throw new ArgumentNullException(nameof(entityContextConnection));
            }

            if (timeProvider == null)
            {
                throw new ArgumentNullException(nameof(timeProvider));
            }

            EntityContextConnection = entityContextConnection;
            CommandProcessor        = commandProcessor;
            Log          = log;
            TimeProvider = timeProvider;

            Log.Source = "Scheduled Task Runner";
        }
        public BuiltinCommandBuilder(IEntityContextConnection entityContextConnection)
        {
            if (entityContextConnection == null)
                throw new ArgumentNullException("entityContextConnection");

            EntityContextConnection = entityContextConnection;
        }
        public SceneSettingBuilder(IEntityContextConnection entityContextConnection)
        {
            if (entityContextConnection == null)
                throw new ArgumentNullException(nameof(entityContextConnection));

            EntityContextConnection = entityContextConnection;
        }
        public DeviceValueBuilder( IEntityContextConnection entityContextConnection)
        {
            if (entityContextConnection == null)
                throw new ArgumentNullException("entityContextConnection");

            EntityContextConnection = entityContextConnection;
        }
Пример #5
0
        public JavaScriptRunner(IFeedback<LogEntry> log, ICommandProcessor commandProcessor, IEntityContextConnection entityContextConnection)
        {
            if (log == null)
                throw new ArgumentNullException("log");

            if (commandProcessor == null)
                throw new ArgumentNullException("commandProcessor");

            if (entityContextConnection == null)
                throw new ArgumentNullException("entityContextConnection");

            Log = log;
            CommandProcessor = commandProcessor;
            EntityContextConnection = entityContextConnection;
            log.Source = "JavaScript Runner";

            JintEngine = new Jint.Engine(cfg =>
            {
                cfg.AllowClr();
                cfg.AllowDebuggerStatement(JavascriptDebugEnabled);
            });
            //JintEngine.Step += async (s, info) =>
            //{
            //    await Log.ReportInfoFormatAsync(CancellationToken.None, "{1} {2}",
            //         info.CurrentStatement.Source.Start.Line,
            //         info.CurrentStatement.Source.Code.Replace(Environment.NewLine, ""));
            //};

        }
 public BackupRestoreWindow(IFeedback<LogEntry> log, IEntityContextConnection entityContextConnection)
 {
     Log = log;
     EntityContextConnection = entityContextConnection;
     CancellationTokenSource = new CancellationTokenSource();
     InitializeComponent();
 }
Пример #7
0
        public PluginManager(IEnumerable <ZvsPlugin> plugins, IEntityContextConnection entityContextConnection, IFeedback <LogEntry> log, IAdapterManager adapterManager)
        {
            if (plugins == null)
            {
                throw new ArgumentNullException(nameof(plugins));
            }

            if (entityContextConnection == null)
            {
                throw new ArgumentNullException(nameof(entityContextConnection));
            }

            if (log == null)
            {
                throw new ArgumentNullException(nameof(log));
            }

            if (adapterManager == null)
            {
                throw new ArgumentNullException(nameof(adapterManager));
            }

            EntityContextConnection = entityContextConnection;
            Log            = log;
            Plugins        = plugins;
            AdapterManager = adapterManager;

            Log.Source = "Plugin Manager";

            _pluginLookup = Plugins.ToDictionary(o => o.PluginGuid, o => o);
        }
 public BackupRestoreWindow(IFeedback <LogEntry> log, IEntityContextConnection entityContextConnection)
 {
     Log = log;
     EntityContextConnection = entityContextConnection;
     CancellationTokenSource = new CancellationTokenSource();
     InitializeComponent();
 }
        public DeviceCommandBuilder(IEntityContextConnection entityContextConnection)
        {
            if (entityContextConnection == null)
                throw new ArgumentNullException(nameof(entityContextConnection));

            EntityContextConnection = entityContextConnection;
        }
Пример #10
0
        public JavaScriptRunner(IFeedback <LogEntry> log, ICommandProcessor commandProcessor, IEntityContextConnection entityContextConnection)
        {
            if (log == null)
            {
                throw new ArgumentNullException(nameof(log));
            }

            if (commandProcessor == null)
            {
                throw new ArgumentNullException(nameof(commandProcessor));
            }

            if (entityContextConnection == null)
            {
                throw new ArgumentNullException(nameof(entityContextConnection));
            }

            Log = log;
            CommandProcessor        = commandProcessor;
            EntityContextConnection = entityContextConnection;
            log.Source = "JavaScript Runner";

            JintEngine = new Engine(cfg =>
            {
                cfg.AllowClr();
                cfg.AllowDebuggerStatement(JavascriptDebugEnabled);
            });
            //JintEngine.Step += async (s, info) =>
            //{
            //    await Log.ReportInfoFormatAsync(CancellationToken.None, "{1} {2}",
            //         info.CurrentStatement.Source.Start.Line,
            //         info.CurrentStatement.Source.Code.Replace(Environment.NewLine, ""));
            //};
        }
Пример #11
0
        public ZvsEngine(IFeedback<LogEntry> feedback, IAdapterManager adapterManager, IPluginManager pluginManager,
            IEntityContextConnection entityContextConnection, TriggerRunner triggerRunner, ScheduledTaskRunner scheduledTaskRunner)
        {
            if (entityContextConnection == null)
                throw new ArgumentNullException("entityContextConnection");

            if (feedback == null)
                throw new ArgumentNullException("feedback");

            if (adapterManager == null)
                throw new ArgumentNullException("adapterManager");

            if (pluginManager == null)
                throw new ArgumentNullException("pluginManager");

            if (triggerRunner == null)
                throw new ArgumentNullException("triggerRunner");

            if (scheduledTaskRunner == null)
                throw new ArgumentNullException("scheduledTaskRunner");

            EntityContextConnection = entityContextConnection;
            Log = feedback;
            AdapterManager = adapterManager;
            PluginManager = pluginManager;
            TriggerRunner = triggerRunner;
            ScheduledTaskRunner = scheduledTaskRunner;
            Log.Source = "Zvs Engine";


            AppDomain.CurrentDomain.SetData("DataDirectory", Utils.AppDataPath);
        }
Пример #12
0
        public AdapterManager(IEnumerable <ZvsAdapter> adapters, IEntityContextConnection entityContextConnection, IFeedback <LogEntry> log)
        {
            if (adapters == null)
            {
                throw new ArgumentNullException(nameof(adapters));
            }

            if (entityContextConnection == null)
            {
                throw new ArgumentNullException(nameof(entityContextConnection));
            }

            if (log == null)
            {
                throw new ArgumentNullException(nameof(log));
            }

            EntityContextConnection = entityContextConnection;
            Log      = log;
            Adapters = adapters;

            Log.Source = "Adapter Manager";

            _adapterLookup = Adapters.ToDictionary(o => o.AdapterGuid, o => o);
        }
Пример #13
0
        public BuiltinCommandBuilder(IEntityContextConnection entityContextConnection)
        {
            if (entityContextConnection == null)
            {
                throw new ArgumentNullException(nameof(entityContextConnection));
            }

            EntityContextConnection = entityContextConnection;
        }
Пример #14
0
        public DeviceTypeBuilder(IEntityContextConnection entityContextConnection)
        {
            if (entityContextConnection == null)
            {
                throw new ArgumentNullException(nameof(entityContextConnection));
            }

            EntityContextConnection = entityContextConnection;
        }
Пример #15
0
        public SceneSettingBuilder(IEntityContextConnection entityContextConnection)
        {
            if (entityContextConnection == null)
            {
                throw new ArgumentNullException(nameof(entityContextConnection));
            }

            EntityContextConnection = entityContextConnection;
        }
Пример #16
0
        public PluginSettingBuilder(IEntityContextConnection entityContextConnection, CancellationToken cancellationToken)
        {
            if (entityContextConnection == null)
            {
                throw new ArgumentNullException(nameof(entityContextConnection));
            }

            EntityContextConnection = entityContextConnection;
            CancellationToken       = cancellationToken;
        }
Пример #17
0
        public ChangeListener(IFeedback<LogEntry> log, IEntityContextConnection entityContextConnection)
        {
            if (log == null)
                throw new ArgumentNullException(nameof(log));


            if (entityContextConnection == null)
                throw new ArgumentNullException(nameof(entityContextConnection));

            Log = log;
            EntityContextConnection = entityContextConnection;
        }
Пример #18
0
        public async Task Initialize(IFeedback<LogEntry> log, IEntityContextConnection entityContextConnection)
        {
            EntityContextConnection = entityContextConnection;
            Log = log;

            DeviceValueBuilder = new DeviceValueBuilder(entityContextConnection);
            DeviceCommandBuilder = new DeviceCommandBuilder(entityContextConnection);

            var dtb = new DeviceTypeBuilder(entityContextConnection);
            await OnDeviceTypesCreating(dtb);

            var sb = new AdapterSettingBuilder(entityContextConnection, CancellationToken);
            await OnSettingsCreating(sb);
        }
        //Constructor
        public CommandProcessor(IAdapterManager adapterManager, IEntityContextConnection entityContextConnection, IFeedback<LogEntry> log)
        {
            if (entityContextConnection == null)
                throw new ArgumentNullException(nameof(entityContextConnection));

            if (adapterManager == null)
                throw new ArgumentNullException(nameof(adapterManager));

            if (log == null)
                throw new ArgumentNullException(nameof(log));

            AdapterManager = adapterManager;
            EntityContextConnection = entityContextConnection;
            Log = log;
        }
Пример #20
0
        /// <summary>
        /// Executes a scene asynchronously and reports progress.
        /// </summary>
        public SceneRunner(IFeedback<LogEntry> log, ICommandProcessor commandProcessor, IEntityContextConnection entityContextConnection)
        {
            if (log == null)
                throw new ArgumentNullException("log");

            if (commandProcessor == null)
                throw new ArgumentNullException("commandProcessor");

            if (entityContextConnection == null)
                throw new ArgumentNullException("entityContextConnection");

            CommandProcessor = commandProcessor;
            Log = log;
            EntityContextConnection = entityContextConnection;
        }
Пример #21
0
        public async Task Initialize(IFeedback<LogEntry> log, IEntityContextConnection entityContextConnection,IAdapterManager adapterManager)
        {
            EntityContextConnection = entityContextConnection;
            Log = log;
            AdapterManager = adapterManager;

            var sb = new PluginSettingBuilder(entityContextConnection, CancellationToken);
            await OnSettingsCreating(sb);

            var ssb = new SceneSettingBuilder(EntityContextConnection);
            await OnSceneSettingsCreating(ssb);

            var dsb = new DeviceSettingBuilder(EntityContextConnection);
            await OnDeviceSettingsCreating(dsb);
        }
Пример #22
0
        public async Task Initialize(IFeedback <LogEntry> log, IEntityContextConnection entityContextConnection)
        {
            EntityContextConnection = entityContextConnection;
            Log = log;

            DeviceValueBuilder   = new DeviceValueBuilder(entityContextConnection);
            DeviceCommandBuilder = new DeviceCommandBuilder(entityContextConnection);

            var dtb = new DeviceTypeBuilder(entityContextConnection);

            await OnDeviceTypesCreating(dtb);

            var sb = new AdapterSettingBuilder(entityContextConnection, CancellationToken);

            await OnSettingsCreating(sb);
        }
Пример #23
0
        public ChangeListener(IFeedback <LogEntry> log, IEntityContextConnection entityContextConnection)
        {
            if (log == null)
            {
                throw new ArgumentNullException(nameof(log));
            }


            if (entityContextConnection == null)
            {
                throw new ArgumentNullException(nameof(entityContextConnection));
            }

            Log = log;
            EntityContextConnection = entityContextConnection;
        }
Пример #24
0
        public TriggerRunner(IFeedback<LogEntry> log, ICommandProcessor commandProcessor, IEntityContextConnection entityContextConnection)
        {
            if (log == null)
                throw new ArgumentNullException(nameof(log));

            if (commandProcessor == null)
                throw new ArgumentNullException(nameof(commandProcessor));

            if (entityContextConnection == null)
                throw new ArgumentNullException(nameof(entityContextConnection));

            CommandProcessor = commandProcessor;
            Log = log;
            EntityContextConnection = entityContextConnection;

            Log.Source = "Trigger Runner";
        }
Пример #25
0
        public async Task Initialize(IFeedback <LogEntry> log, IEntityContextConnection entityContextConnection, IAdapterManager adapterManager)
        {
            EntityContextConnection = entityContextConnection;
            Log            = log;
            AdapterManager = adapterManager;

            var sb = new PluginSettingBuilder(entityContextConnection, CancellationToken);

            await OnSettingsCreating(sb);

            var ssb = new SceneSettingBuilder(EntityContextConnection);

            await OnSceneSettingsCreating(ssb);

            var dsb = new DeviceSettingBuilder(EntityContextConnection);

            await OnDeviceSettingsCreating(dsb);
        }
Пример #26
0
        public ZvsEngine(IFeedback <LogEntry> feedback, IAdapterManager adapterManager, IPluginManager pluginManager,
                         IEntityContextConnection entityContextConnection, TriggerRunner triggerRunner, ScheduledTaskRunner scheduledTaskRunner)
        {
            if (entityContextConnection == null)
            {
                throw new ArgumentNullException(nameof(entityContextConnection));
            }

            if (feedback == null)
            {
                throw new ArgumentNullException(nameof(feedback));
            }

            if (adapterManager == null)
            {
                throw new ArgumentNullException(nameof(adapterManager));
            }

            if (pluginManager == null)
            {
                throw new ArgumentNullException(nameof(pluginManager));
            }

            if (triggerRunner == null)
            {
                throw new ArgumentNullException(nameof(triggerRunner));
            }

            if (scheduledTaskRunner == null)
            {
                throw new ArgumentNullException(nameof(scheduledTaskRunner));
            }

            EntityContextConnection = entityContextConnection;
            Log                 = feedback;
            AdapterManager      = adapterManager;
            PluginManager       = pluginManager;
            TriggerRunner       = triggerRunner;
            ScheduledTaskRunner = scheduledTaskRunner;
            Log.Source          = "Zvs Engine";


            AppDomain.CurrentDomain.SetData("DataDirectory", Utils.AppDataPath);
        }
Пример #27
0
        public AdapterManager(IEnumerable<ZvsAdapter> adapters, IEntityContextConnection entityContextConnection, IFeedback<LogEntry> log)
        {
            if (adapters == null)
                throw new ArgumentNullException(nameof(adapters));

            if (entityContextConnection == null)
                throw new ArgumentNullException(nameof(entityContextConnection));

            if (log == null)
                throw new ArgumentNullException(nameof(log));

            EntityContextConnection = entityContextConnection;
            Log = log;
            Adapters = adapters;

            Log.Source = "Adapter Manager";

            _adapterLookup = Adapters.ToDictionary(o => o.AdapterGuid, o => o);
        }
        public ScheduledTaskRunner(IFeedback<LogEntry> log, ICommandProcessor commandProcessor, IEntityContextConnection entityContextConnection, ITimeProvider timeProvider)
        {
            if (log == null)
                throw new ArgumentNullException(nameof(log));

            if (commandProcessor == null)
                throw new ArgumentNullException(nameof(commandProcessor));

            if (entityContextConnection == null)
                throw new ArgumentNullException(nameof(entityContextConnection));

            if (timeProvider == null)
                throw new ArgumentNullException(nameof(timeProvider));

            EntityContextConnection = entityContextConnection;
            CommandProcessor = commandProcessor;
            Log = log;
            TimeProvider = timeProvider;

            Log.Source = "Scheduled Task Runner";
        }
Пример #29
0
        //Constructor
        public CommandProcessor(IAdapterManager adapterManager, IEntityContextConnection entityContextConnection, IFeedback <LogEntry> log)
        {
            if (entityContextConnection == null)
            {
                throw new ArgumentNullException(nameof(entityContextConnection));
            }

            if (adapterManager == null)
            {
                throw new ArgumentNullException(nameof(adapterManager));
            }

            if (log == null)
            {
                throw new ArgumentNullException(nameof(log));
            }

            AdapterManager          = adapterManager;
            EntityContextConnection = entityContextConnection;
            Log = log;
        }
Пример #30
0
        /// <summary>
        /// Executes a scene asynchronously and reports progress.
        /// </summary>
        public SceneRunner(IFeedback <LogEntry> log, ICommandProcessor commandProcessor, IEntityContextConnection entityContextConnection)
        {
            if (log == null)
            {
                throw new ArgumentNullException(nameof(log));
            }

            if (commandProcessor == null)
            {
                throw new ArgumentNullException(nameof(commandProcessor));
            }

            if (entityContextConnection == null)
            {
                throw new ArgumentNullException(nameof(entityContextConnection));
            }

            CommandProcessor = commandProcessor;
            Log = log;
            EntityContextConnection = entityContextConnection;
        }
Пример #31
0
        public PluginManager(IEnumerable<ZvsPlugin> plugins, IEntityContextConnection entityContextConnection, IFeedback<LogEntry> log, IAdapterManager adapterManager)
        {
            if (plugins == null)
                throw new ArgumentNullException("plugins");

            if (entityContextConnection == null)
                throw new ArgumentNullException("entityContextConnection");

            if (log == null)
                throw new ArgumentNullException("log");

            if (adapterManager == null)
                throw new ArgumentNullException("adapterManager");

            EntityContextConnection = entityContextConnection;
            Log = log;
            Plugins = plugins;
            AdapterManager = adapterManager;

            Log.Source = "Plugin Manager";

            _pluginLookup = Plugins.ToDictionary(o => o.PluginGuid, o => o);
        }
 public GroupBackupRestore(IEntityContextConnection entityContextConnection) : base(entityContextConnection) { }
 public DeviceBackupRestore(IEntityContextConnection entityContextConnection) : base(entityContextConnection) { }
Пример #34
0
 public SceneBackupRestore(IEntityContextConnection entityContextConnection) : base(entityContextConnection)
 {
 }
Пример #35
0
 public DatabaseFeedback(IEntityContextConnection entityContextConnection)
 {
     EntityContextConnection = entityContextConnection;
 }
 public ScheduledTaskBackupRestore(IEntityContextConnection entityContextConnection) : base(entityContextConnection)
 {
 }
Пример #37
0
 public TriggerBackupRestore(IEntityContextConnection entityContextConnection) : base(entityContextConnection)
 {
 }
Пример #38
0
 protected BackupRestore(IEntityContextConnection entityContextConnection)
 {
     EntityContextConnection = entityContextConnection;
 }
Пример #39
0
 public EntityContext(EntityContextConnection connection)
 {
     _connection = connection;
     _session    = connection.DocumentStore.OpenSession();
     _indexName  = connection.DocumentStore.Conventions.FindTypeTagName(typeof(T));
 }
Пример #40
0
 public ZvsContext(IEntityContextConnection entityContextConnection)
     : base(entityContextConnection.NameOrConnectionString)
 {
     EntityContextConnection = entityContextConnection;
 }
 public TriggerBackupRestore(IEntityContextConnection entityContextConnection) : base(entityContextConnection)
 {
 }
Пример #42
0
 public ZvsContext(IEntityContextConnection entityContextConnection)
     : base(entityContextConnection.NameOrConnectionString)
 {
     EntityContextConnection = entityContextConnection;
 }
 public ScheduledTaskBackupRestore(IEntityContextConnection entityContextConnection) : base(entityContextConnection) { }
Пример #44
0
 public GroupBackupRestore(IEntityContextConnection entityContextConnection) : base(entityContextConnection)
 {
 }
 public JavascriptBackupRestore(IEntityContextConnection entityContextConnection) : base(entityContextConnection) { }
Пример #46
0
 public JavascriptBackupRestore(IEntityContextConnection entityContextConnection) : base(entityContextConnection)
 {
 }