ProtoGeometryConfigurationManager
using System;
using System.IO;
using System.Reflection;
namespace Autodesk.DesignScript.Geometry
{
internal class ProtoGeometryConfigurationManager
{
private static string mSettingFile;
private static string ConfigFileFullPath {
get {
string text = Path.Combine(Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath), mSettingFile);
if (!File.Exists(text))
return Application.Instance.Session.SearchFile(mSettingFile);
return text;
}
}
public static ProtoGeometryConfiguration Settings { get; set; }
static ProtoGeometryConfigurationManager()
{
mSettingFile = "ProtoGeometry.config";
string configFileFullPath = ConfigFileFullPath;
Settings = ProtoGeometryConfiguration.Deserialize(configFileFullPath);
if (!File.Exists(configFileFullPath))
ProtoGeometryConfiguration.Serialize(configFileFullPath, Settings);
}
public static void Save()
{
ProtoGeometryConfiguration.Serialize(ConfigFileFullPath, Settings);
}
}
}