Iは、コードのこの部分は、.NET 3.5Enumerable.First(System.Linqの)に代わるC#
public const string SvgNamespace = "http://www.w3.org/2000/svg";
public const string XLinkPrefix = "xlink";
public const string XLinkNamespace = "http://www.w3.org/1999/xlink";
public const string XmlNamespace = "http://www.w3.org/XML/1998/namespace";
public static readonly List<KeyValuePair<string, string>> Namespaces = new List<KeyValuePair<string, string>>()
{
new KeyValuePair<string, string>("", SvgNamespace),
new KeyValuePair<string, string>(XLinkPrefix, XLinkNamespace),
new KeyValuePair<string, string>("xml", XmlNamespace)
};
private bool _inAttrDictionary;
private string _name;
private string _namespace;
public string NamespaceAndName
{
get
{
if (_namespace == SvgNamespace)
return _name;
return Namespaces.First(x => x.Value == _namespace).Key + ":" + _name;
}
}
で実行されていると私は現在、(System.Linqのを取り除く)2.0を.NETに変換してい有します。 Enumerable.Firstメソッド(IEnumerable、Func)の機能を維持する方法hereはコード内にありますか?
完全なソースfile
_Namespaces_とは何ですか?この名前の変数はありません – Steve
@Steve、1つの 'public static readonly List> Namespaces' –
Rahul
@Rahul私はそれを今見ていますが、私の言い訳では、ソースコードを見ると投稿されたリンクでは、物事は本当に混乱します。 – Steve