private void InitContextMenu()
		{
			_barManager.BeginInit();

			var colorEditor = new RepositoryItemHtmlColorEdit
			{
				AutoHeight = false,
			};
			colorEditor.Buttons.Clear();
			colorEditor.Buttons.AddRange(new[] { new EditorButton(ButtonPredefines.Ellipsis) });
			colorEditor.OnColorSelected += (o, e) =>
			{
				_barManager.CloseMenus();
			};

			var maxId = _barManager.MaxItemId++;

			ItemBoldFont = new BarCheckItem
			{
				Id = maxId,
				Caption = "Bold",
				CheckBoxVisibility = CheckBoxVisibility.AfterText
			};

			var boldFont = new Font(ItemBoldFont.ItemInMenuAppearance.Normal.Font.Name,
				ItemBoldFont.ItemInMenuAppearance.Normal.Font.Size, FontStyle.Bold);
			ItemBoldFont.ItemInMenuAppearance.Normal.Font = boldFont;
			ItemBoldFont.ItemInMenuAppearance.Pressed.Font = boldFont;
			ItemBoldFont.ItemInMenuAppearance.Hovered.Font = boldFont;

			ItemBoldFont.CheckedChanged += (o, e) => LibraryObjectLoader.OnFontChanged();
			maxId++;

			ItemItalicFont = new BarCheckItem
			{
				Id = maxId,
				Caption = "Italics",
				CheckBoxVisibility = CheckBoxVisibility.AfterText
			};

			var italicFont = new Font(ItemItalicFont.ItemInMenuAppearance.Normal.Font.Name,
				ItemItalicFont.ItemInMenuAppearance.Normal.Font.Size, FontStyle.Italic);
			ItemItalicFont.ItemInMenuAppearance.Normal.Font = italicFont;
			ItemItalicFont.ItemInMenuAppearance.Pressed.Font = italicFont;
			ItemItalicFont.ItemInMenuAppearance.Hovered.Font = italicFont;

			ItemItalicFont.CheckedChanged += (o, e) => LibraryObjectLoader.OnFontChanged();
			maxId++;

			ItemUnderlinedFont = new BarCheckItem
			{
				Id = maxId,
				Caption = "Underline",
				CheckBoxVisibility = CheckBoxVisibility.AfterText
			};

			var underlineFont = new Font(ItemUnderlinedFont.ItemInMenuAppearance.Normal.Font.Name,
				ItemUnderlinedFont.ItemInMenuAppearance.Normal.Font.Size, FontStyle.Underline);
			ItemUnderlinedFont.ItemInMenuAppearance.Normal.Font = underlineFont;
			ItemUnderlinedFont.ItemInMenuAppearance.Pressed.Font = underlineFont;
			ItemUnderlinedFont.ItemInMenuAppearance.Hovered.Font = underlineFont;

			ItemUnderlinedFont.CheckedChanged += (o, e) => LibraryObjectLoader.OnFontChanged();
			maxId++;

			ItemFontColor = new BarEditItem
			{
				Id = maxId,
				Caption = "Font Color  ",
				Edit = colorEditor,
				Width = 150
			};
			maxId++;
			ItemFontColor.EditValueChanged += (o, e) =>
			{
				LibraryObjectLoader.OnColorChanged();
				_barManager.CloseMenus();
			};

			_barManager.Items.Add(ItemBoldFont);
			_barManager.Items.Add(ItemItalicFont);
			_barManager.Items.Add(ItemUnderlinedFont);
			_barManager.Items.Add(ItemFontColor);
			_barManager.MaxItemId = maxId;

			_barManager.EndInit();
		}
		private void InitContextMenu()
		{
			_barManager.BeginInit();

			var buttonEditor = new RepositoryItemButtonEdit { AutoHeight = false };
			buttonEditor.Buttons.Clear();
			buttonEditor.Buttons.AddRange(new[]
			{
				new EditorButton(ButtonPredefines.Delete)
			});
			buttonEditor.ButtonClick += (o, e) =>
			{
				((ButtonEdit)o).EditValue = null;
			};

			var colorEditor = new RepositoryItemHtmlColorEdit
			{
				AutoHeight = false,
			};
			colorEditor.Buttons.Clear();
			colorEditor.Buttons.AddRange(new[] { new EditorButton(ButtonPredefines.Ellipsis) });
			colorEditor.OnColorSelected += (o, e) =>
			{
				_barManager.CloseMenus();
			};

			var maxId = _barManager.MaxItemId++;

			var linkNoteControlButtonCollection = new List<BarItem>();
			ItemLinkNoteCustom = new BarEditItem
			{
				Id = maxId,
				Caption = "Custom",
				Edit = buttonEditor,
				Width = 150
			};
			ItemLinkNoteCustom.EditValueChanged += (o, e) => LibraryObjectLoader.OnNoteChanged();
			maxId++;
			foreach (var noteText in LibraryObjectNotesLoader.PredefinedNotes)
			{
				var itemLinkNote = new BarButtonItem
				{
					Caption = noteText,
					Id = maxId,
					Tag = noteText
				};
				maxId++;
				itemLinkNote.ItemClick += (o, e) =>
				{
					var itemNoteText = e.Item.Tag as String;
					ItemLinkNoteCustom.EditValue = itemNoteText;
				};
				linkNoteControlButtonCollection.Add(itemLinkNote);
			}
			linkNoteControlButtonCollection.Add(ItemLinkNoteCustom);
			ItemLinkNote = new BarSubItem();
			ItemLinkNote.Caption = "Link Note";
			ItemLinkNote.Id = maxId;
			_barManager.Items.AddRange(linkNoteControlButtonCollection.ToArray());
			ItemLinkNote.LinksPersistInfo.AddRange(linkNoteControlButtonCollection
				.Select(barItem => new LinkPersistInfo(barItem)).ToArray());
			maxId++;

			ItemHoverNote = new BarEditItem
			{
				Id = maxId,
				Caption = "Hover Note",
				Edit = buttonEditor,
				Width = 150
			};
			maxId++;
			ItemHoverNote.EditValueChanged += (o, e) => LibraryObjectLoader.OnHoverChanged();

			_barManager.Items.Add(ItemLinkNote);
			_barManager.Items.Add(ItemHoverNote);
			_barManager.MaxItemId = maxId;

			_barManager.EndInit();
		}
		private void InitContextMenu()
		{
			_barManager.BeginInit();

			var maxId = _barManager.MaxItemId++;

			var fontEditor = new RepositoryItemButtonEdit()
			{
				AutoHeight = false,
				TextEditStyle = TextEditStyles.DisableTextEditor
			};
			fontEditor.Buttons.Clear();
			fontEditor.Buttons.AddRange(new[] { new EditorButton(ButtonPredefines.Ellipsis) });
			var fontEditHandler = new Action<object, EventArgs>((o, e) =>
			{
				using (var dlgFont = new FontDialog())
				{
					dlgFont.Font = ItemFont.Tag as Font;
					if (dlgFont.ShowDialog() != DialogResult.OK) return;
					ItemFont.Tag = dlgFont.Font;
					ItemFont.EditValue = Utils.FontToString(dlgFont.Font);
				}
			});
			fontEditor.ButtonClick += (o, e) => fontEditHandler(o, e);
			fontEditor.Click += (o, e) => fontEditHandler(o, e);
			ItemFont = new BarEditItem
			{
				Id = maxId,
				Caption = "Font  ",
				Edit = fontEditor,
				Width = 150
			};
			ItemFont.EditValueChanged += (o, e) =>
			{
				LineBreakLoader.OnFontChanged();
				_barManager.CloseMenus();
			};
			maxId++;

			var colorEditor = new RepositoryItemHtmlColorEdit
			{
				AutoHeight = false,
			};
			colorEditor.Buttons.Clear();
			colorEditor.Buttons.AddRange(new[] { new EditorButton(ButtonPredefines.Ellipsis) });
			colorEditor.OnColorSelected += (o, e) =>
			{
				_barManager.CloseMenus();
			};
			ItemFontColor = new BarEditItem
			{
				Id = maxId,
				Caption = "Font Color  ",
				Edit = colorEditor,
				Width = 150
			};
			maxId++;
			ItemFontColor.EditValueChanged += (o, e) =>
			{
				LineBreakLoader.OnColorChanged();
				_barManager.CloseMenus();
			};

			_barManager.Items.Add(ItemFontColor);
			_barManager.MaxItemId = maxId;

			_barManager.EndInit();
		}