//# __________ PROTOCOL :: PUBLIC __________ #// public VmAliasManifest AddAlias( VmTag tag, int aliasManifestFileIndex, int nestId, double kilograms) { lock( this ) { String tagValue = tag.Value; VmAliasManifest im = new VmAliasManifest(); im.TagValue = tag.Value; im.AliasId = VmAirportData.Default.AirportOutputData.IdentityFile.GetNextIdentity(); im.NestId = nestId; im.Kilograms = kilograms; im.FirstTouchTimestamp = JwTimestamp.CreateNowUtc(); VmAirportData.Default.AirportOutputData.AliasManifestFile.InsertAt(im, aliasManifestFileIndex); VmAliasReverseManifest rim = new VmAliasReverseManifest(); rim.AliasId = im.AliasId; rim.TagValue = im.TagValue; VmAirportData.Default.AirportOutputData.AliasReverseManifestFile.InsertWhereAppropriate(rim.AliasId+"", rim); return im; } }
//# __________ PROTOCOL :: PUBLIC (NESTED ALIASES) __________ #// public void AddAliasToNest(VmAliasManifest alias, int nestId) { if( nestId == -1 ) { alias.NestId = -1; return; } _AddNestedAlias(alias, nestId); alias.NestId = nestId; VmAliasManager.Default.UpdateAlias(alias); }
//# __________ PROTOCOL :: PRIVATE (NESTED ITEM) __________ #// public void _RemoveNestedAlias(VmAliasManifest alias, int nestId) { if( nestId == -1 ) return; VmAirportData.Default.AirportOutputData.GetNestedAliasFile(nestId).Delete(alias.AliasId+""); VmNest n = GetNest(nestId); n.RemoveTag(alias.Kilograms); }
public void _AddNestedAlias(VmAliasManifest alias, int nestId) { VmNestedAlias ni = new VmNestedAlias(); ni.AliasId = alias.AliasId; ni.Kilograms = alias.Kilograms; VmAirportData.Default.AirportOutputData.GetNestedAliasFile(nestId).InsertWhereAppropriate(alias.AliasId+"", ni); VmNest n = GetNest(nestId); n.AddTag(alias.Kilograms); }
public void RemoveAliasFromNest(VmAliasManifest alias) { _RemoveNestedAlias(alias, alias.NestId); alias.NestId = -1; VmAliasManager.Default.UpdateAlias(alias); }
public void MoveAliasToNest( VmAliasManifest im, int newNestId) { int oldNestId = im.NestId; _RemoveNestedAlias(im, oldNestId); AddAliasToNest(im, newNestId); }
public void UpdateAlias(VmAliasManifest alias) { lock( this ) { VmAirportData.Default.AirportOutputData.AliasManifestFile.ReplaceWith( alias.TagValue, alias); } }