コード例 #1
0
        private static void Initialize()
        {
            unityScheduler = System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext();

            if (!Application.isEditor)
            {
                if (Debug.isDebugBuild)
                {
                    Debug.Log($"{nameof(RNBridge)}: try initialize");
                }
                try
                {
                    if (Application.platform == RuntimePlatform.Android)
                    {
                        unityReact = new AndroidUnityReact();
                    }
                    else
                    {
                        unityReact = new NativeUnityReact();
                    }
                }
                catch (System.Exception e)
                {
                    Debug.LogError($"{nameof(RNBridge)}: exception during try initialize <{e.Message}>");
                }
            }
        }
コード例 #2
0
 public AlloyBackgroundParser(ITextBuffer textBuffer, TaskScheduler taskScheduler, ITextDocumentFactoryService textDocumentFactoryService, IOutputWindowService outputWindowService)
     : base(textBuffer, taskScheduler, textDocumentFactoryService, outputWindowService)
 {
     Contract.Requires(textBuffer != null);
     Contract.Requires(taskScheduler != null);
     Contract.Requires(textDocumentFactoryService != null);
     Contract.Requires(outputWindowService != null);
 }
コード例 #3
0
 public AlloyBackgroundParser([NotNull] ITextBuffer textBuffer, [NotNull] TaskScheduler taskScheduler, [NotNull] ITextDocumentFactoryService textDocumentFactoryService, [NotNull] IOutputWindowService outputWindowService)
     : base(textBuffer, taskScheduler, textDocumentFactoryService, outputWindowService)
 {
     Debug.Assert(textBuffer != null);
     Debug.Assert(taskScheduler != null);
     Debug.Assert(textDocumentFactoryService != null);
     Debug.Assert(outputWindowService != null);
 }
コード例 #4
0
 public AlloyBackgroundParser(ITextBuffer textBuffer, TaskScheduler taskScheduler, ITextDocumentFactoryService textDocumentFactoryService, IOutputWindowService outputWindowService)
     : base(textBuffer, taskScheduler, textDocumentFactoryService, outputWindowService)
 {
     Contract.Requires(textBuffer != null);
     Contract.Requires(taskScheduler != null);
     Contract.Requires(textDocumentFactoryService != null);
     Contract.Requires(outputWindowService != null);
 }
コード例 #5
0
ファイル: IOCompletionScheduler.cs プロジェクト: ganesum/Naru
 public IOCompletionScheduler()
 {
     TPL = new IOCompletionPortTaskScheduler(50, 20);
 }
コード例 #6
0
 public ConcurrentExclusiveSchedulerPair(System.Threading.Tasks.TaskScheduler taskScheduler, int maxConcurrencyLevel, int maxItemsPerTask)
 {
 }
コード例 #7
0
 public ConcurrentExclusiveSchedulerPair(System.Threading.Tasks.TaskScheduler taskScheduler)
 {
 }
コード例 #8
0
 public static System.Threading.Tasks.Task <TNewResult> ContinueWith <TResult, TNewResult>(this System.Threading.Tasks.Task <TResult> task, System.Func <System.Threading.Tasks.Task <TResult>, object, TNewResult> continuationFunction, object state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler);
コード例 #9
0
 public static System.Threading.Tasks.Task <TResult> ContinueWith <TResult>(this System.Threading.Tasks.Task task, System.Func <System.Threading.Tasks.Task, object, TResult> continuationFunction, object state, System.Threading.Tasks.TaskScheduler scheduler);
コード例 #10
0
 public static System.Threading.Tasks.Task ContinueWith <TResult>(this System.Threading.Tasks.Task <TResult> task, System.Action <System.Threading.Tasks.Task <TResult>, object> continuationAction, object state, System.Threading.Tasks.TaskScheduler scheduler);
コード例 #11
0
 public static System.Threading.Tasks.Task ContinueWith(this System.Threading.Tasks.Task task, System.Action <System.Threading.Tasks.Task, object> continuationAction, object state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler);
コード例 #12
0
 public TestIOCompletionScheduler()
 {
     TPL = new CurrentThreadTaskScheduler();
 }
コード例 #13
0
 static AppTrackingTransparency()
 {
     currentSynchronizationContext = System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext();
 }
コード例 #14
0
ファイル: DataManager.cs プロジェクト: JulianMH/DoIt
        private void AcquirePushChannelAsync()
        {
            mainTaskScheduler = System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext();

            //Im Hintergrund ausführen ist geschickter.
            var task = System.Threading.Tasks.Task.Factory.StartNew(() =>
            {
                try
                {
                    string pushChannelName = "DoItPushChannel";

                    this.notificationChannel = HttpNotificationChannel.Find(pushChannelName);

                    if (this.data.NotificationsEnabled)
                    {
                        if (this.notificationChannel == null)
                        {
                            this.notificationChannel = new HttpNotificationChannel(pushChannelName);
                            this.notificationChannel.Open();
                            this.notificationChannel.BindToShellToast();
                            this.notificationChannel.BindToShellTile();
                        }

                        this.notificationChannel.ErrorOccurred += new EventHandler<NotificationChannelErrorEventArgs>(PushChannel_ErrorOccurred);
                        this.notificationChannel.ShellToastNotificationReceived += notificationChannel_ShellToastNotificationReceived;
                    }
                    else if (this.notificationChannel != null)
                    {
                        this.notificationChannel.Close();
                        this.notificationChannel = null;
                    }

                    //Jetzt die Zahl auf dem Live Tile resetten.
                    foreach (var tile in Microsoft.Phone.Shell.ShellTile.ActiveTiles)
                    {
#if WP8
                        tile.Update(new Microsoft.Phone.Shell.FlipTileData()
                        {
                            Count = 0,
                            Title = Localization.Strings.ApplicationTitle,
                            SmallBackgroundImage = new Uri("Background.png", UriKind.Relative),
                            BackgroundImage = new Uri("Background.png", UriKind.Relative)
                        });
#else
                        tile.Update(new Microsoft.Phone.Shell.StandardTileData()
                        {
                            Count = 0,
                            Title = Localization.Strings.ApplicationTitle,
                            BackgroundImage = new Uri("Background.png", UriKind.Relative)
                        });
#endif
                    }
                }
                catch
                {
                    //Sind ja nur Pushbenachrichtigungen. Kann man auch silent ignorieren.
                    if (System.Diagnostics.Debugger.IsAttached)
                        System.Diagnostics.Debugger.Break();
                }
            });
            task.ContinueWith<System.Threading.Tasks.Task>(async (System.Threading.Tasks.Task x) => { await ApplyUser(); },
                System.Threading.CancellationToken.None, System.Threading.Tasks.TaskContinuationOptions.None,
                mainTaskScheduler);
        }
コード例 #15
0
        private void AcquirePushChannelAsync()
        {
            mainTaskScheduler = System.Threading.Tasks.TaskScheduler.FromCurrentSynchronizationContext();

            //Im Hintergrund ausführen ist geschickter.
            var task = System.Threading.Tasks.Task.Factory.StartNew(() =>
            {
                try
                {
                    string pushChannelName = "DoItPushChannel";

                    this.notificationChannel = HttpNotificationChannel.Find(pushChannelName);

                    if (this.data.NotificationsEnabled)
                    {
                        if (this.notificationChannel == null)
                        {
                            this.notificationChannel = new HttpNotificationChannel(pushChannelName);
                            this.notificationChannel.Open();
                            this.notificationChannel.BindToShellToast();
                            this.notificationChannel.BindToShellTile();
                        }

                        this.notificationChannel.ErrorOccurred += new EventHandler <NotificationChannelErrorEventArgs>(PushChannel_ErrorOccurred);
                        this.notificationChannel.ShellToastNotificationReceived += notificationChannel_ShellToastNotificationReceived;
                    }
                    else if (this.notificationChannel != null)
                    {
                        this.notificationChannel.Close();
                        this.notificationChannel = null;
                    }

                    //Jetzt die Zahl auf dem Live Tile resetten.
                    foreach (var tile in Microsoft.Phone.Shell.ShellTile.ActiveTiles)
                    {
#if WP8
                        tile.Update(new Microsoft.Phone.Shell.FlipTileData()
                        {
                            Count = 0,
                            Title = Localization.Strings.ApplicationTitle,
                            SmallBackgroundImage = new Uri("Background.png", UriKind.Relative),
                            BackgroundImage      = new Uri("Background.png", UriKind.Relative)
                        });
#else
                        tile.Update(new Microsoft.Phone.Shell.StandardTileData()
                        {
                            Count           = 0,
                            Title           = Localization.Strings.ApplicationTitle,
                            BackgroundImage = new Uri("Background.png", UriKind.Relative)
                        });
#endif
                    }
                }
                catch
                {
                    //Sind ja nur Pushbenachrichtigungen. Kann man auch silent ignorieren.
                    if (System.Diagnostics.Debugger.IsAttached)
                    {
                        System.Diagnostics.Debugger.Break();
                    }
                }
            });

            task.ContinueWith <System.Threading.Tasks.Task>(async(System.Threading.Tasks.Task x) => { await ApplyUser(); },
                                                            System.Threading.CancellationToken.None, System.Threading.Tasks.TaskContinuationOptions.None,
                                                            mainTaskScheduler);
        }
コード例 #16
0
 /// <summary>
 /// TaskSchedulerからTaskを呼び出し。
 /// </summary>
 /// <param name="scheduler"></param>
 /// <param name="action"></param>
 /// <returns></returns>
 public static System.Threading.Tasks.Task TaskStart(this System.Threading.Tasks.TaskScheduler scheduler, Action action)
 {
     return(System.Threading.Tasks.Task.Factory.StartNew(action, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, scheduler));
 }