Beispiel #1
0
 public ScreenUpdateManager(TextView view)
 {
     if (view == null) throw new ArgumentNullException("view");
     _view = view;
 }
Beispiel #2
0
        private void ViewRegisteredHandler(object sender, ViewRegistrationEventArgs e)
        {
            try
            {
                System.Threading.ThreadPool.QueueUserWorkItem((object state) =>
                {
                    try
                    {
                        System.Threading.Thread.Sleep(200);
                        lock (_watcherSyncRoot)
                        {
                            if (e.View != null && !_textViews.ContainsKey(e.View))
                            {
                                var textView = new TextView(e.View);
                                _textViews.Add(e.View, textView);

                                Log.Debug("Registered view: {0}", e.View.GetHashCode());
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Log.Error("Failed to register a view", ex);
                    }
                });
            }
            catch (Exception ex)
            {
                Log.Error("Failed to enqueue a work item", ex);
            }
        }