コード例 #1
0
        private void readAll_Click(object sender, EventArgs e)
        {
            for (int row = 0; row < view.RowCount; ++row)
            {
                Source_GPIO pin =
                    (( BindingSource )this.view.DataSource)
                    [
                        row
                    ]
                    as Source_GPIO;

                pin.Access = Source_GPIO.OpAccess.GET;

                pin.load(LakeChabotReader.MANAGED_ACCESS, this._reader.ReaderHandle);
            }

            this.view.Refresh( );
        }
コード例 #2
0
        private void view_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex == this.buttonColumn.Index)
            {
                Source_GPIO pin =
                    (( BindingSource )this.view.DataSource)
                    [
                        e.RowIndex
                    ]
                    as Source_GPIO;

                //Clark 2011.2.22   If can't get pin status, doesn't support this function.
                if (pin.Status == Source_GPIO.OpResult.UNSUPPORTED)
                {
                    return;
                }


                switch (pin.Access)
                {
                case Source_GPIO.OpAccess.GET:
                {
                    pin.load(LakeChabotReader.MANAGED_ACCESS, this._reader.ReaderHandle);
                }
                break;

                case Source_GPIO.OpAccess.SET:
                {
                    pin.store(LakeChabotReader.MANAGED_ACCESS, this._reader.ReaderHandle);
                }
                break;

                default:
                {
                    // NOP
                }
                break;
                }

                this.view.Refresh( );
            }
        }