private static void AssertDispatchesCall(SynchronizationContextDispatcher dispatcher)
        {
            var handler = new TestHandler();
            var message = new TestMessage();

            dispatcher.Invoke(message, handler);

            handler.Called.WaitOne(1000);

            Assert.That(handler.TestMessage, Is.SameAs(message));
        }
示例#2
0
 public LayersStrip()
 {
     using (ISynchronizationContext context = SynchronizationContextDispatcher.CreateRef())
     {
         this.thumbnailManager = new ThumbnailManager(context);
     }
     this.layerToItemMap    = new Dictionary <Layer, VerticalImageStrip.Item>();
     this.layers            = new List <Layer>();
     this.activeLayer       = null;
     this.invalidatedLayers = new ConcurrentSet <Layer>();
     this.processInvalidatedLayersCallback = new Action(this.ProcessInvalidatedLayers);
     base.AllowReorder = true;
     base.ManagedFocus = true;
 }
示例#3
0
 public DocumentStrip()
 {
     PdnBaseForm.RegisterFormHotKey(Keys.Control | Keys.Tab, new Func <Keys, bool>(this.OnNextTabHotKeyPressed));
     PdnBaseForm.RegisterFormHotKey(Keys.Control | Keys.Shift | Keys.Tab, new Func <Keys, bool>(this.OnPreviousTabHotKeyPressed));
     using (ISynchronizationContext context = SynchronizationContextDispatcher.CreateRef())
     {
         this.thumbnailManager = new ThumbnailManager(context);
     }
     base.Name = "DocumentStrip";
     for (int i = 1; i <= 9; i++)
     {
         Keys keys = KeysUtil.FromLetterOrDigitChar((char)(i + 0x30));
         PdnBaseForm.RegisterFormHotKey(Keys.Control | keys, new Func <Keys, bool>(this.OnDigitHotKeyPressed));
         PdnBaseForm.RegisterFormHotKey(Keys.Alt | keys, new Func <Keys, bool>(this.OnDigitHotKeyPressed));
     }
     base.ShowCloseButtons = true;
 }