|
6#
楼主 |
发表于 2014-3-14 23:59:05
|
只看该作者
本帖最后由 faunus 于 2014-3-15 00:08 编辑
再进一步,找到这个位置:
- private static object ButtonClickCallback(RibbonComponentImpl component, object[] args)
- {
- if (component != null)
- {
- Microsoft.Office.Core.IRibbonControl parameter = RibbonMethodInfo.GetParameter<Microsoft.Office.Core.IRibbonControl>(args, 0);
- component.properties.ControlActionRaise(parameter);
- }
- return null;
- }
复制代码 ControlActionRaise 被这里调用了,又是谁在发起?
- internal static void RegisterCallbacks(RibbonManagerImpl manager)
- {
- manager.AddCallback(RibbonMethodInfo.GetValueMethod(manager, "ButtonClick", new RibbonComponentCallback(RibbonPropertyStorage.ButtonClickCallback)));
- manager.AddCallback(RibbonMethodInfo.CheckBoxActionMethod(manager, "CheckBoxClick", new RibbonComponentCallback(RibbonPropertyStorage.CheckBoxClickCallback)));
- manager.AddCallback(RibbonMethodInfo.GetValueMethod(manager, "GetChecked", new RibbonComponentCallback(RibbonPropertyStorage.CheckedCallback)));
- manager.AddCallback(RibbonMethodInfo.GetValueMethod(manager, "GetDescription", new RibbonComponentCallback(RibbonPropertyStorage.DescriptionCallback)));
- manager.AddCallback(RibbonMethodInfo.GetValueMethod(manager, "GetEnabled", new RibbonComponentCallback(RibbonPropertyStorage.EnabledCallback)));
- manager.AddCallback(RibbonMethodInfo.GetValueMethod(manager, "GetImage", new RibbonComponentCallback(RibbonPropertyStorage.ImageCallback)));
- manager.AddCallback(RibbonMethodInfo.GetValueMethod(manager, "GetKeyTip", new RibbonComponentCallback(RibbonPropertyStorage.KeyTipCallback)));
- manager.AddCallback(RibbonMethodInfo.GetValueMethod(manager, "GetLabel", new RibbonComponentCallback(RibbonPropertyStorage.LabelCallback)));
- manager.AddCallback(RibbonMethodInfo.GetValueMethod(manager, "GetScreenTip", new RibbonComponentCallback(RibbonPropertyStorage.ScreenTipCallback)));
- manager.AddCallback(RibbonMethodInfo.GetValueMethod(manager, "GetShowImage", new RibbonComponentCallback(RibbonPropertyStorage.ShowImageCallback)));
- manager.AddCallback(RibbonMethodInfo.GetValueMethod(manager, "GetShowLabel", new RibbonComponentCallback(RibbonPropertyStorage.ShowLabelCallback)));
- manager.AddCallback(RibbonMethodInfo.GetValueMethod(manager, "GetSize", new RibbonComponentCallback(RibbonPropertyStorage.SizeCallback)));
- manager.AddCallback(RibbonMethodInfo.GetValueMethod(manager, "GetSuperTip", new RibbonComponentCallback(RibbonPropertyStorage.SuperTipCallback)));
- manager.AddCallback(RibbonMethodInfo.GetValueMethod(manager, "GetText", new RibbonComponentCallback(RibbonPropertyStorage.TextCallback)));
- manager.AddCallback(RibbonMethodInfo.TextChangedMethod(manager, "TextChanged", new RibbonComponentCallback(RibbonPropertyStorage.TextChangedCallback)));
- manager.AddCallback(RibbonMethodInfo.GetValueMethod(manager, "GetTitle", new RibbonComponentCallback(RibbonPropertyStorage.TitleCallback)));
- manager.AddCallback(RibbonMethodInfo.GetValueMethod(manager, "GetVisible", new RibbonComponentCallback(RibbonPropertyStorage.VisibleCallback)));
- }
复制代码 在这里注册登记先,看来是消息中心所在地了...
- internal Dictionary<string, RibbonMethodInfo> Callbacks
- {
- get
- {
- if (this.callbacks == null)
- {
- this.callbacks = new Dictionary<string, RibbonMethodInfo>();
- OfficeRibbonImpl.RegisterCallbacks(this);
- RibbonDialogLauncherImpl.RegisterCallbacks(this);
- RibbonDropDownItemCollection.RegisterCallbacks(this);
- RibbonGalleryImpl.RegisterCallbacks(this);
- RibbonMenuImpl.RegisterCallbacks(this);
- RibbonPropertyStorage.RegisterCallbacks(this);
- }
- return this.callbacks;
- }
- }
复制代码 他又是在这里登记的,Callbacks备用啊。看到 消息 机制定然在 以下这个类中安家了:
- internal sealed class RibbonManagerImpl : RibbonManager, Microsoft.Office.Core.IRibbonExtensibility, IReflect, IDisposable
复制代码 泥马,这个类好庞大的说,不太好跟了...
|
|