コード例 #1
0
        /// <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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: VariableWrapperTests.cs プロジェクト: lulzzz/Photon
 public void GetStringValueSuccessfully()
 {
     Assert.That(wrapper.GetValue("String"), Is.EqualTo("World World!"));
 }
コード例 #4
0
ファイル: DocumentFrame.cs プロジェクト: unhammer/gimp-sharp
        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);
        }