예제 #1
0
        /// <summary>
        /// <param name="atStr" />
        /// <param name="data" />
        /// </summary>
        public RouterActivitySample(string atStr, object data)
        {
            this._At          = ((System.DateTime)(Util.Str2date(atStr)));
            this._IsAvailable = true;
            object v = null;

            v = (data as System.Collections.Generic.Dictionary <string, object>)["Out"];
            if (v == null)
            {
                this._IsAvailable = false;
            }
            else
            {
                this._Outgoing = ((double)(v));
            }
            v = (data as System.Collections.Generic.Dictionary <string, object>)["In"];
            if (v == null)
            {
                this._IsAvailable = false;
            }
            else
            {
                this._Incoming = ((double)(v));
            }
        }
        /// <summary>
        /// <param name="atStr" />
        /// <param name="data" />
        /// </summary>
        public IfaceActivitySample(string atStr, object data)
        {
            this._At          = ((System.DateTime)(Util.Str2date(atStr)));
            this._IsAvailable = true;
            object v = null;

            v = (data as System.Collections.Generic.Dictionary <string, object>)["Send"];
            if (v == null)
            {
                this._IsAvailable = false;
            }
            else
            {
                this._Send = ((double)(v));
            }
            v = (data as System.Collections.Generic.Dictionary <string, object>)["Receive"];
            if (v == null)
            {
                this._IsAvailable = false;
            }
            else
            {
                this._Receive = ((double)(v));
            }
        }
예제 #3
0
        /// <summary>
        /// <param name="atStr" />
        /// <param name="data" />
        /// </summary>
        public ServerActivitySample(string atStr, object data)
        {
            this._At          = ((System.DateTime)(Util.Str2date(atStr)));
            this._IsAvailable = false;
            object v = (data as System.Collections.Generic.Dictionary <string, object>)["CPU-TIME"];

            if (v != null)
            {
                this._IsAvailable = true;
                this._CpuTime     = ((double)(v));
            }
        }
예제 #4
0
 /// <summary>(This method is generated in Translator_default#buildImpl)
 ///
 /// <param name="r" />
 /// </summary>
 internal override void ApiDeserializeImpl(object r)
 {
     this.IsNew = r == null;
     if (this.IsNew)
     {
         r = new System.Collections.Generic.Dictionary <string, object> {
         };
     }
     this.IsIncomplete = false;
     if (Util.ExistsPath(r, "Status"))
     {
         this.M_status = Util.GetByPath(r, "Status") == null ? ((string)(null)) : "" + Util.GetByPath(r, "Status");
     }
     else
     {
         this.M_status     = null;
         this.IsIncomplete = true;
     }
     this.N_status = false;
     if (Util.ExistsPath(r, "BeforeStatus"))
     {
         this.M_beforeStatus = Util.GetByPath(r, "BeforeStatus") == null ? ((string)(null)) : "" + Util.GetByPath(r, "BeforeStatus");
     }
     else
     {
         this.M_beforeStatus = null;
         this.IsIncomplete   = true;
     }
     this.N_beforeStatus = false;
     if (Util.ExistsPath(r, "StatusChangedAt"))
     {
         this.M_statusChangedAt = Util.GetByPath(r, "StatusChangedAt") == null ? ((System.DateTime?)(null)) : Util.Str2date("" + Util.GetByPath(r, "StatusChangedAt"));
     }
     else
     {
         this.M_statusChangedAt = null;
         this.IsIncomplete      = true;
     }
     this.N_statusChangedAt = false;
     if (Util.ExistsPath(r, "CDROM"))
     {
         this.M_isoImage = Util.GetByPath(r, "CDROM") == null ? null : new IsoImage(this._Client, Util.GetByPath(r, "CDROM"));
     }
     else
     {
         this.M_isoImage   = null;
         this.IsIncomplete = true;
     }
     this.N_isoImage = false;
 }