示例#1
0
        public IpcEventListener(IpcEventChannel channel, string instanceId, string instanceName)
        {
            _channel      = Check.NotNull(channel);
            _identity     = instanceId;
            _instanceName = instanceName ?? String.Empty;
            _handles      = new Dictionary <string, WaitHandle>(StringComparer.Ordinal);

            _listener = new Mutex(false, String.Format("{0}.{1}._-LOCK-_", _channel.ChannelName, _identity));
            _ready    = new EventWaitHandle(false, EventResetMode.ManualReset, String.Format("{0}.{1}._-READY-_", _channel.ChannelName, _identity));
            _modified = new AutoResetEvent(false);
            _quit     = new ManualResetEvent(false);

            _worker = new Thread(Listen);
            _worker.SetApartmentState(ApartmentState.MTA);
            _worker.Name         = _channel.ChannelName;
            _worker.IsBackground = true;

            _channel.OnModified += EventsModified;
            StartListening(_channel.DefaultTimeout);
        }
示例#2
0
 public new void RaiseEvent(IpcEventChannel channel, params string[] args)
 {
     base.RaiseEvent(channel, args);
 }
示例#3
0
 /// <summary> Creates the event </summary>
 internal IpcSignalEventArgs(IpcEventChannel channel, string name, string[] args)
 {
     _channel   = channel;
     _name      = name;
     _arguments = (string[])args.Clone();
 }