public void DisplayModel(RegistrationControlRecord registrationControl) { this.registrationControl = registrationControl; this.forceAffineCheckBox.Visible = BuildConfig.theConfig.forceAffineControlVisible; this.pinList.Rows.Clear(); if (registrationControl != null) { foreach (PositionAssociation current in registrationControl.model.GetAssociationList()) { DataGridViewRow dataGridViewRow = new DataGridViewRow(); string text = string.Format("{0}, {1}", this.dms.FormatLatLon(current.globalPosition.pinPosition.lat), this.dms.FormatLatLon(current.globalPosition.pinPosition.lon)); dataGridViewRow.CreateCells(this.pinList, new object[] { current.pinId, current.associationName, text, current.qualityMessage }); dataGridViewRow.Tag = current; this.pinList.Rows.Add(dataGridViewRow); } if (registrationControl.model.isLocked) { this.pinText.Enabled = (this.addPushPinButton.Enabled = (this.updatePushPinButton.Enabled = false)); this.removePushPinButton.Enabled = false; this.removeAllPushpinsButton.Enabled = false; this.getStartedBox.Visible = false; } else { bool flag = registrationControl.model.GetAssociationList().Count > 0; this.pinText.Enabled = (this.addPushPinButton.Enabled = (this.updatePushPinButton.Enabled = true)); this.removeAllPushpinsButton.Enabled = flag; this.getStartedBox.Visible = !flag; } } else { this.removePushPinButton.Enabled = false; this.removeAllPushpinsButton.Enabled = false; this.pinText.Enabled = (this.addPushPinButton.Enabled = (this.updatePushPinButton.Enabled = false)); } this.updateWarpStyle(); }
public void DisplayModel(RegistrationControlRecord registrationControl) { this.registrationControl = registrationControl; this.forceAffineCheckBox.Visible = BuildConfig.theConfig.forceAffineControlVisible; this.pinList.Rows.Clear(); if (registrationControl != null) { foreach (PositionAssociation current in registrationControl.model.GetAssociationList()) { DataGridViewRow dataGridViewRow = new DataGridViewRow(); string text = string.Format("{0}, {1}", this.dms.FormatLatLon(current.globalPosition.pinPosition.lat), this.dms.FormatLatLon(current.globalPosition.pinPosition.lon)); dataGridViewRow.CreateCells(this.pinList, new object[] { current.pinId, current.associationName, text, current.qualityMessage }); dataGridViewRow.Tag = current; this.pinList.Rows.Add(dataGridViewRow); } if (registrationControl.model.isLocked) { this.pinText.Enabled = (this.addPushPinButton.Enabled = (this.updatePushPinButton.Enabled = false)); this.removePushPinButton.Enabled = false; this.removeAllPushpinsButton.Enabled = false; this.getStartedBox.Visible = false; } else { bool flag = registrationControl.model.GetAssociationList().Count > 0; this.pinText.Enabled = (this.addPushPinButton.Enabled = (this.updatePushPinButton.Enabled = true)); this.removeAllPushpinsButton.Enabled = flag; this.getStartedBox.Visible = !flag; } } else { this.removePushPinButton.Enabled = false; this.removeAllPushpinsButton.Enabled = false; this.pinText.Enabled = (this.addPushPinButton.Enabled = (this.updatePushPinButton.Enabled = false)); } this.updateWarpStyle(); }
public void setDisplayedRegistration(RegistrationControlRecord display) { PositionAssociation oldSelectedPA = this.registrationControls.GetSelected(); this.displayedRegistration = display; this.updateRegistrationDisplay(); PositionAssociation selected = null; if (oldSelectedPA != null && this.displayedRegistration != null) { selected = this.displayedRegistration.model.GetAssociationList().Find((PositionAssociation pa) => pa.pinId == oldSelectedPA.pinId); } this.registrationControls.SetSelected(selected); }