public bool Connect() { if (ValueBag.Connected) { return(false); } try { FSUIPCConnection.Open(); ValueBag.Clear(); ValueBag.Connected = true; FsxiConnected?.Invoke(this, EventArgs.Empty); FsxiValueBagUpdated?.Invoke(this, EventArgs.Empty); updateThread = new Thread(new ParameterizedThreadStart(ThreadFunc)); updateThread.Start(this); return(true); } catch (FSUIPCException) { return(false); } catch (Exception e) { log.Error(e); return(false); } }
void IRowElement.Cleanup(RowPresenter rowPresenter) { Command = null; ForeignKey = null; Lookup = null; ValueBag.Clear(); this.CleanupCommandEntries(); }
/// <summary> /// Clear all EngineState collection properties associated with the Engine class /// </summary> public void Clear() { ValueBag.Clear(); EngineResourceFile.ClearAll(); Tilesheet.ClearAllTilesheets(); Cycle.ClearAllAnimationCycles(); GridPointMatrixes.ClearAllGridPointMatrixes(); GridPointMatrix.ClearAllGridPointMatrix(); Gondwana.Common.Drawing.Sprites.Sprites.Clear(); MediaFile.DisposeAll(); }
public bool Disconnect() { if (!ValueBag.Connected) { return(false); } try { FSUIPCConnection.Close(); updateThread.Abort(); updateThread = null; ValueBag.Clear(); ValueBag.Connected = false; FsxiDisconnected?.Invoke(this, EventArgs.Empty); FsxiValueBagUpdated?.Invoke(this, EventArgs.Empty); return(true); } catch (FSUIPCException) { return(false); } }