1
코드 뒤에 전체 resx 파일을 읽을 필요가 있습니다. 나는 이렇게했습니다 :ResXResourceReader에서 데이터를 정렬/정렬 할 수 있습니까?
ResXResourceReader rsxrOrganizationSubtypes = new ResXResourceReader(@"D:\DNN_Cafaas\DesktopModules\OPEGIEKA.DNN.Modules.CreateInstitution\App_LocalResources\OrganizationSubtypes.resx");
rsxrOrganizationSubtypes.UseResXDataNodes = true;
IDictionaryEnumerator dict = rsxrOrganizationSubtypes.GetEnumerator();
while (dict.MoveNext())
{
ResXDataNode node = (ResXDataNode)dict.Value;
}
resx 파일에서 결과를 정렬/정렬 할 수 있습니까? 예를 들어 Name?
해결 (resx 파일에서 값순으로 정렬). 어쩌면이 그것을 할 수있는 더 좋은 방법이 있지만, 그 작업 :
ResXResourceReader rsxr = new ResXResourceReader(PathToResX);
rsxr.UseResXDataNodes = true;
IDictionaryEnumerator dictRSXR = rsxr.GetEnumerator();
SortedDictionary<string, string> sortedRSXR = new SortedDictionary<string, string>();
while (dictRSXR.MoveNext())
{
ResXDataNode node = (ResXDataNode)dictRSXR.Value;
sortedRSXR.Add(node.GetValue((ITypeResolutionService)null).ToString(), node.Name);
}
foreach (KeyValuePair<string, string> p in sortedRSXR)
{
counterDDL++;
dropDownList.Items.Insert(counterDDL, new ListItem(p.Key, p.Value));
}
감사합니다. 정말 도움이되었습니다. 내 게시물을 편집하고 동일한 문제가있는 사람을 위해 해결 방법을 추가했습니다. :) –