Core config initial commit

main
Inga 🏳‍🌈 14 years ago
parent faadde7444
commit f5e7f1396d
  1. 33
      Core/Config.cs
  2. 1
      Core/Core.csproj

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FLocal.Core {
class Config<T> where T : Config<T> {
private static Config<T> _instance;
public static Config<T> instance {
get {
if(_instance == null) throw new FLocalException("not initialized");
return _instance;
}
private set {
lock(_instance) {
if(_instance != null) throw new FLocalException("already initialized");
_instance = value;
}
}
}
private Config() {
}
public static void doInit(Config<T> config) {
_instance = config;
}
}
}

@ -45,6 +45,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Config.cs" />
<Compile Include="DataObject.cs" />
<Compile Include="delegates\Lazy.cs" />
<Compile Include="delegates\Predicate.cs" />

Loading…
Cancel
Save