This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyBarManager.cs
52 lines (48 loc) · 1.67 KB
/
MyBarManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraBars;
using DevExpress.XtraBars.Styles;
using DevExpress.XtraBars.ViewInfo;
using DevExpress.XtraBars.Painters;
namespace WindowsApplication3
{
public class MyBarManager : BarManager
{
public MyBarManager(IContainer cont) : base(cont) { }
public delegate void ArrowClickEventHandler(object sender, ArrowClickEventArgs e);
public event ArrowClickEventHandler ArrowItemClick;
protected virtual void UpdateBarItemInfo()
{
foreach (BarManagerPaintStyle ps in GetController().PaintStyles)
{
if (ps is SkinBarManagerPaintStyle)
{
foreach (BarItemInfo info in ps.ItemInfoCollection)
{
if (info.Name == "BarButtonItem")
{
ps.ItemInfoCollection.Remove(info);
ps.ItemInfoCollection.Add(new BarItemInfo("BarButtonItem", "Button", 0, typeof(BarButtonItem), typeof(MyBarButtonItemLink), typeof(BarButtonLinkViewInfo), new BarButtonLinkPainter(ps), true, true));
return;
}
}
}
}
}
protected override void OnLoaded()
{
base.OnLoaded();
UpdateBarItemInfo();
}
internal void RaiseArrowItemClick(ArrowClickEventArgs e)
{
if (ArrowItemClick != null)
ArrowItemClick(this, e);
}
}
}