コード例 #1
0
 public SchedulerStatus(JToken node) : base(node)
 {
     if (node["id"] != null)
     {
         this._Id = ParseInt(node["id"].Value <string>());
     }
     if (node["schedulerConfiguredId"] != null)
     {
         this._SchedulerConfiguredId = ParseInt(node["schedulerConfiguredId"].Value <string>());
     }
     if (node["workerConfiguredId"] != null)
     {
         this._WorkerConfiguredId = ParseInt(node["workerConfiguredId"].Value <string>());
     }
     if (node["workerType"] != null)
     {
         this._WorkerType = (BatchJobType)StringEnum.Parse(typeof(BatchJobType), node["workerType"].Value <string>());
     }
     if (node["type"] != null)
     {
         this._Type = (SchedulerStatusType)ParseEnum(typeof(SchedulerStatusType), node["type"].Value <string>());
     }
     if (node["value"] != null)
     {
         this._Value = ParseInt(node["value"].Value <string>());
     }
     if (node["schedulerId"] != null)
     {
         this._SchedulerId = ParseInt(node["schedulerId"].Value <string>());
     }
     if (node["workerId"] != null)
     {
         this._WorkerId = ParseInt(node["workerId"].Value <string>());
     }
 }
コード例 #2
0
        public SchedulerStatus(XmlElement node) : base(node)
        {
            foreach (XmlElement propertyNode in node.ChildNodes)
            {
                switch (propertyNode.Name)
                {
                case "id":
                    this._Id = ParseInt(propertyNode.InnerText);
                    continue;

                case "schedulerConfiguredId":
                    this._SchedulerConfiguredId = ParseInt(propertyNode.InnerText);
                    continue;

                case "workerConfiguredId":
                    this._WorkerConfiguredId = ParseInt(propertyNode.InnerText);
                    continue;

                case "workerType":
                    this._WorkerType = (BatchJobType)StringEnum.Parse(typeof(BatchJobType), propertyNode.InnerText);
                    continue;

                case "type":
                    this._Type = (SchedulerStatusType)ParseEnum(typeof(SchedulerStatusType), propertyNode.InnerText);
                    continue;

                case "value":
                    this._Value = ParseInt(propertyNode.InnerText);
                    continue;

                case "schedulerId":
                    this._SchedulerId = ParseInt(propertyNode.InnerText);
                    continue;

                case "workerId":
                    this._WorkerId = ParseInt(propertyNode.InnerText);
                    continue;
                }
            }
        }