/// <summary>Gets the content of a named variable.</summary> /// <param name="variableString">The variable name.</param> /// <returns>The variable value, if found; null otherwise.</returns> public string GetValue(string variableString) { string variable = null; if (Custom != null) { // Custom variables take top priority - is it overriden? variable = Custom.GetValue(variableString); if (variable != null) { return(variable); } } if (Language != null) { // Language takes next priority - is this variable found in the language? variable = Language.GetValue(variableString); if (variable != null) { return(variable); } } // Neither language or custom wanted it - how about the event? if (OnFind != null) { return(OnFind(variableString)); } return(null); }
void CreatePageSizeWidget(VariableSet variables, LayoutSet layoutSet) { int resolution = variables.GetValue <int>("resolution"); _size = ComboBox.NewText(); FillPageSizeMenu(layoutSet, resolution); _size.Changed += delegate { _layoutSet = layoutSet.GetLayouts(_sizes[_size.Active], resolution); FillLayoutMenu(_layoutSet); }; AttachAligned(0, 0, _("_Page Size:"), 0.0, 0.5, _size, 2, false); }
public void GetStringValueSuccessfully() { Assert.That(wrapper.GetValue("String"), Is.EqualTo("World World!")); }
void CreatePageSizeWidget(VariableSet variables, LayoutSet layoutSet) { int resolution = variables.GetValue<int>("resolution"); _size = ComboBox.NewText(); FillPageSizeMenu(layoutSet, resolution); _size.Changed += delegate { _layoutSet = layoutSet.GetLayouts(_sizes[_size.Active], resolution); FillLayoutMenu(_layoutSet); }; AttachAligned(0, 0, _("_Page Size:"), 0.0, 0.5, _size, 2, false); }