Exemplo n.º 1
0
        }//eof

        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            DA.GetData(1, ref this.isAutoUpdate);

            if (this.ghDocument == null)
            {
                this.ghDocument = OnPingDocument();
                if (this.ghDocument == null)
                {
                    return;
                }

                GH_Document.SolutionEndEventHandler handle = delegate(Object sender, GH_SolutionEventArgs e)
                {
                };

                ghDocument.SolutionEnd += handle;
            }

            if (!this.onMessageTriggered)
            {
                WsObject wscObj = new WsObject();

                if (DA.GetData(0, ref wscObj))
                {
                    if (this.wscObj != wscObj)
                    {
                        this.unsubscribeEventHandlers();
                        this.wscObj = wscObj;
                        this.subscribeEventHandlers();
                    }
                }
                else
                {
                    this.unsubscribeEventHandlers();
                    this.wscObj             = null;
                    this.onMessageTriggered = false;
                    return;
                }
            }

            DA.SetData(0, this.wscObj.message);
            DA.SetData(1, WsObjectStatus.GetStatusName(this.wscObj.status));
            this.onMessageTriggered = false;
        }
Exemplo n.º 2
0
	private void wsObjectOnChange(object sender, EventArgs e)
	{
		this.Message = WsObjectStatus.GetStatusName(this.wscObj.status);
	}