コード例 #1
0
        public UserAnnotationViewModel(ISharedDataService sharedDataService, MeetingViewModel meeting)
        {
            Meeting = meeting;
            AnnotationsModel = sharedDataService.AnnotationsModel;
            SurfaceSize = new AnnotationSurfaceSize();

            var activeToolObs = Meeting.WhenAnyValue(vm => vm.ActiveTool)
               .Where(t => t != null);

            var pageChangedObs = activeToolObs
                             .Select(t => t.WhenAnyValue(v => v.CurrentPageNumber,
                                                p => new ToolIdAndPageNumber { ToolId = t.ToolId, PageNumber = p })
                                    )
                             .Switch(); // Only listen to the most recent sequence of property changes (active tool)

            // Every time the tool changes, select the tool id and current page number
            var toolChangedObs = activeToolObs
                .Select(t => new ToolIdAndPageNumber { ToolId = t.ToolId, PageNumber = t.CurrentPageNumber });
               
            // Merge them together - tool changes and current page of the tool
            _collectionRefreshSub = toolChangedObs
                .Merge(pageChangedObs)
                .Subscribe(t => this.RaisePropertyChanged("Annotations"));
            // whenever the suface size's width or height changes, re-bind the annotations
            // on the agent's side, this will send stuff over the wire. need to figure out how to solve this.
            _sizeChangedSub = this.SurfaceSize
                .WhenAnyValue(p => p.Width, p => p.Height, (w, h) => true)
                .Subscribe(p => this.RaisePropertyChanged("Annotations"));
        }
コード例 #2
0
        private AnnotationBuilder(AnnotationType type, AnnotationSurfaceSize size, Guid toolId, int currentPage)
        {
            this.surfaceSize = size;
            this.type = type;

            this.annotation = new Annotation()
            {
                Type = type,
                Points = new List<AnnotationPoint>(),
                PageNumber = currentPage,
                ToolId = toolId
            };
        }
コード例 #3
0
        private AnnotationBuilder(AnnotationType type, AnnotationSurfaceSize size, Guid toolId, int currentPage)
        {
            this.surfaceSize = size;
            this.type        = type;

            this.annotation = new Annotation()
            {
                Type       = type,
                Points     = new List <AnnotationPoint>(),
                PageNumber = currentPage,
                ToolId     = toolId
            };
        }
コード例 #4
0
 public AgentAnnotationSetupModel()
 {
     _screenSize = new AnnotationSurfaceSize();
 }
コード例 #5
0
 public static AnnotationBuilder Create(AnnotationType type, AnnotationSurfaceSize size, int currentPage, Guid toolId)
 {
     return(new AnnotationBuilder(type, size, toolId, currentPage));
 }
コード例 #6
0
 public ClientAnnotationSetupModel()
 {
     _screenSize = new AnnotationSurfaceSize();
 }
コード例 #7
0
 public static AnnotationPoint ConvertFromStandardRangeToSurface(AnnotationPoint point, AnnotationSurfaceSize surface)
 {
     return new AnnotationPoint { X = point.X * surface.Width, Y = point.Y * surface.Height };
 }
コード例 #8
0
 private AnnotationViewModel(Annotation annotation, AnnotationSurfaceSize surfaceSize)
 {
     Annotation = annotation;
     _surfaceSize = surfaceSize;
 }
コード例 #9
0
 public static AnnotationViewModel Create(Annotation annotation, AnnotationSurfaceSize surfaceSize)
 {
     return new AnnotationViewModel(annotation, surfaceSize);
 }
コード例 #10
0
 public static AnnotationPoint ConvertFromStandardRangeToSurface(AnnotationPoint point, AnnotationSurfaceSize surface)
 {
     return(new AnnotationPoint {
         X = point.X * surface.Width, Y = point.Y * surface.Height
     });
 }
コード例 #11
0
 public static AnnotationBuilder Create(AnnotationType type, AnnotationSurfaceSize size, int currentPage, Guid toolId)
 {
     return new AnnotationBuilder(type, size, toolId, currentPage);
 }