/// <summary> /// Determines whether the specified feature is supported. /// </summary> /// <param name="feature">The feature.</param> /// <returns></returns> /// <exception cref="System.ArgumentOutOfRangeException">feature;null</exception> public bool IsSupported(OpcDaGroupFeatures feature) { switch (feature) { case OpcDaGroupFeatures.Read: case OpcDaGroupFeatures.Write: return(Is <OpcSyncIO>()); case OpcDaGroupFeatures.ReadAsync: case OpcDaGroupFeatures.WriteAsync: case OpcDaGroupFeatures.RefreshAsync: case OpcDaGroupFeatures.Subscription: return(Is <OpcAsyncIO2>()); case OpcDaGroupFeatures.ReadMaxAge: case OpcDaGroupFeatures.WriteVQT: return(Is <OpcSyncIO2>()); case OpcDaGroupFeatures.ReadMaxAgeAsync: case OpcDaGroupFeatures.RefreshMaxAgeAsync: case OpcDaGroupFeatures.WriteVQTAsync: return(Is <OpcAsyncIO3>()); case OpcDaGroupFeatures.KeepAlive: return(Is <OpcItemMgt>()); case OpcDaGroupFeatures.Sampling: return(Is <OpcItemSamplingMgt>()); default: throw new ArgumentOutOfRangeException("feature", feature, null); } }
private void CheckSupported(OpcDaGroupFeatures feature) { switch (feature) { case OpcDaGroupFeatures.Read: case OpcDaGroupFeatures.Write: if (!Is <OpcSyncIO>()) { throw ExceptionHelper.NotSupportedDa2x(); } break; case OpcDaGroupFeatures.ReadAsync: case OpcDaGroupFeatures.WriteAsync: case OpcDaGroupFeatures.RefreshAsync: case OpcDaGroupFeatures.Subscription: if (!Is <OpcAsyncIO2>()) { throw ExceptionHelper.NotSupportedDa2x(); } break; case OpcDaGroupFeatures.ReadMaxAge: case OpcDaGroupFeatures.WriteVQT: if (!Is <OpcSyncIO>()) { throw ExceptionHelper.NotSupportedDa3x(); } break; case OpcDaGroupFeatures.ReadMaxAgeAsync: case OpcDaGroupFeatures.RefreshMaxAgeAsync: case OpcDaGroupFeatures.WriteVQTAsync: if (!Is <OpcAsyncIO3>()) { throw ExceptionHelper.NotSupportedDa3x(); } break; case OpcDaGroupFeatures.KeepAlive: if (!Is <OpcItemMgt>()) { throw ExceptionHelper.NotSupportedDa3x(); } break; case OpcDaGroupFeatures.Sampling: if (!Is <OpcItemSamplingMgt>()) { throw ExceptionHelper.NotSupportedDa3x(); } break; default: throw new ArgumentOutOfRangeException("feature", feature, null); } }