Why does MidiInPort:FromIdAsync return a (wrapped) MidiInport, and MidiOutPort return an *I*MidiOutPort?

Paul C Dempsey 1 Reputation point
2022-11-24T16:56:29.917+00:00

public static IAsyncOperation<MidiInPort> FromIdAsync(string deviceId);
public static IAsyncOperation<IMidiOutPort> FromIdAsync(string deviceId);

Why does MidiInPort:FromIdAsync return a (wrapped) MidiInport, and MidiOutPort return an IMidiOutPort?

Is this simply a naming inconsistency, or is there something more meaningful to the distinction?

Universal Windows Platform (UWP)
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,386 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Junjie Zhu - MSFT 13,971 Reputation points Microsoft Vendor
    2022-12-05T07:50:54.36+00:00

    Hello @Paul C Dempsey ,
    Welcome to Microsoft Q&A!

    I have received feedback from the team. This is by design, it does not affect the use.
    So you can cast the interface IMidiOutPort to a class MidiOutport, since we have access to this other class as well.

    Thank you.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments