Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
 void IRowElement.Cleanup(RowPresenter rowPresenter)
 {
     Command    = null;
     ForeignKey = null;
     Lookup     = null;
     ValueBag.Clear();
     this.CleanupCommandEntries();
 }
Esempio n. 3
0
 /// <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();
 }
Esempio n. 4
0
 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);
     }
 }