public virtual IEnumerable <string> GetRelations( StorageObjectID source, StorageObjectID sink ) => arrows_to_sink_inverse [source] .Lookup(sink);
public PolylineContainer( StorageObjectID storageobjectID, EditorFile file, IFactory <IContainer> factory, FactorySet <PolylineData> polylines_factoryset, ViewerSet <PolylineData> polylines_viewerset ) : base( storageobjectID, file, factory, ItemName, ItemCodename ) { var obj = file.Storage[storageobjectID]; polylines = new BoundList <PolylineData>( obj.GetOrMake("polylines").ID, file, polylines_factoryset, polylines_viewerset ); }
protected virtual void RenameArrow(StorageObjectID source, StorageObjectID sink, string newkey) { var source_arrows_to_sink_inverse = arrows_to_sink_inverse[source].Lookup(sink); var sink_arrows_to_source_inverse = arrows_to_source_inverse[sink].Lookup(source); foreach (var oldkey in source_arrows_to_sink_inverse) { Messages.Add(new IOMessage(source, IOEvent.ChildRekeyed, oldkey, newkey, sink)); EnumerableExtensions.RenameMerge <string, List <StorageObjectID>, StorageObjectID>( arrows_to_sink[source], oldkey, newkey ); EnumerableExtensions.RenameMerge <string, List <StorageObjectID>, StorageObjectID>( arrows_to_source[sink], oldkey, newkey ); } source_arrows_to_sink_inverse.Clear(); source_arrows_to_sink_inverse.Add(newkey); sink_arrows_to_source_inverse.Clear(); sink_arrows_to_source_inverse.Add(newkey); }
public ScreenContainer( StorageObjectID storageobjectID, EditorFile file, IFactory <IContainer> factory, FactorySet <IScreen> screens_factoryset, ViewerSet <IScreen> screens_viewerset ) : base( storageobjectID, file, factory, ItemName, ItemCodeName ) { var obj = file.Storage[storageobjectID]; screens = new BoundList <IScreen>( obj.GetOrMake("screens").ID, file, screens_factoryset, screens_viewerset ); }
public TrackController( StorageObjectID storageobjectID, EditorFile file, IFactory <ITrackController> factory = null ) : base( storageobjectID, file, factory ) { var obj = file.Storage[storageobjectID]; var container = file[TrackControllerContainer.ItemName] as TrackControllerContainer; pin = new Pin( obj.GetOrMake("pin").ID, file, container.Settings.TimeMarkerUnit ); tracks = new BoundList <ITrack>( obj.GetOrMake("tracks").ID, file, container.Tracks ); }
protected override void Archive(StorageObjectID id) { SerializeNode(id); SerializeArrows(id); base.Archive(id); }
public DurationFieldBinder( StorageObjectID storageobjectID, EditorFile file, DurationField <T> field ) : base( storageobjectID, file, null //TODO ) { this.field = field; obj = this.Object(); field.ItemAdded += Field_ItemAdded; field.ItemMoved += Field_ItemMoved; field.ItemChanged += Field_ItemChanged; field.ItemRemoved += Field_ItemRemoved; listener_added = obj.CreateListen(IOEvent.ChildAdded, Storage_ChildAdded); listener_rekeyed = obj.Graph.CreateListen(Storage_ChildRekeyed, storageobjectID, IOEvent.ChildRekeyed); listener_contentsset = obj.CreateListen(IOEvent.ChildContentsSet, Storage_ChildContentsSet); listener_removed = obj.CreateListen(IOEvent.ChildRemoved, Storage_ChildRemoved); }
public FunctionContainer( StorageObjectID storageobjectID, EditorFile file, IFactory <IContainer> factory, FunctionCodeTools functioncodetools, FactorySet <FunctionSource> functionsources_factoryset, ViewerSet <FunctionSource> functionsources_viewerset ) : base( storageobjectID, file, factory, ItemName, ItemCodeName ) { this.functioncodetools = functioncodetools; var obj = file.Storage[storageobjectID]; functionsources = new BoundList <FunctionSource>( obj.GetOrMake("function-sources").ID, file, functionsources_factoryset, functionsources_viewerset ); }
public virtual StorageObjectID Create() { Guid internalID; do { internalID = Guid.NewGuid(); }while (usedIDs.Contains(internalID)); usedIDs.Add(internalID); var id = new StorageObjectID(internalID); var obj = new StorageObject(this, id); storage.Add(id, obj); node_refcount.Add(id, 0); archivalstates.Add(id, ArchivalState.Unarchived); arrows_to_sink.Add(id, new Dictionary <string, List <StorageObjectID> >()); arrows_to_source.Add(id, new Dictionary <string, List <StorageObjectID> >()); arrows_to_sink_inverse.Add(id, new Dictionary <StorageObjectID, List <string> >()); arrows_to_source_inverse.Add(id, new Dictionary <StorageObjectID, List <string> >()); Messages.Add(new IOMessage(id, IOEvent.ObjectCreated)); return(id); }
public virtual string GetRelation( StorageObjectID source, StorageObjectID sink ) => arrows_to_sink_inverse [source] .Lookup(sink) .Single();
public T Load( StorageObjectID storageobjectID, EditorFile file ) => loader( storageobjectID, file, this );
public void Init( StorageObjectID storageobjectID, EditorFile file ) => initer( storageobjectID, file, this );
protected override void RemoveArrow( StorageObjectID source, StorageObjectID sink ) { //SerializeArrows(source); base.RemoveArrow(source, sink); }
public ITrack Load( StorageObjectID storageobjectID, EditorFile file ) => new MusicTrack( file, file.Storage[storageobjectID], (file[TrackControllerContainer.ItemName] as TrackControllerContainer).Settings );
protected override void RenameArrow( StorageObjectID source, StorageObjectID sink, string newkey ) { //SerializeArrows(source); base.RenameArrow(source, sink, newkey); }
public PolylineData( StorageObjectID storageobjectID, EditorFile file ) : this( file.Storage[storageobjectID], file ) { }
private void Storage_ChildRemoved(string key, StorageObjectID child) { var duration = CodeTools.ReadDuration(key); if (field.HasItem(duration)) { field.RemoveUnique(duration); } }
public static DurationFieldBinder <T> Bind <T>( this DurationField <T> field, StorageObjectID storageobjectID, EditorFile file ) => new DurationFieldBinder <T>( storageobjectID, file, field );
protected override void AddArrow( StorageObjectID source, StorageObjectID sink, string key ) { //SerializeArrows(source); base.AddArrow(source, sink, key); }
public BoundObject( StorageObjectID storageobjectID, EditorFile file, IFactory <T> factory = null ) { this.storageobjectID = storageobjectID; this.file = file; this.factory = factory; }
protected virtual void AddArrow(StorageObjectID source, StorageObjectID sink, string key) { node_refcount[sink]++; arrows_to_sink[source].Lookup(key).Add(sink); arrows_to_source[sink].Lookup(key).Add(source); arrows_to_sink_inverse[source].Lookup(sink).Add(key); arrows_to_source_inverse[source].Lookup(source).Add(key); Messages.Add(new IOMessage(source, IOEvent.ChildAdded, key, sink)); }
internal StorageObject( MemoryStorageGraph graph, StorageObjectID id ) { this.graph = graph; this.id = id; filedata = new MemoryFile(); filedata.Written += Filedata_Written; }
public Screen( StorageObjectID storageobjectID, EditorFile file, IFactory <IScreen> factory = null ) : base( storageobjectID, file, factory ) { }
protected virtual void SetContents(StorageObjectID id) { Messages.Add(new IOMessage(id, IOEvent.ObjectContentsSet)); foreach (var source_map in arrows_to_source[id]) { foreach (var source in source_map.Value) { Messages.Add(new IOMessage(source, IOEvent.ChildContentsSet, source_map.Key, id)); } } }
public IOMessage( StorageObjectID subject, IOEvent verb ) : this( subject, verb, default(string), default(string), default(StorageObjectID) ) { }
public static IOListener CreateListen_Node( this IStorageGraph graph, StorageObjectID subject, IOEvent verb, Action responder ) => CreateListen_Node( graph, subject, verb, (key, @object) => responder() );
private void Storage_ChildContentsSet(string key, StorageObjectID child) { var duration = CodeTools.ReadDuration(key); var contents = Deserializer(File.Storage[child]); if (field.HasItem(duration)) { field.UpdateUnique(duration, contents); } }
public static IOListener CreateListen_Node( this IStorageGraph graph, StorageObjectID subject, IOEvent verb, Action <string, StorageObjectID> childresponder ) => new IOListener( new IOMessage( subject, verb ), message => childresponder(message.Relation, message.Object) );
public BoundList( StorageObjectID storageobjectID, EditorFile file, BoundList <T> master ) : this( storageobjectID, file, master.factoryset, master.viewerset, master ) { }
public IOMessage( StorageObjectID subject, IOEvent verb, string relation, string newrelation, StorageObjectID @object ) { Subject = subject; Verb = verb; Relation = relation; NewRelation = newrelation; Object = @object; }