Merge tested
This commit is contained in:
@@ -22,18 +22,13 @@ namespace BeWo.Data.ICF
|
||||
{
|
||||
try
|
||||
{
|
||||
string file = ConfigurationManager.AppSettings.Get("ICFFile");
|
||||
if (String.IsNullOrEmpty(file) ||
|
||||
!File.Exists(BS.Shared.Core.Utils.CreateSavePath(AppDomain.CurrentDomain.BaseDirectory, @"bin\ICF\" + file)))
|
||||
{
|
||||
file = "icf.xml";
|
||||
}
|
||||
var filename = GetFileName();
|
||||
|
||||
var baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
|
||||
|
||||
file = BS.Shared.Core.Utils.CreateSavePath(AppDomain.CurrentDomain.BaseDirectory, @"bin\ICF\" + file);
|
||||
var filepath = BS.Shared.Core.Utils.CreateSavePath(AppDomain.CurrentDomain.BaseDirectory, @"bin\ICF\" + filename);
|
||||
//file = @"D:\Projects\beyondSoft\BeWoPlaner\BeWo\Data\ICF\icf.xml";
|
||||
_File = XDocument.Load(file);
|
||||
_File = XDocument.Load(filepath);
|
||||
|
||||
Debug.WriteLine("Dokument geladen");
|
||||
_Root = _File.Descendants("Class").Where(x => x.Attribute("code")?.Value == "d" /*|| x.Attribute("code")?.Value == "s" ||
|
||||
@@ -54,6 +49,21 @@ namespace BeWo.Data.ICF
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetFileName()
|
||||
{
|
||||
string filename = ConfigurationManager.AppSettings.Get("ICFFile");
|
||||
|
||||
if (String.IsNullOrEmpty(filename))
|
||||
return "icf.xml";
|
||||
|
||||
string path = BS.Shared.Core.Utils.CreateSavePath(AppDomain.CurrentDomain.BaseDirectory, @"bin\ICF\" + filename);
|
||||
|
||||
if (File.Exists(path))
|
||||
return filename;
|
||||
|
||||
return "icf.xml";
|
||||
}
|
||||
|
||||
public static IList<ValueListEntryDC> GetIcf()
|
||||
{
|
||||
if (_Root == null)
|
||||
|
||||
Reference in New Issue
Block a user