public static MefServices GetForTextBuffer(ITextBuffer buf) { if (buf == null) { return(null); } MefServices svc; if (buf.Properties.TryGetProperty <MefServices>(typeof(MefServices), out svc) && svc != null) { return(svc); } svc = new MefServices(); buf.Properties[typeof(MefServices)] = svc; return(svc); }
private static MefServices GetForTextView(IWpfTextView wpfView) { if (wpfView == null) { return(null); } MefServices svc; if (wpfView.Properties.TryGetProperty <MefServices>(typeof(MefServices), out svc) && svc != null) { return(svc); } svc = new MefServices(); wpfView.Properties[typeof(MefServices)] = svc; return(svc); }