public AudioMixerPlayerOperativeControl(Device device, IPlayerCommand playerProvider, IEventLogging logging) : this() { _countSwitch = 0; InitializeController(new AudioMixerPlayerController(device, playerProvider, this, logging)); SetControlPlayerTimerEnable(true, 3000); }
public ServerConfiguration(ModuleLoader loader, IEventLogging logging) : base(loader, true, logging) { string path = Path.GetFullPath(Settings.Default.UserStorageFolder); path = Path.Combine(path, UserStorageFile); UserStorageAdapter.Instance.Init(path); }
public static MemoryStream GetScreenShort(IEventLogging log, Guid imageFormat) { MemoryStream result = null; try { result = new MemoryStream(ScreeBufferSize); Size sz = Screen.PrimaryScreen.Bounds.Size; IntPtr hDesk = GetDesktopWindow(); IntPtr hSrce = GetWindowDC(hDesk); IntPtr hDest = CreateCompatibleDC(hSrce); IntPtr hBmp = CreateCompatibleBitmap(hSrce, sz.Width, sz.Height); IntPtr hOldBmp = SelectObject(hDest, hBmp); bool b = BitBlt(hDest, 0, 0, sz.Width, sz.Height, hSrce, 0, 0, CopyPixelOperation.SourceCopy | CopyPixelOperation.CaptureBlt); using (Image image = Image.FromHbitmap(hBmp)) { SelectObject(hDest, hOldBmp); DeleteObject(hBmp); DeleteDC(hDest); ReleaseDC(hDesk, hSrce); image.Save(result, new ImageFormat(imageFormat)); } } catch (Exception ex) { log.WriteError(ex.Message); } return result; }
private static List<IModule> loadInstanceFromAssembly(IEnumerable<string> fileList, IEventLogging logging) { List<IModule> result = new List<IModule>(8); StringBuilder message = new StringBuilder(InfoMesage); foreach (string fileName in fileList) { Assembly assembly = Assembly.LoadFrom(fileName); object[] list = assembly.GetCustomAttributes(typeof(ModuleAttribute), false); foreach (ModuleAttribute attr in list) { IModule module = (IModule)assembly.CreateInstance(attr.ModuleType.FullName); module.Name = attr.Name; result.Add(module); } message.AppendFormat(CultureInfo.InvariantCulture, ModuleInfoFormat, Environment.NewLine, assembly.Location, Environment.NewLine, assembly.FullName); } logging.WriteInformation(message.ToString()); return result; }
internal static LabelStorage LoadStorage(string file, List<Label> systemLabels, IEventLogging logging) { string xmlPath = file; string xsdPath = Path.ChangeExtension(file, "xsd"); XmlSerializer serializer = new XmlSerializer(typeof(LabelStorage)); XmlReaderSettings settings = new XmlReaderSettings(); settings.ValidationType = ValidationType.Schema; settings.Schemas.Add("urn:labelstorage-schema", xsdPath); LabelStorage storage = null; //settings.ValidationEventHandler += new ValidationEventHandler(ValidationCallBack); using (XmlReader reader = XmlReader.Create(xmlPath, settings)) { storage = (LabelStorage)serializer.Deserialize(reader); } // теперя надо проверить, что нет пользовательских меток, совпадающих с системными. если есть - пользовательские надо удалять List<Label> toRemove = storage.FindAll( label => systemLabels.Any( syslab => syslab.Id == label.Id || syslab.Name.Equals(label.Name, StringComparison.InvariantCultureIgnoreCase))); foreach (Label item in toRemove) { logging.WriteWarning(string.Format("Пользовательская метка <{0}> удалена ввиду конфликта названия или идентификатора с одноименной системной меткой", item.Name)); } storage.RemoveAll(label=>toRemove.Any(tor => object.ReferenceEquals(tor, label))); // и оптяь сохраним storage.SaveStorage(file); return storage; }
public override Control CreateControlForSource(IEventLogging logging, Source source, Control parent, IPlayerCommand playerCommand, IPresentationClient client) { VDCTerminalControl control = new VDCTerminalControl(source, playerCommand, logging, client); control.Parent = parent; parent.Controls.Add(control); control.CreateControl(); return control; }
public override System.Windows.Forms.Control CreateControlForSource(IEventLogging logging, Source source, Control parent, IPlayerCommand playerCommand, IPresentationClient client) { DVDPlayerControl2 control = new DVDPlayerControl2(source, playerCommand, logging, client); control.Parent = parent; parent.Controls.Add(control); control.CreateControl(); return control; }
public CommonConfiguration(ModuleLoader loader, ModuleConfiguration configuration, IEventLogging logging) { this.loader = loader; this._logging = logging; _config = configuration; _labelStorageAdapter = CreateLabelStorageAdapter(configuration); _systemParametersAdapter = new SystemParametersAdapter(); }
public override Control CreateControlForDevice(IEventLogging logging, Device device, Control parent, IPlayerCommand playerProvider, IPresentationClient client) { LightPlayerControl control = new LightPlayerControl(device, playerProvider, logging); control.Parent = parent; parent.Controls.Add(control); control.CreateControl(); return control; }
public LightPlayerControl(Device device, IPlayerCommand playerProvider, IEventLogging logging) : this() { _countSwitch = 0; _lightGroups = new Dictionary<string, int>(); InitializeController(new LightPlayerController(device, playerProvider, this, logging)); SetControlPlayerTimerEnable(true, 3000); }
public override System.Windows.Forms.Control CreateControlForSource(IEventLogging logging, TechnicalServices.Persistence.SystemPersistence.Presentation.Source source, System.Windows.Forms.Control parent, IPlayerCommand playerCommand, IPresentationClient client) { PlayerController controller = new PlayerController(source, playerCommand); VNCPlayerControl control = new VNCPlayerControl(controller); control.Parent = parent; parent.Controls.Add(control); control.CreateControl(); return control; }
public AgentManager(IEventLogging logging) { _logging = logging; _flag = new AutoResetEvent(false); _proc = new Thread(ThreadProc); _backgroundProvider = new BackgroundProvider(); _proc.Start(_flag); _flag.WaitOne(-1); }
public override Control CreateControlForSource(IEventLogging logging, Source source, Control parent, IPlayerCommand playerProvider, IPresentationClient client) { PlayerController controller = new PlayerController(source, playerProvider); PlayerControl control = new PlayerControl(controller); control.Parent = parent; parent.Controls.Add(control); control.CreateControl(); return control; }
public LabelStorageAdapter(ModuleConfiguration config, string path, IEventLogging logging) : this(config, logging) { _filePath = path; LabelStorage customLabelStorage = LabelStorageExt.LoadStorage(path, config.LabelList, logging); _labelStorage.AddRange(customLabelStorage); _lastLabelId = (_labelStorage.Count > 0) ? _labelStorage.Max(x => x.Id) : 0; Check(); }
public AdministrationForm(IEventLogging logging) : this() { ILabelStorageAdapter labelStorageAdapter = new LabelStorageAdapter(null, logging); this._controller = new UserListController(this, gridUserParametrs); this._labelController = new LabelListController(this, gridUserParametrs); this._systemParametersController = new SystemParametersController(this, gridSystemParameters); SystemParametersController.Instance.OnSystemParametersCellChenged += new SystemParametersCellChenged(AdministrationForm_OnSystemParametersCellChenged); UserGridVisibility(); }
public LabelStorageAdapter(ModuleConfiguration config, IEventLogging logging) { //удаленная загрузка OnLine _logging = logging; if (config == null) return; _labelStorage.AddRange(config.LabelList); _lastLabelId = (_labelStorage.Count > 0) ? _labelStorage.Max(x => x.Id) : 0; _syncObject = ((ICollection)lockedLabels).SyncRoot; Check(); }
public VDCTerminalControl(Source source, IPlayerCommand playerCommand, IEventLogging logging, IPresentationClient client) : this() { CollapsedRGBOption = true; cbaAbonents.DisplayMember = "Name"; cbaAbonents.ValueMember = "Number1"; _controller = new PlayerController(client, source, this, playerCommand, logging); InitializeController(_controller); SetControlPlayerTimerEnable(true, 1000); }
public static IExternalSystemCommand CreateController(string fullClassName, Uri connectionString, IEventLogging logging) { string[] list = fullClassName.Split(','); if (list.Length != 2) throw new ApplicationException("Неправильно указана библиотека для работы с контроллером внешней системы"); Assembly asm = AppDomain.CurrentDomain.Load(list[0]); Type classType = asm.GetType(list[1]); IExternalSystemCommand result = (IExternalSystemCommand)Activator.CreateInstance(classType, connectionString, logging); return result; }
public static IControllerChannel CreateController(IEventLogging logging, string fullClassName, Uri parameter, int receiveTimeout, int checkTimeout) { string[] list = fullClassName.Split(','); if (list.Length != 2) throw new ApplicationException("Неправильно указана библиотека для работы с контроллером"); Assembly asm = AppDomain.CurrentDomain.Load(list[0]); Type classType = asm.GetType(list[1]); IControllerChannel result = (IControllerChannel) Activator.CreateInstance(classType, logging, parameter, receiveTimeout, checkTimeout); return result; }
//private readonly LockingNotifier _notifier = new LockingNotifier(); public LockingService(UserIdentity systemUser, IEventLogging log) { _systemUser = systemUser; _log = log; _timer = new Timer(_interval); _timer.Elapsed += new ElapsedEventHandler(_timer_Elapsed); _timer.Start(); _lockingStorage = new LockingStorage(); _lockingStorage.OnAddItem += _lockingStorage_OnAddItem; _lockingStorage.OnRemoveItem += _lockingStorage_OnRemoveItem; //_lockingStorage.OnAddItem += new TechnicalServices.Common.StorageAction<ObjectKey, LockingInfo>(_notifier.SubscribeForMonitor); //_lockingStorage.OnRemoveItem +=new TechnicalServices.Common.StorageAction<ObjectKey,LockingInfo>(_notifier.UnSubscribeForMonitor); }
public ModuleLoader(IEventLogging logging) { Debug.Assert(logging != null, "Нет системы логирования"); _logService = logging; string path = Path.GetFullPath(Settings.Default.ModuleFolder); if (!Directory.Exists(path)) _logService.WriteWarning(String.Format(LoadingWarning, path)); string[] fileList = Directory.GetFiles(path, "*.dll", SearchOption.AllDirectories); IEnumerable<string> libraryList = getFilesByAttribyte(fileList); _moduleList = loadInstanceFromAssembly(libraryList, logging); }
public TcpExternalSystemServer(Uri connectionString, IEventLogging log) { Debug.Assert(connectionString.Scheme == "tcp"); Debug.Assert(connectionString.Port != 0); _log = log; _encoding = Encoding.Default; _connectionString = connectionString; _exit = new ManualResetEvent(false); _thread = new Thread(ThreadProc); _thread.Start(); }
public override Control CreateControlForSource(IEventLogging logging, Source source, Control parent, IPlayerCommand playerProvider, IPresentationClient client) { ArcGISMapController controller = new ArcGISMapController(source, playerProvider); //ChartManageControl control = new ChartManageControl(controller); //control.Parent = parent; //parent.Controls.Add(control); //control.CreateControl(); MapManageControl control = new MapManageControl(controller); control.Parent = parent; parent.Controls.Add(control); control.CreateControl(); return control; }
public DVDPlayerControl2(Source source, IPlayerCommand playerCommand, IEventLogging logging, IPresentationClient client) : this() { InitializeController(new PlayerController(client, source, this, playerCommand, logging)); switch (_DVDType) { case InterfaceTypeEnum.IR: SetControlPlayerTimerEnable(false, 1); break; case InterfaceTypeEnum.RS232: SetControlPlayerTimerEnable(true, 1000); break; } }
/// <summary> /// /// </summary> /// <param name="loader"></param> /// <param name="checkModules"></param> /// <param name="logging"></param> /// <param name="notThrowExceptionIfInvalideConfiguration"> используется ТОЛЬКО для дизайнера в автономном режиме</param> public CommonConfiguration(ModuleLoader loader, bool checkModules, IEventLogging logging, bool notThrowExceptionIfInvalideConfiguration) { this.loader = loader; this._logging = logging; string labelStoragePath; string moduleConfigFile = String.Empty; string configurationSchemaFile; try { string moduleConfigPath = labelStoragePath = Path.GetFullPath(ConfigurationFolder); moduleConfigFile = Path.Combine(moduleConfigPath, ConfigurationFile); labelStoragePath = Path.Combine(labelStoragePath, LabelFile); configurationSchemaFile = Path.Combine(moduleConfigPath, ConfigurationSchemaFile); } catch (ArgumentException ex) { throw new ModuleConfigurationException(moduleConfigFile); } try { _config = LoadModuleConfiguration(moduleConfigFile, configurationSchemaFile, this.loader.ModuleList); if (checkModules) CheckLoadedModules(); } catch(Exception ex) { if (notThrowExceptionIfInvalideConfiguration) { _config = new InvalideModuleConfiguration() {ErrorMessage = ex.Message, InnerException = ex}; } else { throw; } } _systemParametersAdapter = new SystemParametersAdapter(); _labelStorageAdapter = CreateLabelStorageAdapter(_config, labelStoragePath); }
public virtual Control CreateControlForSource(IEventLogging logging, Source source, Control parent, IPlayerCommand playerProvider, IPresentationClient client) { return null; }
public AgentConfiguration(ModuleLoader loader, ModuleConfiguration configuration, IEventLogging logging) : base(loader, configuration, logging) { }
public VideoCameraPlayerCommonControl(Source source, IPlayerCommand playerCommand, IEventLogging logging, IPresentationClient client) : this() { InitializeController(new VideoCameraPlayerCommonController(client, source, this, playerCommand, logging)); SetControlPlayerTimerEnable(true, 1000); }
public bool Init(IEventLogging log) { Debug.Assert(log != null, "IEventLogging не может быть null"); return true; }
public virtual Control CreateControlForDisplay(IEventLogging logging, Display display, Control parent, IPlayerCommand playerProvider, IPresentationClient client) { return null; }