Пример #1
0
        public static Guid GetLanguage(this ISymUnmanagedDocument document)
        {
            Guid result = default(Guid);
            int  hr     = document.GetLanguage(ref result);

            ThrowExceptionForHR(hr);
            return(result);
        }
        public static Guid GetLanguage(this ISymUnmanagedDocument document)
        {
            if (document == null)
            {
                throw new ArgumentNullException(nameof(document));
            }

            Guid result = default(Guid);

            ThrowExceptionForHR(document.GetLanguage(ref result));
            return(result);
        }
Пример #3
0
        /// <summary>
        /// Defines copy of <c>document</c> in new symbols file.
        /// </summary>
        /// <param name="document">Document to be copied</param>
        /// <returns>Instance of <c>ISymUnmanagedDocumentWriter</c>, which is used to write <c>document</c> in symbole file.</returns>
        public ISymUnmanagedDocumentWriter DefineDocument(ISymUnmanagedDocument document)
        {
            if (State != WriterState.Building)
            {
                throw new TranslatingException("ISym* interfaces were not initializde. (EnC)");
            }
            string url        = document.GetURL();
            Guid   type       = document.GetDocumentType();
            Guid   language   = document.GetLanguage();
            Guid   langVendor = document.GetLanguageVendor();
            IntPtr pUrl       = Marshal.StringToCoTaskMemUni(url);

            try{
                return(mWriter.__DefineDocument(pUrl, ref language, ref langVendor, ref type));
            } finally {
                Marshal.FreeCoTaskMem(pUrl);
            }
        }
Пример #4
0
 /// <summary>
 /// Defines copy of <c>document</c> in new symbols file.
 /// </summary>
 /// <param name="document">Document to be copied</param>
 /// <returns>Instance of <c>ISymUnmanagedDocumentWriter</c>, which is used to write <c>document</c> in symbole file.</returns>
 public ISymUnmanagedDocumentWriter DefineDocument(ISymUnmanagedDocument document)
 {
     if(State != WriterState.Building){
         throw new TranslatingException("ISym* interfaces were not initializde. (EnC)");
     }
     string url = document.GetURL();
     Guid type = document.GetDocumentType();
     Guid language = document.GetLanguage();
     Guid langVendor = document.GetLanguageVendor();
     IntPtr pUrl = Marshal.StringToCoTaskMemUni(url);
     try{
         return mWriter.__DefineDocument(pUrl,ref language,ref langVendor,ref type);
     } finally {
         Marshal.FreeCoTaskMem(pUrl);
     }
 }