Windows에서 수업 탐색하기 Forms 앱을 Windows 앱에 저장합니다. 내가 인터넷에서있어이 클래스는 CollectionBase에이 스토어 앱으로 인정되지 않는다 위의 클래스에서 아래Windows 8 Store 앱에서 C# CollectionBase를 어떻게 대체합니까?
public class ElementList : CollectionBase
{
/// <summary>
/// A Collection of Element Nodes
/// </summary>
public ElementList()
{
}
public void Add(Node e)
{
// can't add a empty node, so return immediately
// Some people tried dthis which caused an error
if (e == null)
return;
this.List.Add(e);
}
// Method implementation from the CollectionBase class
public void Remove(int index)
{
if (index > Count - 1 || index < 0)
{
// Handle the error that occurs if the valid page index is
// not supplied.
// This exception will be written to the calling function
throw new Exception("Index out of bounds");
}
List.RemoveAt(index);
}
public void Remove(Element e)
{
List.Remove(e);
}
public Element Item(int index)
{
return (Element) this.List[index];
}
}
을 표시됩니다. Windows 8 앱으로 이동하는 방법을 알려주세요. . .
미리 감사드립니다.
답장을 보내 주셔서 감사합니다. 위 코드에서 List.Add()를 사용하여 System.Collections.ObjectModel 또는 System.Collections.Generic을 사용하여 어떻게 할 수 있습니까? . . – ggsmartboy