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

            _viewports[viewport] = model;
            Viewports.Add(model);
        }
コード例 #2
0
ファイル: ShadowVisual.cs プロジェクト: appsou/Helios
 /// <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);
     }
 }
コード例 #3
0
ファイル: MonitorSetup.cs プロジェクト: appsou/Helios
        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();
        }
コード例 #4
0
ファイル: MonitorSetup.cs プロジェクト: appsou/Helios
        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();
        }
コード例 #5
0
ファイル: ShadowVisual.cs プロジェクト: appsou/Helios
        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);
        }
コード例 #6
0
ファイル: ShadowVisual.cs プロジェクト: appsou/Helios
 public ShadowViewportEventArgs(ShadowVisual shadow)
 {
     Data = shadow;
 }
コード例 #7
0
ファイル: ShadowVisual.cs プロジェクト: appsou/Helios
 protected virtual void OnAdded(HeliosVisual newChild)
 {
     Children[newChild] = new ShadowVisual(_parent, Monitor, newChild);
 }