private static void CheckError(int hr, String operation) { if (hr != Constants.S_OK) { VsfPackage.LogInfo("{0} returned 0x{1:x8}", operation, hr); throw new InvalidOperationException(String.Format("{0} returned 0x{1:x8}", operation, hr)); } }
public static ITextBuffer GetPrimaryBuffer(ITextView view) { var buffers = view.BufferGraph.GetTextBuffers( (x) => !x.ContentType.IsOfType("projection") ); if (buffers.Count <= 0) { VsfPackage.LogInfo("Could not find a primary buffer on view: {0}", view); return(view.BufferGraph.TopBuffer); } return(buffers[0]); }