private void ShowConformance(Enums.Conformance c) { if (UseLNCB.Checked) { GeneralProtectionCB.Checked = (c & Enums.Conformance.GeneralProtection) != 0; GeneralBlockTransferCB.Checked = (c & Enums.Conformance.GeneralBlockTransfer) != 0; Attribute0SetReferencingCB.Checked = (c & Enums.Conformance.Attribute0SupportedWithSet) != 0; PriorityManagementCB.Checked = (c & Enums.Conformance.PriorityMgmtSupported) != 0; Attribute0GetReferencingCB.Checked = (c & Enums.Conformance.Attribute0SupportedWithGet) != 0; GetBlockTransferCB.Checked = (c & Enums.Conformance.BlockTransferWithGetOrRead) != 0; SetBlockTransferCB.Checked = (c & Enums.Conformance.BlockTransferWithSetOrWrite) != 0; ActionBlockTransferCB.Checked = (c & Enums.Conformance.BlockTransferWithAction) != 0; MultipleReferencesCB.Checked = (c & Enums.Conformance.MultipleReferences) != 0; DataNotificationCB.Checked = (c & Enums.Conformance.DataNotification) != 0; AccessCB.Checked = (c & Enums.Conformance.Access) != 0; GetCB.Checked = (c & Enums.Conformance.Get) != 0; SetCB.Checked = (c & Enums.Conformance.Set) != 0; SelectiveAccessCB.Checked = (c & Enums.Conformance.SelectiveAccess) != 0; EventNotificationCB.Checked = (c & Enums.Conformance.EventNotification) != 0; ActionCB.Checked = (c & Enums.Conformance.EventNotification) != 0; } else { SNGeneralProtectionCB.Checked = (c & Enums.Conformance.GeneralProtection) != 0; SNGeneralBlockTransferCB.Checked = (c & Enums.Conformance.GeneralBlockTransfer) != 0; ReadCB.Checked = (c & Enums.Conformance.Read) != 0; WriteCB.Checked = (c & Enums.Conformance.Write) != 0; UnconfirmedWriteCB.Checked = (c & Enums.Conformance.UnconfirmedWrite) != 0; ReadBlockTransferCB.Checked = (c & Enums.Conformance.BlockTransferWithGetOrRead) != 0; WriteBlockTransferCB.Checked = (c & Enums.Conformance.BlockTransferWithSetOrWrite) != 0; SNMultipleReferencesCB.Checked = (c & Enums.Conformance.MultipleReferences) != 0; InformationReportCB.Checked = (c & Enums.Conformance.InformationReport) != 0; SNDataNotificationCB.Checked = (c & Enums.Conformance.DataNotification) != 0; ParameterizedAccessCB.Checked = (c & Enums.Conformance.ParameterizedAccess) != 0; } LNSettings.Visible = UseLNCB.Checked; SNSettings.Visible = !UseLNCB.Checked; }
private void UpdateConformance() { Enums.Conformance c = (Enums.Conformance) 0; if (UseLNCB.Checked) { if (GeneralProtectionCB.Checked) { c |= Enums.Conformance.GeneralProtection; } if (GeneralBlockTransferCB.Checked) { c |= Enums.Conformance.GeneralBlockTransfer; } if (Attribute0SetReferencingCB.Checked) { c |= Enums.Conformance.Attribute0SupportedWithSet; } if (PriorityManagementCB.Checked) { c |= Enums.Conformance.PriorityMgmtSupported; } if (Attribute0GetReferencingCB.Checked) { c |= Enums.Conformance.Attribute0SupportedWithGet; } if (GetBlockTransferCB.Checked) { c |= Enums.Conformance.BlockTransferWithGetOrRead; } if (SetBlockTransferCB.Checked) { c |= Enums.Conformance.BlockTransferWithSetOrWrite; } if (ActionBlockTransferCB.Checked) { c |= Enums.Conformance.BlockTransferWithAction; } if (MultipleReferencesCB.Checked) { c |= Enums.Conformance.MultipleReferences; } if (DataNotificationCB.Checked) { c |= Enums.Conformance.DataNotification; } if (AccessCB.Checked) { c |= Enums.Conformance.Access; } if (GetCB.Checked) { c |= Enums.Conformance.Get; } if (SetCB.Checked) { c |= Enums.Conformance.Set; } if (SelectiveAccessCB.Checked) { c |= Enums.Conformance.SelectiveAccess; } if (EventNotificationCB.Checked) { c |= Enums.Conformance.EventNotification; } if (ActionCB.Checked) { c |= Enums.Conformance.EventNotification; } } else { if (SNGeneralProtectionCB.Checked) { c |= Enums.Conformance.GeneralProtection; } if (SNGeneralBlockTransferCB.Checked) { c |= Enums.Conformance.GeneralBlockTransfer; } if (ReadCB.Checked) { c |= Enums.Conformance.Read; } if (WriteCB.Checked) { c |= Enums.Conformance.Write; } if (UnconfirmedWriteCB.Checked) { c |= Enums.Conformance.UnconfirmedWrite; } if (ReadBlockTransferCB.Checked) { c |= Enums.Conformance.BlockTransferWithGetOrRead; } if (WriteBlockTransferCB.Checked) { c |= Enums.Conformance.BlockTransferWithSetOrWrite; } if (SNMultipleReferencesCB.Checked) { c |= Enums.Conformance.MultipleReferences; } if (InformationReportCB.Checked) { c |= Enums.Conformance.InformationReport; } if (SNDataNotificationCB.Checked) { c |= Enums.Conformance.DataNotification; } if (ParameterizedAccessCB.Checked) { c |= Enums.Conformance.ParameterizedAccess; } } Target.client.ProposedConformance = c; }