Ejemplo n.º 1
0
 private void OnIpcEvent(object sender, IpcEventArgs ipcEventArgs)
 {
     if (ipcEventArgs.Name.Equals(IpcCreateEntryEventName, StringComparison.InvariantCultureIgnoreCase))
     {
         m_host.MainWindow.BeginInvoke(new Action(CreateEntry));
     }
 }
Ejemplo n.º 2
0
 private void OnIpcEvent(object sender, IpcEventArgs ipcEventArgs)
 {
     if (Settings.Default.ShowOnIPC && ipcEventArgs.Name.Equals(IpcEventName, StringComparison.InvariantCultureIgnoreCase))
     {
         mHost.MainWindow.BeginInvoke(new Action(ShowSearch));
     }
 }
Ejemplo n.º 3
0
 protected void InvokeDataReceived(BaseIpcServer server, IpcEventArgs args)
 {
     if (!args.HasErrors)
     {
         OnDataReceived?.Invoke(server, args);
     }
 }
Ejemplo n.º 4
0
        public void Notify(string destination, object notification)
        {
            IpcEventArgs e = new IpcEventArgs();

            e.EventType   = IpcEventArgs.EventTypes.Notification;
            e.Destination = destination;
            e.Arguments   = new object[] { notification };
            this.IpcEvent(this, ref e);
        }
Ejemplo n.º 5
0
 public void Hint(string messageText, string caption)
 {
     if (IpcEvent != null)
     {
         IpcEventArgs e = new IpcEventArgs();
         e.EventType   = IpcEventArgs.EventTypes.Information;
         e.Destination = "lazaro";
         e.Verb        = "HINT";
         e.Arguments   = new object[] { messageText, caption };
         this.IpcEvent(this, ref e);
     }
 }
Ejemplo n.º 6
0
 public void NotifyProgress(Lfx.Types.OperationProgress progress)
 {
     if (IpcEvent != null)
     {
         IpcEventArgs e = new IpcEventArgs();
         e.EventType   = IpcEventArgs.EventTypes.Progress;
         e.Destination = "lazaro";
         e.Verb        = "PROGRESS";
         e.Arguments   = new object[] { progress };
         this.IpcEvent(this, ref e);
     }
 }
Ejemplo n.º 7
0
 public void Info(string destination, string verb, object[] arguments)
 {
     if (IpcEvent != null)
     {
         IpcEventArgs e = new IpcEventArgs();
         e.EventType   = IpcEventArgs.EventTypes.Information;
         e.Destination = destination;
         e.Verb        = verb;
         e.Arguments   = arguments;
         this.IpcEvent(this, ref e);
     }
 }
Ejemplo n.º 8
0
 public void Paging(int currentPage, int TotalPage)
 {
     if (IpcEvent != null)
     {
         IpcEventArgs e = new IpcEventArgs();
         e.EventType   = IpcEventArgs.EventTypes.Information;
         e.Destination = "gestion777";
         e.Verb        = "PAGEUPD";
         e.Arguments   = new object[] { currentPage, TotalPage };
         this.IpcEvent(this, ref e);
     }
 }
Ejemplo n.º 9
0
 public void Paging(object form)
 {
     if (IpcEvent != null)
     {
         IpcEventArgs e = new IpcEventArgs();
         e.EventType   = IpcEventArgs.EventTypes.Information;
         e.Destination = "gestion777";
         e.Verb        = "PAGE";
         e.Arguments   = new object[] { form };
         this.IpcEvent(this, ref e);
     }
 }
Ejemplo n.º 10
0
 public object Execute(string destination, string verb, object[] arguments)
 {
         if (IpcEvent != null) {
                 IpcEventArgs e = new IpcEventArgs();
                 e.EventType = IpcEventArgs.EventTypes.ActionRequest;
                 e.Destination = destination;
                 e.Verb = verb;
                 e.Arguments = arguments;
                 this.IpcEvent(this, ref e);
                 return e.ReturnValue;
         }
         return null;
 }
Ejemplo n.º 11
0
 public object Execute(string destination, string verb, object[] arguments)
 {
     if (IpcEvent != null)
     {
         IpcEventArgs e = new IpcEventArgs();
         e.EventType   = IpcEventArgs.EventTypes.ActionRequest;
         e.Destination = destination;
         e.Verb        = verb;
         e.Arguments   = arguments;
         this.IpcEvent(this, ref e);
         return(e.ReturnValue);
     }
     return(null);
 }
Ejemplo n.º 12
0
        private void Server_OnDataReceived(object sender, IpcEventArgs e)
        {
            var entity = JsonConvert.DeserializeObject <IpcEntity <T> >(e.JsonData);

            // See if a callback is assigned to this request and call that
            if (_callbacks.TryGetValue(entity.Header.CallbackId, out Action <T> cb))
            {
                cb?.Invoke(entity.Entity);

                lock (_dictionaryLock)
                {
                    _callbacks.Remove(entity.Header.CallbackId);
                }
            }
            else
            {
                // If no specific callback exists, call the generic action
                _onMessageReceivedAction?.Invoke(entity.Entity, entity.Header.CallbackId);
            }
        }
Ejemplo n.º 13
0
 public void Notify(string destination, object notification)
 {
         IpcEventArgs e = new IpcEventArgs();
         e.EventType = IpcEventArgs.EventTypes.Notification;
         e.Destination = destination;
         e.Arguments = new object[] { notification };
         this.IpcEvent(this, ref e);
 }
Ejemplo n.º 14
0
 public void Hint(string messageText, string caption)
 {
         if (IpcEvent != null) {
                 IpcEventArgs e = new IpcEventArgs();
                 e.EventType = IpcEventArgs.EventTypes.Information;
                 e.Destination = "lazaro";
                 e.Verb = "HINT";
                 e.Arguments = new object[] { messageText, caption };
                 this.IpcEvent(this, ref e);
         }
 }
Ejemplo n.º 15
0
 public void NotifyProgress(Lfx.Types.OperationProgress progress)
 {
         if (IpcEvent != null) {
                 IpcEventArgs e = new IpcEventArgs();
                 e.EventType = IpcEventArgs.EventTypes.Progress;
                 e.Destination = "lazaro";
                 e.Verb = "PROGRESS";
                 e.Arguments = new object[] { progress };
                 this.IpcEvent(this, ref e);
         }
 }
Ejemplo n.º 16
0
 public void Info(string destination, string verb, object[] arguments)
 {
         if (IpcEvent != null) {
                 IpcEventArgs e = new IpcEventArgs();
                 e.EventType = IpcEventArgs.EventTypes.Information;
                 e.Destination = destination;
                 e.Verb = verb;
                 e.Arguments = arguments;
                 this.IpcEvent(this, ref e);
         }
 }