Example #1
0
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Sets properties for a menu bar or toolbar.
		/// </summary>
		/// <param name="bar">Bar to update.</param>
		/// <param name="barProps">New properties of bar.</param>
		/// ------------------------------------------------------------------------------------
		private void SetBarProperties(Bar bar, TMBarProperties barProps)
		{
			if (bar == null || barProps == null || !barProps.Update)
				return;

			if (barProps.Text != bar.Text)
				bar.Text = barProps.Text;

			if (barProps.Enabled != bar.Enabled)
				bar.Enabled = barProps.Enabled;

			if (barProps.Visible != bar.Visible)
			{
				if (barProps.Visible)
					bar.Show();
				else
					bar.Hide();
			}
		}