Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

In the simplest case your extension is immediately active in all Beebox projects and has no configuration options. In this page we discuss configuration options.

Activate extension by default: Yes/No

Specifies whether your extension, upon installation, is immediately activated in all Beebox projects or not. Make sure to chose the right option.

Your preference is coded using the EnableByDefault property:

		public override bool EnableByDefault { get { return true; } }

 

If you return true, the extension is automatically enabled in all Beebox projects upon installation. If you return false, it is disabled.

The Beebox administrator can explicitly enable or disable your extension individually per project from the project settings page:

 

Adding parameters to an extension

In the screenshot above you can see that the last extension has a parameter. This parameter can be changed individually per project. For example, if your extension copies translated files then the parameter may be the target directory and the Beebox administrator can change the path from one project to the next.

Adding parameters starts with implementing the three methods below:

		/// <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 location."; } 
		}
 
 
 
		/// <summary>
		/// Gets the default value of the parameter. Default can be changed by user.
		/// </summary>
		public override string ParameterDefault { get { return @"c:\hello\world"; } }
 
 
 
		/// <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
				return null;
			}
			catch (Exception e)
			{
				return "The parameter is not correct.";
			}
		}

 

 

 

 

 

  • No labels