/// <summary> /// Initializes a new instance of the <see cref="AnnotationSchemaViewModel"/> class. /// </summary> /// <param name="schema">The underlying annotation schema.</param> public AnnotationSchemaViewModel(AnnotationSchema schema) { this.internalSchemaValues = new ObservableCollection <AnnotationSchemaValueViewModel>(); this.schemaValues = new ReadOnlyObservableCollection <AnnotationSchemaValueViewModel>(this.internalSchemaValues); this.schema = schema; foreach (var item in this.schema.Values) { this.internalSchemaValues.Add(new AnnotationSchemaValueViewModel(item)); } }
public void Initialize() { this.booleanSchema = new AnnotationSchema("Boolean"); this.booleanSchema.AddSchemaValue(null, Color.Gray); this.booleanSchema.AddSchemaValue("false", Color.Red); this.booleanSchema.AddSchemaValue("true", Color.Green); this.definition = new AnnotatedEventDefinition("Definition"); this.definition.AddSchema(this.booleanSchema); this.metadata = new JsonStreamMetadata("Range", 1, typeof(AnnotatedEvent).AssemblyQualifiedName, this.name, this.path); }
/// <summary> /// Unregisters an annotation schema with the registry. /// </summary> /// <param name="schema">The annotation schema to unregister.</param> public void Unregister(AnnotationSchema schema) { var schemaViewModel = this.internalSchemas.FirstOrDefault(s => s.Schema == schema); if (schemaViewModel == null) { throw new ArgumentOutOfRangeException("schema", $"Schema ({schema.Name}) not found in registry."); } this.internalSchemas.Remove(schemaViewModel); this.registry.Unregister(schema); }
/// <summary> /// Initializes a new instance of the <see cref="TimeIntervalAnnotationDisplayData"/> class. /// </summary> /// <param name="parent">The annotations visualization object that owns this display data instance.</param> /// <param name="annotationSetMessage">The annotation set message.</param> /// <param name="track">The track name.</param> /// <param name="trackIndex">The track index.</param> /// <param name="annotationSchema">The annotation schema.</param> public TimeIntervalAnnotationDisplayData( TimeIntervalAnnotationVisualizationObject parent, Message <TimeIntervalAnnotationSet> annotationSetMessage, string track, int trackIndex, AnnotationSchema annotationSchema) { this.parent = parent; this.annotationSetMessage = annotationSetMessage; this.Track = track; this.TrackIndex = trackIndex; this.AnnotationSchema = annotationSchema; }
private VisualizationContext() { var booleanSchema = new AnnotationSchema("Boolean"); booleanSchema.AddSchemaValue(null, System.Drawing.Color.Gray); booleanSchema.AddSchemaValue("false", System.Drawing.Color.Red); booleanSchema.AddSchemaValue("true", System.Drawing.Color.Green); AnnotationSchemaRegistry.Default.Register(booleanSchema); this.DatasetViewModels = new ObservableCollection <DatasetViewModel>(); // Periodically check if there's any live partitions in the dataset this.liveStatusTimer = new DispatcherTimer(TimeSpan.FromSeconds(10), DispatcherPriority.Normal, new EventHandler(this.OnLiveStatusTimer), Application.Current.Dispatcher); this.liveStatusTimer.Start(); }
private PsiStudioContext() { this.InitVisualizeStreamCommands(); var booleanSchema = new AnnotationSchema("Boolean"); booleanSchema.AddSchemaValue(null, System.Drawing.Color.Gray); booleanSchema.AddSchemaValue("false", System.Drawing.Color.Red); booleanSchema.AddSchemaValue("true", System.Drawing.Color.Green); AnnotationSchemaRegistry.Default.Register(booleanSchema); this.Dataset = new Dataset(); this.Datasets = new ObservableCollection <Dataset> { this.dataset }; }
/// <summary> /// Registers an annotation schema with the registry. /// </summary> /// <param name="schema">The annotation schema to register.</param> public void Register(AnnotationSchema schema) { this.registry.Register(schema); this.internalSchemas.Add(new AnnotationSchemaViewModel(schema)); }