• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TranslationUnit类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TranslationUnit的典型用法代码示例。如果您正苦于以下问题:C# TranslationUnit类的具体用法?C# TranslationUnit怎么用?C# TranslationUnit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TranslationUnit类属于命名空间,在下文中一共展示了TranslationUnit类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AddOrUpdateTranslationUnitsMasked

        public ImportResult[] AddOrUpdateTranslationUnitsMasked(TranslationUnit[] translationUnits, int[] previousTranslationHashes, ImportSettings settings, bool[] mask)
        {
            var results =
                _fileBasedTranslationProviderLanguageDirection.AddOrUpdateTranslationUnitsMasked(translationUnits,
                    previousTranslationHashes, settings, mask);


            var tmDataAccess = TmDataAccess.OpenConnection(TranslationProvider.Uri);

            for (int i = 0; i < results.Length; i++)
            {
                var result = results[i];
                if (result == null) continue;
                var translationUnit = translationUnits[i];

                if (result.Action == Action.Add || result.Action == Action.Merge || result.Action == Action.Overwrite)
                {
                    var customFieldsValue = new CustomFieldValues
                    {
                        FileNameFullPath = translationUnit.GetFilePath(),
                        ProjectName = translationUnit.GetProjectName()
                    };
                    tmDataAccess.AddOrUpdateCustomFields(result.TuId.Id, customFieldsValue);
                }
            }

            return results;
        }
开发者ID:desautel,项目名称:Sdl-Community,代码行数:28,代码来源:RecordsSourceTuLanguageDirection.cs


示例2: Results

        internal unsafe Results(CodeCompletion.Library.CXCodeCompleteResults* handle, TranslationUnit tu)
        {
            Int64 ii = Library.clang_codeCompleteGetContexts(handle);

            _handleToDispose = handle;
            _handle = *handle;
            _results = new List<Result>();

            bool print = _handle.NumberResults <= 100;
            for(uint i = 0;i < _handle.NumberResults; i++)
            {
                //Library.CXCompletionResult r = _handle.Results[i];
                Result r = new Result(_handle.Results[i]);
                _results.Add(r);
                if(print)
                    System.Diagnostics.Debug.WriteLine(r);
            }
            if(!print)
                System.Diagnostics.Debug.WriteLine("too many results");

          /*  List<LibClang.Diagnostic> diags = new List<Diagnostic>();
            for(uint d = 0; d < Library.clang_codeCompleteGetNumDiagnostics(_handleToDispose); d++)
            {
                Diagnostic diag = new Diagnostic(Library.clang_codeCompleteGetDiagnostic(handle, d), tu.ItemFactory);
                
                System.Diagnostics.Debug.WriteLine(diag + " " + diag.Location);
            }*/
        }
开发者ID:JadeHub,项目名称:Jade,代码行数:28,代码来源:CompletionResults.cs


示例3: CompleteAt

 static unsafe internal Results CompleteAt(TranslationUnit tu, string fileName, int line, int col, LibClang.Library.UnsavedFile[] unsaved)
 {
     uint options = CodeCompletion.Library.clang_defaultCodeCompleteOptions();
     CodeCompletion.Library.CXCodeCompleteResults* results = CodeCompletion.Library.clang_codeCompleteAt(tu.Handle, fileName, (uint)line, (uint)col,
                                                                                     unsaved.Length > 0 ? unsaved : null,
                                                                                     (uint)unsaved.Length,
                                                                                     3);/*
                                                                                     CodeCompletion.Library.clang_defaultCodeCompleteOptions());*/
     Int64 p = Library.clang_codeCompleteGetContexts(results);
     if (results != null && results->NumberResults > 0)
     {
         Results rs = new Results(results, tu);
         return rs;
     }
     return null;
 }
开发者ID:JadeHub,项目名称:Jade,代码行数:16,代码来源:CodeComplete.cs


示例4: Indexer

        private Indexer(TranslationUnit tu)
        {
            unsafe
            {
                _cbs = new Library.IndexerCallbacks();
                _cbs.abortQuery = OnIndexerAbortQuery;
                _cbs.diagnostic = OnIndexerDiagnostic;
                _cbs.enterMainFile = OnIndexerEnteredMainFile;
                _cbs.ppIncludedFile = OnIndexerPPIncludedFile;
                _cbs.astImportFile = OnIndexerImportedASTFile;
                _cbs.startTU = OnIndexerStartTranslationUnit;
                _cbs.index = OnIndexerDeclaration;
                _cbs.entityRef = OnIndexerEntityReference;

                _includeCallback = OnCxxIncludeVisit;
            }
            _translationUnit = tu;
        }
开发者ID:JadeHub,项目名称:Jade,代码行数:18,代码来源:Indexer.cs


示例5: AddOrUpdateTranslationUnits

        public ImportResult[] AddOrUpdateTranslationUnits(TranslationUnit[] translationUnits, int[] previousTranslationHashes, ImportSettings settings)
        {
            var results = _fileBasedTranslationProviderLanguageDirection.AddOrUpdateTranslationUnits(translationUnits,
                previousTranslationHashes, settings);
            var tmDataAccess = TmDataAccess.OpenConnection(TranslationProvider.Uri);

            for (int i = 0; i < results.Length; i++)
            {
                var result = results[i];
                if (result == null) continue;
                var translationUnit = translationUnits[i];

                if (result.Action == Action.Add || result.Action == Action.Merge || result.Action == Action.Overwrite)
                {
                    tmDataAccess.AddOrUpdateSourceFile(result.TuId.Id, translationUnit.DocumentProperties.LastOpenedAsPath);
                }
            }

            return results;
        }
开发者ID:poklestek,项目名称:Sdl-Community,代码行数:20,代码来源:AddSourceTmLanguageDirection.cs


示例6: AddTranslationUnit

        public ImportResult AddTranslationUnit(TranslationUnit translationUnit, ImportSettings settings)
        {
            var result =
                _fileBasedTranslationProviderLanguageDirection.AddTranslationUnit(translationUnit,
                    settings);
            if (result == null) return null;
            var tmDataAccess = TmDataAccess.OpenConnection(TranslationProvider.Uri);



            if (result.Action == Action.Add || result.Action == Action.Merge || result.Action == Action.Overwrite)
            {
                var customFieldsValue = new CustomFieldValues
                {
                    FileNameFullPath = translationUnit.GetFilePath(),
                    ProjectName = translationUnit.GetProjectName()
                };
                tmDataAccess.AddOrUpdateCustomFields(result.TuId.Id, customFieldsValue);
            }

            return result;
        }
开发者ID:desautel,项目名称:Sdl-Community,代码行数:22,代码来源:RecordsSourceTuLanguageDirection.cs


示例7: TranslationUnit

 private TranslationUnit(TranslationUnit.Internal native)
     : this(__CopyValue(native))
 {
     __ownsNativeInstance = true;
     NativeToManagedMap[__Instance] = this;
 }
开发者ID:RainsSoft,项目名称:CppSharp,代码行数:6,代码来源:AST.cs


示例8: __CreateInstance

 public static TranslationUnit __CreateInstance(TranslationUnit.Internal native)
 {
     return new TranslationUnit(native);
 }
开发者ID:RainsSoft,项目名称:CppSharp,代码行数:4,代码来源:AST.cs


示例9: TranslationUnit

 private TranslationUnit(TranslationUnit.Internal native, bool skipVTables = false)
     : this(__CopyValue(native), skipVTables)
 {
     __ownsNativeInstance = true;
     NativeToManagedMap[__Instance] = this;
 }
开发者ID:CSRedRat,项目名称:CppSharp,代码行数:6,代码来源:AST.cs


示例10: __CopyValue

 private static void* __CopyValue(TranslationUnit.__Internal native)
 {
     var ret = Marshal.AllocHGlobal(292);
     global::CppSharp.Parser.AST.TranslationUnit.__Internal.cctor_1(ret, new global::System.IntPtr(&native));
     return ret.ToPointer();
 }
开发者ID:ddobrev,项目名称:CppSharp,代码行数:6,代码来源:CppSharp.CppParser.cs


示例11: TranslationUnit

 internal TranslationUnit(TranslationUnit.Internal* native)
     : this(new global::System.IntPtr(native))
 {
 }
开发者ID:kidleon,项目名称:CppSharp,代码行数:4,代码来源:AST.cs


示例12: AddTranslationUnitsMasked

 /// <summary>
 /// Not required for this implementation.
 /// </summary>
 /// <param name="translationUnits"></param>
 /// <param name="settings"></param>
 /// <param name="mask"></param>
 /// <returns></returns>
 public ImportResult[] AddTranslationUnitsMasked(TranslationUnit[] translationUnits, ImportSettings settings, bool[] mask)
 {
     throw new NotImplementedException();
 }
开发者ID:patrickporter,项目名称:MT-Enhanced-Trados-Plugin,代码行数:11,代码来源:MtTranslationProviderLanguageDirection.cs


示例13: AddTranslationUnits

 /// <summary>
 /// Not required for this implementation.
 /// </summary>
 /// <param name="translationUnits"></param>
 /// <param name="settings"></param>
 /// <returns></returns>
 public ImportResult[] AddTranslationUnits(TranslationUnit[] translationUnits, ImportSettings settings)
 {
     throw new NotImplementedException();
 }
开发者ID:patrickporter,项目名称:MT-Enhanced-Trados-Plugin,代码行数:10,代码来源:MtTranslationProviderLanguageDirection.cs


示例14: AddOrUpdateTranslationUnitsMasked

 /// <summary>
 /// Not required for this implementation.
 /// </summary>
 /// <param name="translationUnits"></param>
 /// <param name="previousTranslationHashes"></param>
 /// <param name="settings"></param>
 /// <param name="mask"></param>
 /// <returns></returns>
 public ImportResult[] AddOrUpdateTranslationUnitsMasked(TranslationUnit[] translationUnits, int[] previousTranslationHashes, ImportSettings settings, bool[] mask)
 {
     ImportResult[] result = { AddTranslationUnit(translationUnits[translationUnits.GetLength(0) - 1], settings) };
     return result;
 }
开发者ID:patrickporter,项目名称:MT-Enhanced-Trados-Plugin,代码行数:13,代码来源:MtTranslationProviderLanguageDirection.cs


示例15: Token

 internal Token(Interop.Token native, TranslationUnit parent) {
     Kind = Interop.clang_getTokenKind(native);
     Location = new SourceLocation(Interop.clang_getTokenLocation(parent.Native, native));
     Extent = new SourceRange(Interop.clang_getTokenExtent(parent.Native, native));
     Spelling = Interop.clang_getTokenSpelling(parent.Native, native).ManagedString; //parent.GetText(Extent);
 }
开发者ID:milindur,项目名称:clang-sharp,代码行数:6,代码来源:Token.cs


示例16: TranslationUnit

 internal TranslationUnit(TranslationUnit.Internal native)
     : this(__CopyValue(native))
 {
 }
开发者ID:vovkasm,项目名称:CppSharp,代码行数:4,代码来源:AST.cs


示例17: TranslationUnit

 private TranslationUnit(TranslationUnit.Internal native)
     : this(__CopyValue(native))
 {
     __ownsNativeInstance = true;
 }
开发者ID:KonajuGames,项目名称:CppSharp,代码行数:5,代码来源:AST.cs


示例18: SearchTranslationUnit

 public SearchResults SearchTranslationUnit(SearchSettings settings, TranslationUnit translationUnit)
 {
     //need to use the tu confirmation level in searchsegment method
     inputTu = translationUnit;
     return SearchSegment(settings, translationUnit.SourceSegment);
 }
开发者ID:patrickporter,项目名称:MT-Enhanced-Trados-Plugin,代码行数:6,代码来源:MtTranslationProviderLanguageDirection.cs


示例19: SearchTranslationUnits

 public SearchResults[] SearchTranslationUnits(SearchSettings settings, TranslationUnit[] translationUnits)
 {
     SearchResults[] results = new SearchResults[translationUnits.Length];
     for (int p = 0; p < translationUnits.Length; ++p)
     {
         //need to use the tu confirmation level in searchsegment method
         inputTu = translationUnits[p];
         results[p] = SearchSegment(settings, translationUnits[p].SourceSegment); //changed this to send whole tu
     }
     return results;
 }
开发者ID:patrickporter,项目名称:MT-Enhanced-Trados-Plugin,代码行数:11,代码来源:MtTranslationProviderLanguageDirection.cs


示例20: Indexer

 public Indexer(Index idx, TranslationUnit tu)
     : this()
 {
     Index = idx;
     _translationUnit = tu;
 }
开发者ID:JadeHub,项目名称:LibClangCS,代码行数:6,代码来源:Indexer.cs



注:本文中的TranslationUnit类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# TransmitFileOptions类代码示例发布时间:2022-05-24
下一篇:
C# Translation类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap