public Services(DTE2 dte, ProjectColoredFramePackage package) { MappingEvents = new MappingEventsDispatcher(); _solutionChangeListener = new SolutionChangeListener(dte); _solutionChangeListener.MappingBecameDirty += (s, e) => Remap(package); MappingEvents.OptionsChanged += (s, e) => RemapSilently(package); _dte = dte; Remap(package); }
private void RemapSilently(ProjectColoredFramePackage package) => Mapping = ColorDecider.Create(_dte.Solution, package.Settings);
// TODO: It's weird that Services handles remap on relevant events, clearly breaks SRP. private void Remap(ProjectColoredFramePackage package) { RemapSilently(package); MappingEvents.RaiseMappingChanged(Mapping); }