private void  fromJSONOperation(JSONValue json_value, bool ignore_extras)
    {
        Debug.Assert(json_value != null);
        HomeAutomationOperationJSON convert_classy = HomeAutomationOperationJSON.from_json(json_value, ignore_extras, true);

        setOperation(convert_classy);
    }
Exemplo n.º 2
0
    private void  fromJSONOperations(JSONValue json_value, bool ignore_extras)
    {
        Debug.Assert(json_value != null);
        JSONArrayValue json_array1 = json_value.array_value();

        if (json_array1 == null)
        {
            throw new Exception("The value for field Operations of HomeAutomationQueryHintJSON is not an array.");
        }
        int count1 = json_array1.componentCount();

        if (count1 < 1)
        {
            throw new Exception("The value for field Operations of HomeAutomationQueryHintJSON has too few elements.");
        }
        List <HomeAutomationOperationJSON> vector_Operations1 = new List <HomeAutomationOperationJSON>(count1);

        for (int num1 = 0; num1 < count1; ++num1)
        {
            HomeAutomationOperationJSON convert_classy = HomeAutomationOperationJSON.from_json(json_array1.component(num1), ignore_extras, true);
            vector_Operations1.Add(convert_classy);
        }
        Debug.Assert(vector_Operations1.Count >= 1);
        initOperations();
        for (int num1 = 0; num1 < vector_Operations1.Count; ++num1)
        {
            appendOperations(vector_Operations1[num1]);
        }
        for (int num1 = 0; num1 < vector_Operations1.Count; ++num1)
        {
        }
    }
    private void  fromJSONCapabilities(JSONValue json_value, bool ignore_extras)
    {
        Debug.Assert(json_value != null);
        JSONArrayValue json_array1 = json_value.array_value();

        if (json_array1 == null)
        {
            throw new Exception("The value for field Capabilities of HomeAutomationDeviceJSON is not an array.");
        }
        int count1 = json_array1.componentCount();
        List <HomeAutomationOperationJSON> vector_Capabilities1 = new List <HomeAutomationOperationJSON>(count1);

        for (int num1 = 0; num1 < count1; ++num1)
        {
            HomeAutomationOperationJSON convert_classy = HomeAutomationOperationJSON.from_json(json_array1.component(num1), ignore_extras, true);
            vector_Capabilities1.Add(convert_classy);
        }
        initCapabilities();
        for (int num1 = 0; num1 < vector_Capabilities1.Count; ++num1)
        {
            appendCapabilities(vector_Capabilities1[num1]);
        }
        for (int num1 = 0; num1 < vector_Capabilities1.Count; ++num1)
        {
        }
    }
 public void setOperation(HomeAutomationOperationJSON new_value)
 {
     if (flagHasOperation)
     {
     }
     flagHasOperation = true;
     storeOperation   = new_value;
 }
Exemplo n.º 5
0
 public void appendOperations(HomeAutomationOperationJSON to_append)
 {
     if (!flagHasOperations)
     {
         flagHasOperations = true;
         storeOperations.Clear();
     }
     Debug.Assert(flagHasOperations);
     storeOperations.Add(to_append);
 }
 public void appendCapabilities(HomeAutomationOperationJSON to_append)
 {
     if (!flagHasCapabilities)
     {
         flagHasCapabilities = true;
         storeCapabilities.Clear();
     }
     Debug.Assert(flagHasCapabilities);
     storeCapabilities.Add(to_append);
 }
Exemplo n.º 7
0
 public void appendOperations(string chars)
 {
     HomeAutomationOperationJSON.TypeValueKnownValues known     = HomeAutomationOperationJSON.stringToValue(chars);
     HomeAutomationOperationJSON.TypeValue            new_value = new HomeAutomationOperationJSON.TypeValue();
     if (known == HomeAutomationOperationJSON.TypeValueKnownValues.Value__none)
     {
         new_value.in_known_list = false;
         new_value.string_value  = chars;
     }
     else
     {
         new_value.in_known_list = true;
         new_value.list_value    = known;
     }
     appendOperations(new_value);
 }