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"));
        }
        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
            };
        }
Esempio n. 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
            };
        }
 public AgentAnnotationSetupModel()
 {
     _screenSize = new AnnotationSurfaceSize();
 }
Esempio n. 5
0
 public static AnnotationBuilder Create(AnnotationType type, AnnotationSurfaceSize size, int currentPage, Guid toolId)
 {
     return(new AnnotationBuilder(type, size, toolId, currentPage));
 }
 public ClientAnnotationSetupModel()
 {
     _screenSize = new AnnotationSurfaceSize();
 }
 public static AnnotationPoint ConvertFromStandardRangeToSurface(AnnotationPoint point, AnnotationSurfaceSize surface)
 {
     return new AnnotationPoint { X = point.X * surface.Width, Y = point.Y * surface.Height };
 }
 private AnnotationViewModel(Annotation annotation, AnnotationSurfaceSize surfaceSize)
 {
     Annotation = annotation;
     _surfaceSize = surfaceSize;
 }
 public static AnnotationViewModel Create(Annotation annotation, AnnotationSurfaceSize surfaceSize)
 {
     return new AnnotationViewModel(annotation, surfaceSize);
 }
Esempio n. 10
0
 public static AnnotationPoint ConvertFromStandardRangeToSurface(AnnotationPoint point, AnnotationSurfaceSize surface)
 {
     return(new AnnotationPoint {
         X = point.X * surface.Width, Y = point.Y * surface.Height
     });
 }
 public static AnnotationBuilder Create(AnnotationType type, AnnotationSurfaceSize size, int currentPage, Guid toolId)
 {
     return new AnnotationBuilder(type, size, toolId, currentPage);
 }