コード例 #1
0
        internal void UpdateFromProxy(Proxy_Task proxy)
        {
            this.uuid               = (proxy.uuid == null) ? null : proxy.uuid;
            this.name_label         = (proxy.name_label == null) ? null : proxy.name_label;
            this.name_description   = (proxy.name_description == null) ? null : proxy.name_description;
            this.allowed_operations = (proxy.allowed_operations == null) ? null : Helper.StringArrayToEnumList <task_allowed_operations>(proxy.allowed_operations);
            this.current_operations = (proxy.current_operations == null) ? null : Maps.convert_from_proxy_string_task_allowed_operations(proxy.current_operations);
            this.created            = proxy.created;
            this.finished           = proxy.finished;
            this.status             = (proxy.status == null) ? task_status_type.pending : ((task_status_type)Helper.EnumParseDefault(typeof(task_status_type), proxy.status));
            this.resident_on        = (proxy.resident_on == null) ? null : XenRef <Host> .Create(proxy.resident_on);

            this.progress     = Convert.ToDouble(proxy.progress);
            this.type         = (proxy.type == null) ? null : proxy.type;
            this.result       = (proxy.result == null) ? null : proxy.result;
            this.error_info   = (proxy.error_info == null) ? new string[0] : proxy.error_info;
            this.other_config = (proxy.other_config == null) ? null : Maps.convert_from_proxy_string_string(proxy.other_config);
            this.subtask_of   = (proxy.subtask_of == null) ? null : XenRef <Task> .Create(proxy.subtask_of);

            this.subtasks = (proxy.subtasks == null) ? null : XenRef <Task> .Create(proxy.subtasks);
        }
コード例 #2
0
 public Task(Proxy_Task proxy)
 {
     this.UpdateFromProxy(proxy);
 }