private void MainForm_Load(object sender, EventArgs e)
 {
     fmDataContext = new FMDataContext();
     {
         this.ClubsComboBox.DataSource = fmDataContext.Clubs.OrderBy(c => c.Name).ToList();
     }
 }
        private void BackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
        {

            try
            {
                FMDataContext currentDataContext = (FMDataContext)this.Invoke(new GetDataContextDelegate(GetDataContext));

                if (currentDataContext == null)
                {
                    currentDataContext = new FMDataContext();
                    this.Invoke(new SetDataContextDelegate(SetDataContext), new object[] { currentDataContext });
                }

                if (((int)this.Invoke(new GetLastActiveObjectDelegate(GetLastActiveObject))) != currentDataContext.ActiveObject.MemoryAddress)
                {
                    this.Invoke(new UpdateDataDelegate(UpdateData), new object[] { (Player)fmDataContext.ActiveObject });
                    this.Invoke(new SetLastActiveObjectDelegate(SetLastActiveObject), new object[] { currentDataContext.ActiveObject.MemoryAddress });
                }
            }
            catch (Exception ex) { }
        }
 public void SetDataContext(FMDataContext dataContext)
 {
     this.fmDataContext = dataContext;
 }