Inheritance: Net.Astropenguin.DataModel.ActiveData, IMetaSpider
Exemple #1
0
        public void ExitZone()
        {
            if ( CurrentZone != PrevZone )
            {
                PrevZone?.Reset();
                PrevZone = CurrentZone;
            }

            CurrentZone = null;
            NotifyChanged( "CurrentZone" );
        }
Exemple #2
0
        public void EnterZone( ZoneSpider ZS )
        {
            CurrentZone = ZS;
            NotifyChanged( "CurrentZone" );

            try
            {
                var j = ZS.Init();
            }
            catch ( Exception ex )
            {
                Logger.Log( ID, ex.Message, LogType.WARNING );
                ExitZone();
            }
        }
        private void ShowZoneAction( object sender, RightTappedRoutedEventArgs e )
        {
            Grid G = ( Grid ) sender;
            FlyoutBase.ShowAttachedFlyout( G );

            SelectedZone = ( ZoneSpider ) G.DataContext;
        }
 private void RemoveZone( object sender, RoutedEventArgs e )
 {
     ZoneListContext.RemoveZone( SelectedZone );
     SelectedZone = null;
 }
Exemple #5
0
        public void RemoveZone( ZoneSpider ZS )
        {
            if ( ZS == null ) return;

            try
            {
                Shared.Storage.DeleteFile( ZS.MetaLocation );
            }
            catch ( Exception ) { }

            Worker.UIInvoke( () =>
            {
                Zones.Remove( ZS );
                ZS.Reset();
            } );
        }
Exemple #6
0
 private void AddZone( ZoneSpider ZS )
 {
     Worker.UIInvoke( () =>
     {
         Zones.Add( ZS );
     } );
 }
Exemple #7
0
        private ZoneSpider ReadZone( string ZData, bool Init = false )
        {
            ZoneSpider ZS = new ZoneSpider();
            XRegistry ZDef = new XRegistry( ZData, null, false );

            if ( ZS.Open( ZDef ) )
            {
                // Remove the old Zone
                if ( Init )
                {
                    AddZone( ZS );
                }
                else
                {
                    RemoveZone( Zones.FirstOrDefault( x => x.ZoneId == ZS.ZoneId ) );
                    AddZone( ZS );
                    var j = Task.Run( () => { Shared.Storage.WriteString( ZS.MetaLocation, ZData ); } );
                }

                return ZS;
            }

            return null;
        }