Exemplo n.º 1
0
 public void Register(IDocumentContainer container)
 {
     // Only one document container at a time
     if (_documentContainer != null)
     {
         _documentContainer.Unlisten(OnDocumentChanged);
     }
     _documentContainer = container;
     // A null container can be used to clear
     if (container == null)
     {
         _document = null;
     }
     else
     {
         _document = container.Document;
         container.Listen(OnDocumentChanged);
     }
     RefreshCache(_document);
 }
Exemplo n.º 2
0
 public void Listen(IDocumentChangeListener listener)
 {
     lock (_documentChangedEventHandlers)
     {
         bool firstListener = _documentChangedEventHandlers.Count == 0;
         if (!_documentChangedEventHandlers.Add(listener))
         {
             throw new ArgumentException(@"Listener already added");
         }
         if (firstListener)
         {
             var documentUiContainer = _documentContainer as IDocumentUIContainer;
             if (null == documentUiContainer)
             {
                 _documentContainer.Listen(DocumentChangedEventHandler);
             }
             else
             {
                 documentUiContainer.ListenUI(DocumentChangedEventHandler);
             }
         }
     }
 }
Exemplo n.º 3
0
 public void Register(IDocumentContainer container)
 {
     container.Listen(OnDocumentChanged);
     container.AddBackgroundLoader(this);  // Useful information for enforcing orderly test shutdown
 }
Exemplo n.º 4
0
 public void Register(IDocumentContainer container)
 {
     container.Listen(OnDocumentChanged);
 }
Exemplo n.º 5
0
 public void Register(IDocumentContainer container)
 {
     // Only one document container at a time
     if (_documentContainer != null)
         _documentContainer.Unlisten(OnDocumentChanged);
     _documentContainer = container;
     // A null container can be used to clear
     if (container == null)
     {
         _document = null;
     }
     else
     {
         _document = container.Document;
         container.Listen(OnDocumentChanged);
     }
     RefreshCache(_document);
 }
Exemplo n.º 6
0
 public void Register(IDocumentContainer container)
 {
     container.Listen(OnDocumentChanged);
 }