當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。