public void ExitZone() { if ( CurrentZone != PrevZone ) { PrevZone?.Reset(); PrevZone = CurrentZone; } CurrentZone = null; NotifyChanged( "CurrentZone" ); }
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; }
public void RemoveZone( ZoneSpider ZS ) { if ( ZS == null ) return; try { Shared.Storage.DeleteFile( ZS.MetaLocation ); } catch ( Exception ) { } Worker.UIInvoke( () => { Zones.Remove( ZS ); ZS.Reset(); } ); }
private void AddZone( ZoneSpider ZS ) { Worker.UIInvoke( () => { Zones.Add( ZS ); } ); }
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; }