Login
Веселая фича
565 просмотров
Перейти к просмотру всей ветки
in Antwort Posmotrim 16.01.13 18:11
И так - код
[пре]
public class TTemplatesDll
{
string templateDir;
private TTemplatesDll()
{
}
private static TTemplatesDll instance;
public static TTemplatesDll Instance
{
get
{
if (instance == null)
{
instance = new TTemplatesDll();
instance.filename = defaultDllName;
}
return instance;
}
}
public static string TemplateDir
{
set
{
Instance.templateDir = value;
new TModules(value);
logger.Debug("TemplatesDir seted as " + value);
}
get
{
if (Instance.templateDir == null || Instance.templateDir == string.Empty)
{
throw new Exception("Pointer to Template's directory not initialized");
}
return Instance.templateDir;
}
}
}
public class TModules : List<TAbc>
{
private static string DefaultCstFolder = TTemplatesDll.TemplateDir;
public TModules(string pTemplatesDir)
{
/// обрезано
}
public int Remove() // падает с Ехцептионом на вызове этого метода. Сам метод - не выполняется.
{
return base.RemoveAll(x => !x.Exists());
}
}
public class TAbc
{
public bool Exsist() { ... }
}
[/пре]
[пре]
public class TTemplatesDll
{
string templateDir;
private TTemplatesDll()
{
}
private static TTemplatesDll instance;
public static TTemplatesDll Instance
{
get
{
if (instance == null)
{
instance = new TTemplatesDll();
instance.filename = defaultDllName;
}
return instance;
}
}
public static string TemplateDir
{
set
{
Instance.templateDir = value;
new TModules(value);
logger.Debug("TemplatesDir seted as " + value);
}
get
{
if (Instance.templateDir == null || Instance.templateDir == string.Empty)
{
throw new Exception("Pointer to Template's directory not initialized");
}
return Instance.templateDir;
}
}
}
public class TModules : List<TAbc>
{
private static string DefaultCstFolder = TTemplatesDll.TemplateDir;
public TModules(string pTemplatesDir)
{
/// обрезано
}
public int Remove() // падает с Ехцептионом на вызове этого метода. Сам метод - не выполняется.
{
return base.RemoveAll(x => !x.Exists());
}
}
public class TAbc
{
public bool Exsist() { ... }
}
[/пре]