Example #1
0
        private void AddViewport(ShadowVisual viewport, Vector globalOffset)
        {
            ViewportViewModel model = new ViewportViewModel(viewport, globalOffset, Scale);

            _viewports[viewport] = model;
            Viewports.Add(model);
        }
Example #2
0
 /// <summary>
 /// recusively add all descendants for tracking
 /// </summary>
 /// <param name="monitor"></param>
 /// <param name="visual"></param>
 protected void Instrument(Monitor monitor, HeliosVisual visual)
 {
     foreach (HeliosVisual child in visual.Children)
     {
         Children[child] = new ShadowVisual(_parent, monitor, child);
     }
 }
Example #3
0
        public void RemoveViewport(ShadowVisual shadowViewport)
        {
            shadowViewport.ViewportChanged -= Raw_ViewportChanged;
            _viewports.Remove(shadowViewport.Visual);
            ViewportRemoved?.Invoke(this, new ShadowViewportEventArgs(shadowViewport));

            // update viewport count on hosting monitor
            ShadowMonitor monitor = _monitors[shadowViewport.Monitor];

            monitor.RemoveViewport();

            // recalculate, delayed
            ScheduleGeometryChange();
        }
Example #4
0
        public void AddViewport(ShadowVisual shadowViewport)
        {
            _viewports[shadowViewport.Visual] = shadowViewport;
            ViewportAdded?.Invoke(this, new ShadowViewportEventArgs(shadowViewport));

            // update viewport count on hosting monitor
            ShadowMonitor monitor = _monitors[shadowViewport.Monitor];

            monitor.AddViewport();

            shadowViewport.ViewportChanged += Raw_ViewportChanged;

            // recalculate, delayed
            ScheduleGeometryChange();
        }
Example #5
0
        protected virtual void OnRemoved(HeliosVisual oldChild)
        {
            if (!Children.ContainsKey(oldChild))
            {
                // this has happened before and it is unclear why
                ConfigManager.LogManager.LogInfo(
                    $"the Visual object {oldChild.Name} of type {oldChild.TypeIdentifier} was not found in the data used for tracking viewports and monitors; probable program error");
                return;
            }

            ShadowVisual shadow = Children[oldChild];

            shadow.Dispose();
            Children.Remove(oldChild);
        }
Example #6
0
 public ShadowViewportEventArgs(ShadowVisual shadow)
 {
     Data = shadow;
 }
Example #7
0
 protected virtual void OnAdded(HeliosVisual newChild)
 {
     Children[newChild] = new ShadowVisual(_parent, Monitor, newChild);
 }