public static INetCfgComponentBindings ToComponentBindings(this INetCfgComponent instance) { // ReSharper disable SuspiciousTypeConversion.Global // this is legit - c# equivalent of queryinterface com operation return((INetCfgComponentBindings)instance); // ReSharper restore SuspiciousTypeConversion.Global }
public static IEnumNetCfgBindingPath ToBindingPathCollection(this INetCfgComponent instance) { var bindings = instance.ToComponentBindings(); object rawBindingPath; if (0 != bindings.EnumBindingPaths((int)BindingPathsFlags.Below, out rawBindingPath)) { throw new Exception("Could not retrieve binding paths"); } return((IEnumNetCfgBindingPath)rawBindingPath); }