Beispiel #1
0
        private void updatedefaultlist(object crap)
        {
            try
            {
                if (paramfiles == null)
                {
                    string subdir = "";
                    if (MainV2.comPort.MAV.param.ContainsKey("Q_ENABLE") &&
                        MainV2.comPort.MAV.param["Q_ENABLE"].Value >= 1.0)
                    {
                        subdir = "QuadPlanes/";
                    }
                    paramfiles = GitHubContent.GetDirContent("ardupilot", "ardupilot", "/Tools/Frame_params/" + subdir, ".param");
                }

                BeginInvoke((Action) delegate
                {
                    CMB_paramfiles.DataSource    = paramfiles.ToArray();
                    CMB_paramfiles.DisplayMember = "name";
                    CMB_paramfiles.Enabled       = true;
                    BUT_paramfileload.Enabled    = true;
                });
            }
            catch (Exception ex)
            {
                log.Error(ex);
            }
        }
        private void updatedefaultlist(object crap)
        {
            try
            {
                if (paramfiles == null)
                {
                    paramfiles = GitHubContent.GetDirContent("ardupilot", "ardupilot", "/Tools/Frame_params/", ".param");
                }

                if (this.IsDisposed)
                {
                    return;
                }

                BeginInvoke((Action) delegate
                {
                    CMB_paramfiles.DataSource    = paramfiles.ToArray();
                    CMB_paramfiles.DisplayMember = "name";
                    CMB_paramfiles.Enabled       = true;
                    BUT_paramfileload.Enabled    = true;
                });
            }
            catch (Exception ex)
            {
                log.Error(ex);
            }
        }
        void UpdateDefaultList()
        {
            Task.Run(delegate()
            {
                try
                {
                    if (paramfiles == null)
                    {
                        paramfiles = GitHubContent.GetDirContent("ardupilot", "ardupilot", "/Tools/Frame_params/", ".param");
                    }

                    if (!this.IsHandleCreated || this.IsDisposed)
                    {
                        return;
                    }

                    this.BeginInvoke((Action) delegate
                    {
                        CMB_paramfiles.DataSource    = paramfiles.ToArray();
                        CMB_paramfiles.DisplayMember = "name";
                        CMB_paramfiles.Enabled       = true;
                        BUT_paramfileload.Enabled    = true;
                    });
                }
                catch (Exception ex)
                {
                    log.Error(ex);
                }
            });
        }