public void setLayout(TopLevelLayout properties) { this.layout = properties; }
/// <summary> /// Parses and creates layout properties of whole component. /// Exception thrown if any error happened during parsing layout properties /// </summary> /// <param name="layoutJson">JSON object with layout properties</param> /// <returns>Layout of whole component</returns> private TopLevelLayout createTopLayoutProperties(JsonObject layoutJson) { TopLevelLayout layoutProp = new TopLevelLayout(); if (layoutJson == null) { layoutProp.setLayoutDefinition(LayoutDefinitions.ONECOLUMNLAYOUT); layoutProp.setLayoutOrientation(LayoutOrientation.AXISX); return layoutProp; //with default values } try { String layDefName = (String)Utils.TryToGetValueFromJson(layoutJson[Constants.LAYOUT_DEF]); LayoutDefinitions layDef = Utils.ValueOf<LayoutDefinitions>(typeof(LayoutDefinitions), layDefName); if (layDef != null) { layoutProp.setLayoutDefinition(layDef); } String orientation = (String)Utils.TryToGetValueFromJson(layoutJson[Constants.LAYOUT_ORIENT]); LayoutOrientation layOrient = Utils.ValueOf<LayoutOrientation>(typeof(LayoutOrientation), orientation); if (layOrient != null) { layoutProp.setLayoutOrientation(layOrient); } } catch (Exception e) { Debug.WriteLine(e.Message); //e.printStackTrace(); } return layoutProp; }