예제 #1
0
        //# __________ 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;
            }
        }
예제 #2
0
        //# __________ 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);
        }
예제 #3
0
 //# __________ 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);
 }
예제 #4
0
        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);
        }
예제 #5
0
 public void RemoveAliasFromNest(VmAliasManifest alias)
 {
     _RemoveNestedAlias(alias, alias.NestId);
     alias.NestId = -1;
     VmAliasManager.Default.UpdateAlias(alias);
 }
예제 #6
0
 public void MoveAliasToNest(
     VmAliasManifest im,
     int newNestId)
 {
     int oldNestId = im.NestId;
     _RemoveNestedAlias(im, oldNestId);
     AddAliasToNest(im, newNestId);
 }
예제 #7
0
 public void UpdateAlias(VmAliasManifest alias)
 {
     lock( this )
     {
         VmAirportData.Default.AirportOutputData.AliasManifestFile.ReplaceWith(
             alias.TagValue,
             alias);
     }
 }