예제 #1
0
 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));
     }
 }
예제 #2
0
파일: TextEditor.cs 프로젝트: xwiz/viasfora
        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]);
        }