public SurveyTemplate() { InitializeComponent(); _Template = new API.Template(null); _HappyProperty = _Template.GetTemplateProperty("Happy"); _NeutralProperty = _Template.GetTemplateProperty("Neutral"); _SadProperty = _Template.GetTemplateProperty("Sad"); }
public SurveyTemplate() { InitializeComponent(); _Template = new API.Template(null); _HappyProperty = _Template.GetTemplateProperty("Happy"); _NeutralProperty = _Template.GetTemplateProperty("Neutral"); _SadProperty = _Template.GetTemplateProperty("Sad"); }
private void Increment(ITemplateProperty property) { try { int value = 0; if (!string.IsNullOrEmpty(property.Value)) { if (!Int32.TryParse(property.Value, out value)) { _Template.SetState("Increment", API.State.Error, "Failed to read value " + property.Value); } } property.Value = Convert.ToString(value + 1); property.Save(); _Template.SetState("Increment", API.State.OK, ""); } catch(Exception ex) { _Template.SetState("Increment", API.State.Error, "Failed to increment. " + ex.Message); } }
private void Increment(ITemplateProperty property) { try { int value = 0; if (!string.IsNullOrEmpty(property.Value)) { if (!Int32.TryParse(property.Value, out value)) { _Template.SetState("Increment", API.State.Error, "Failed to read value " + property.Value); } } property.Value = Convert.ToString(value + 1); property.Save(); _Template.SetState("Increment", API.State.OK, ""); } catch (Exception ex) { _Template.SetState("Increment", API.State.Error, "Failed to increment. " + ex.Message); } }
/// <summary> /// Adds a child template property /// </summary> /// <param name="toAdd">The child to add</param> public void AddChild(ITemplateProperty toAdd) { this.Children.Add(toAdd); }