Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
		/// <summary>
		/// Gets optional help description (not html!) of the configuration parameter.
		/// By returning a non-null value, you explicitly tell the Beebox that this extension has a configurable parameter.
		/// </summary>
		public override string ParameterHelp 
		{ 
			get { return "Fill in a directory locationfilter type, either one of 'alpha', 'beta' or 'gamma'."; } 
		}
 
 
 
		/// <summary>
		/// Gets the default value of the parameter. Default can be changed by user.
		/// </summary>
		public override string ParameterDefault { get { return @"c:\hello\world"alpha"; } }
 
 
 
		/// <summary>
		/// Validates the user parameters.
		/// Return null if ok, otherwise return an error text.
		/// </summary>
		/// <param name="parameter">The parameter edited by a user.</param>
		/// <returns>Null: parameter is ok. Otherwise return an error message.</returns>
		public override string ValidateParameter(string parameter)
		{
			try
			{
 				// Check validity of the parameter value
if (parameter != "alpha" && parameter != "beta" && parameter != "gamma") 
					return "Wrong parameter value!";
				else
					return null;
			}
			catch (Exception e) 			{ 				return "The parameter is not correct."; 			}
		}

 

The last step is to process the configuration parameter passed to the main method of each extension. Example:

...