当前位置: 首页>>代码示例>>C#>>正文


C# NSAutoreleasePool.InvokeOnMainThread方法代码示例

本文整理汇总了C#中MonoMac.Foundation.NSAutoreleasePool.InvokeOnMainThread方法的典型用法代码示例。如果您正苦于以下问题:C# NSAutoreleasePool.InvokeOnMainThread方法的具体用法?C# NSAutoreleasePool.InvokeOnMainThread怎么用?C# NSAutoreleasePool.InvokeOnMainThread使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MonoMac.Foundation.NSAutoreleasePool的用法示例。


在下文中一共展示了NSAutoreleasePool.InvokeOnMainThread方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreatePreferencesView

 public override IDesktopPreferencesView CreatePreferencesView()
 {
     IDesktopPreferencesView view = null;
     using (var pool = new NSAutoreleasePool())
     {
         pool.InvokeOnMainThread(delegate {
             view = base.CreatePreferencesView();
         });
     }
     return view;
 }
开发者ID:pascalfr,项目名称:MPfm,代码行数:11,代码来源:MacNavigationManager.cs

示例2: CreateCloudConnectView

 public override ICloudConnectView CreateCloudConnectView()
 {
     ICloudConnectView view = null;
     using (var pool = new NSAutoreleasePool())
     {
         pool.InvokeOnMainThread(delegate {
             view = base.CreateCloudConnectView();
         });
     }
     return view;
 }
开发者ID:pascalfr,项目名称:MPfm,代码行数:11,代码来源:MacNavigationManager.cs

示例3: CreateStartResumePlaybackView

 public override IStartResumePlaybackView CreateStartResumePlaybackView()
 {
     IStartResumePlaybackView view = null;
     using (var pool = new NSAutoreleasePool())
     {
         pool.InvokeOnMainThread(delegate {
             view = base.CreateStartResumePlaybackView();
         });
     }
     return view;
 }
开发者ID:pascalfr,项目名称:MPfm,代码行数:11,代码来源:MacNavigationManager.cs

示例4: CreateEditSongMetadataView

 public override IEditSongMetadataView CreateEditSongMetadataView(AudioFile audioFile)
 {
     IEditSongMetadataView view = null;
     using (var pool = new NSAutoreleasePool())
     {
         pool.InvokeOnMainThread(delegate {
             view = base.CreateEditSongMetadataView(audioFile);
         });
     }
     return view;
 }
开发者ID:pascalfr,项目名称:MPfm,代码行数:11,代码来源:MacNavigationManager.cs

示例5: CreateSyncWebBrowserView

 public override ISyncWebBrowserView CreateSyncWebBrowserView()
 {
     ISyncWebBrowserView view = null;
     using (var pool = new NSAutoreleasePool())
     {
         pool.InvokeOnMainThread(delegate {
             view = base.CreateSyncWebBrowserView();
         });
     }
     return view;
 }
开发者ID:pascalfr,项目名称:MPfm,代码行数:11,代码来源:MacNavigationManager.cs

示例6: CreateSyncDownloadView

 public override ISyncDownloadView CreateSyncDownloadView(SyncDevice device, IEnumerable<AudioFile> audioFiles)
 {
     ISyncDownloadView view = null;
     using (var pool = new NSAutoreleasePool())
     {
         pool.InvokeOnMainThread(delegate {
             view = base.CreateSyncDownloadView(device, audioFiles);
         });
     }
     return view;
 }
开发者ID:pascalfr,项目名称:MPfm,代码行数:11,代码来源:MacNavigationManager.cs

示例7: CreateSyncMenuView

 public override ISyncMenuView CreateSyncMenuView(SyncDevice device)
 {
     ISyncMenuView view = null;
     using (var pool = new NSAutoreleasePool())
     {
         pool.InvokeOnMainThread(delegate {
             view = base.CreateSyncMenuView(device);
         });
     }
     return view;
 }
开发者ID:pascalfr,项目名称:MPfm,代码行数:11,代码来源:MacNavigationManager.cs

示例8: CreateSyncView

        public override ISyncView CreateSyncView()
        {
            ISyncView view = null;
            using (var pool = new NSAutoreleasePool())
            {
                pool.InvokeOnMainThread(delegate {
                    view = base.CreateSyncView();
                });
            }
            return view;

//            if (_syncView == null)
//            {
//                using (var pool = new NSAutoreleasePool())
//                {
//                    pool.InvokeOnMainThread(delegate
//                    {
//                        _syncView = base.CreateSyncView();
//                    });
//                }
//            } 
//            else
//            {
//                _syncView.ShowView(true);
//            }
//            return _syncView;
        }
开发者ID:pascalfr,项目名称:MPfm,代码行数:27,代码来源:MacNavigationManager.cs

示例9: OnUsageUpdated

        protected virtual void OnUsageUpdated()
        {
            // Usage info comes from an async request, it could be on any thread
            // So we need to make sure we have a release pool for ObjC code in the thread
            // We also need to ensure we get back on the UI thread to prevent potential cross-thread issues
            using (var pool = new NSAutoreleasePool())
            {
                pool.InvokeOnMainThread(() =>
                {
                    UsageInformation usage;
                    lock (_lockObject)
                        usage = _currentUsage;

                    if (UsageUpdated != null)
                        UsageUpdated(this, new UsageUpdatedEventArgs(usage));
                });
            }
        }
开发者ID:danclarke,项目名称:AquissUsageChecker,代码行数:18,代码来源:UsageChecker.cs


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