public RibbonFactoryController(
            IViewContextProvider viewContextProvider,
            VstoContribContext vstoContribContext)
        {
            this.vstoContribContext = vstoContribContext;
            var ribbonTypes = GetTRibbonTypesInAssemblies(vstoContribContext.Assemblies).ToList();

            customTaskPaneRegister = new CustomTaskPaneRegister(vstoContribContext.AddinBase);
            ribbonViewModelResolver = new ViewModelResolver(
                ribbonTypes, customTaskPaneRegister, viewContextProvider, 
                vstoContribContext);

            var ribbonXmlRewriter = new RibbonXmlRewriter(vstoContribContext, ribbonViewModelResolver);

            var loadExpression = ((Expression<Action<RibbonFactory>>)(r => r.Ribbon_Load(null)));
            string loadMethodName = loadExpression.GetMethodName();

            foreach (Type viewModelType in ribbonTypes)
            {
                ribbonXmlRewriter.LocateAndRegisterViewXml(viewModelType, loadMethodName, vstoContribContext.FallbackRibbonType);
            }
        }
 public RibbonXmlRewriter(VstoContribContext vstoContribContext, ViewModelResolver ribbonViewModelResolver)
 {
     controlCallbackLookup = new ControlCallbackLookup();
     this.vstoContribContext = vstoContribContext;
     this.ribbonViewModelResolver = ribbonViewModelResolver;
 }