Beispiel #1
0
        /// <summary>
        ///     Creates an instance of <see cref="ApplicationRuntimeModeViewModel" />
        /// </summary>
        /// <param name="interactionService">
        ///     An instance of <see cref="IInteractionService" /> to use
        /// </param>
        /// <param name="configService">
        ///     An instance of <see cref="IRuntimeModeDevicesServices" /> to use
        /// </param>
        /// <param name="settings">Сервис с настойками программы</param>
        public ApplicationRuntimeModeViewModel(IInteractionService interactionService,
                                               IRuntimeModeDevicesServices configService, IApplicationSettingsService settings, CityWideCommandsLogger cityWideCommandsLogger, IApplicationLogViewModel applicationLogViewModel, IDeviceCommandFactory deviceCommandFactory, IDeviceCommandService deviceCommandService)
        {
            Guard.AgainstNullReference(interactionService, "interactionService");
            Guard.AgainstNullReference(configService, "configService");
            Guard.AgainstNullReference(settings, "settings");

            this._interactionService = interactionService;
            this._configService      = configService;
            this._settings           = settings;
            _cityWideCommandsLogger  = cityWideCommandsLogger;
            _applicationLogViewModel = applicationLogViewModel;
            _deviceCommandFactory    = deviceCommandFactory;
            _deviceCommandService    = deviceCommandService;

            try
            {
                if (!File.Exists(String.Format("./nlog_{0}_{1}.txt", DateTime.Now.Month.ToString("D2"), DateTime.Now.Year.ToString("D4"))))
                {
                    using (File.Create(String.Format("./nlog_{0}_{1}.txt", DateTime.Now.Month.ToString("D2"), DateTime.Now.Year.ToString("D4")))) { }
                }
            }
            catch (Exception)
            { }
            this._logger = LogManager.GetLogger("Общие");
        }
        /// <summary>
        ///     Creates an instance of <see cref="ApplicationConfigurationModeViewModel" />
        /// </summary>
        /// <param name="interactionService">
        ///     An instance of <see cref="IInteractionService" /> to use
        /// </param>
        /// <param name="configService">
        ///     An instance of <see cref="IConfigurationModeDevicesService" /> to use
        /// </param>
        /// <param name="persistanceService"></param>
        /// <param name="settings">Сервис с настройками приложения</param>
        /// <param name="configDeviceViewModelFactory"></param>
        public ApplicationConfigurationModeViewModel(IInteractionService interactionService,
                                                     IConfigurationModeDevicesService configService,
                                                     IPersistanceService persistanceService,
                                                     IApplicationSettingsService settings, IConfigDeviceViewModelFactory configDeviceViewModelFactory,
                                                     IApplicationLogViewModel applicationLogViewModel)
        {
            Guard.AgainstNullReference(interactionService, "interactionService");
            Guard.AgainstNullReference(configService, "configService");
            Guard.AgainstNullReference(persistanceService, "persistanceService");
            Guard.AgainstNullReference(settings, "settings");

            this._interactionService      = interactionService;
            this._configService           = configService;
            this._persistanceService      = persistanceService;
            this._settings                = settings;
            _configDeviceViewModelFactory = configDeviceViewModelFactory;
            _applicationLogViewModel      = applicationLogViewModel;

            this._logger = LogManager.GetLogger("Конфигурация");
        }