Пример #1
0
        protected virtual void OnMessageReceived(string message)
        {
            try
            {
                GhLiveMessage incomingObj = Newtonsoft.Json.JsonConvert.DeserializeObject <GhLiveMessage>(message);

                if (incomingObj.Sender != _id)
                {
                    GhLiveEventArgs e = new GhLiveEventArgs();
                    e.TheObject = incomingObj;
                    var handler = this.DataReceived;

                    if (handler != null)
                    {
                        handler(this, e);
                    }
                    //Console.WriteLine(incomingObj.Message);
                }
            }
            catch (Exception)
            {
                //throw;
            }
        }
Пример #2
0
 private void GhLive_DataReceived(object sender, GhLiveEventArgs e)
 {
     _messageLog.Add(e.TheObject.Message);
     //Grasshopper.Instances.DocumentEditor. //BeginInvoke(new Action(() => { GH_JoinSession.Application.ExpireSolution(true); }));
     //GH_JoinSession.Application.ExpireSolution(true);
 }