public DeviceDescriptorCache(IPresentationNotifier presentationNotifier) { IsInitialized = false; _presentationNotifier = presentationNotifier; _presentationNotifier.OnDeviceResourceAdded += new EventHandler<TechnicalServices.Common.Classes.NotifierEventArg<DeviceResourceDescriptor>>(presentationNotifier_OnDeviceResourceAdded); _presentationNotifier.OnDeviceResourceDeleted += new EventHandler<TechnicalServices.Common.Classes.NotifierEventArg<DeviceResourceDescriptor>>(presentationNotifier_OnDeviceResourceDeleted); _presentationNotifier.OnDeviceResourceUpdated += new EventHandler<TechnicalServices.Common.Classes.NotifierEventArg<DeviceResourceDescriptor>>(presentationNotifier_OnDeviceResourceUpdated); }
public RemotePresentationClient(IPresentationNotifier presentationNotifier, IClientConfiguration clientConfiguration, ISourceDAL sourceDAL, IDeviceSourceDAL deviceSourceDAL) { _sourceDAL = sourceDAL; _deviceSourceDAL = deviceSourceDAL; _presentationNotifier = presentationNotifier; _configuration = clientConfiguration; _presentationClient = new DuplexClient<IPresentationService>(new InstanceContext(presentationNotifier), clientConfiguration.PingInterval); _presentationClient.Open(); _presentationClient.OnChanged += new EventHandler<ClientState>(_presentationClient_OnChanged); _deviceDescriptorCache = new DeviceDescriptorCache(presentationNotifier); }
//public static IPresentationWorker CreatePresentationWorker(bool isStandAlone, IPresentationNotifier callback) //{ // if (isStandAlone) // { // return new StandAlonePresentationWorker(); // } // else // { // return (new DuplexClient<IPresentationWorker>(new InstanceContext(callback), 500)).Channel; // } //} public static IPresentationClient CreateStandAlonePresentationWorker(ISourceDAL sourceDAL, IDeviceSourceDAL deviceSourceDAL, IClientConfiguration configuration, IPresentationNotifier notifier) { return new StandAlonePresentationWorker(sourceDAL, deviceSourceDAL, configuration, null /*notifier*/); // кажется в автономном режиме нотификация не нужна. }
public static RemotePresentationClient CreatePresentationClient(ISourceDAL sourceDAL, IDeviceSourceDAL deviceSourceDAL, IPresentationNotifier callback, IClientConfiguration configuration) { return new RemotePresentationClient(callback, configuration, sourceDAL, deviceSourceDAL); }
public StandAlonePresentationWorker(ISourceDAL sourceDAL, IDeviceSourceDAL deviceSourceDAL, IConfiguration configuration, IPresentationNotifier notifier) { _configuration = configuration; _sourceDAL = sourceDAL; _deviceSourceDAL = deviceSourceDAL; _lockService = new LockingService(new TechnicalServices.Entity.UserIdentity(UserInfo.Empty, true, TimeSpan.MinValue, "localhost"), _configuration.EventLog); _presentationDAL = new StandAlonePresentationDAL(configuration); //PresentationDAL _presentationDAL.Init(_sourceDAL, _deviceSourceDAL); _notifier = notifier; Init(); }