型System.Windows.PresentationFrameworkCollection<T>
は継承を意図していませんか? カスタム オブジェクトを作成しようとしましたが、<Type>AnimationsFromKeyFrames
明らかに Visual Studio がいくつかのエラーを作成しているため、KeyFrames プロパティの Collection タイプを作成できません。
Visual Studioは、継承されたオブジェクトのいずれにも存在しない
にもかかわらず、次の抽象メンバーが実装されていないと報告します。
'MyKeyFrameCollection' は、継承された抽象メンバー 'System.Windows.PresentationFrameworkCollection<MyKeyFrame>.SetItemImplSkipMethodPack(int, MyKeyFrame)' を実装していません
'MyKeyFrameCollection' は、継承された抽象メンバー 'System.Windows.PresentationFrameworkCollection<MyKeyFrame>.GetItemImplSkipMethodPack(int)' を実装していません
'MyKeyFrameCollection' は、継承された抽象メンバー 'System.Windows.PresentationFrameworkCollection<MyKeyFrame>.RemoveInternal(MyKeyFrame)' を実装していません
'MyKeyFrameCollection' は、継承された抽象メンバー 'System.Windows.PresentationFrameworkCollection<MyKeyFrame>.InsertInternal(int, MyKeyFrame)' を実装していません
'MyKeyFrameCollection' は、継承された抽象メンバー 'System.Windows.PresentationFrameworkCollection<MyKeyFrame>.IndexOfInternal(MyKeyFrame)' を実装していません
'MyKeyFrameCollection' は、継承された抽象メンバー 'System.Windows.PresentationFrameworkCollection<MyKeyFrame>.ContainsInternal(MyKeyFrame)' を実装していません
'MyKeyFrameCollection' は、継承された抽象メンバー 'System.Windows.PresentationFrameworkCollection<MyKeyFrame>.AddInternal(MyKeyFrame)' を実装していません
これらのメソッドをbizarro worldから実装するにはどうすればよいですか?または、Visual Studioに不満を言うのをやめてプロジェクトをコンパイルするように指示するのですか?
以下を使用してこれらのメソッドを明示的に定義しようとしましたが、これは機能しませんでした (当然のことながら、以前の存在しない発言によると)。
void System.Windows.PresentationFrameworkCollection<MyKeyFrame>.AddInternal(MyKeyFrame keyFrame)
void System.Collections.Generic.IList<MyKeyFrame>.AddInternal(MyKeyFrame keyFrame)
void System.Collections.Generic.ICollection<MyKeyFrame>.AddInternal(MyKeyFrame keyFrame)
void System.Collections.IList.AddInternal(MyKeyFrame keyFrame)
void System.Collections.ICollection.AddInternal(MyKeyFrame keyFrame)
最後に、MS はコミュニティが KeyFrameCollection を作成することを望んでいないと考えていますか?
編集:試してみましたが、唯一override
のオプションは、、、Equals
およびGetHashCode
ですToString
。これらの抽象メンバーはprotected internal
、既存のフレームワーク クラスがそれらから継承できるが、カスタム クラスは継承できない可能性がありますか?