File added.

This commit is contained in:
Jim Norman 2006-07-12 19:33:28 +00:00
parent 2af5095c4e
commit fcc9dfec98

68
CASA/gui/Config.cs Normal file
View File

@ -0,0 +1,68 @@
using System;
using Novell.CASA.CASAPolicy;
namespace Novell.CASA.GUI
{
/// <summary>
/// Summary description for Config.
/// </summary>
public class Config
{
private UIPol uiPolicy = null;
public Config()
{
if (uiPolicy == null)
{
uiPolicy = (UIPol)ICASAPol.GetPolicy(CASAPolType.UI_POL);
}
}
public void SetConfigSetting(string sName, bool bValue)
{
if (bValue)
SetConfigSetting(sName, "1");
else
SetConfigSetting(sName, "0");
}
public void SetConfigSetting(string sName, string sValue)
{
uiPolicy.SetConfigSetting(sName, sValue);
}
public bool GetConfigSetting(string sName, bool bDefaultValue)
{
string sDefault = "0";
if (bDefaultValue)
sDefault = "1";
string sValue = GetConfigSetting(sName, sDefault);
{
if (sValue != null)
{
if (sValue.Equals("1"))
return true;
else
return false;
}
else
return bDefaultValue;
}
}
public string GetConfigSetting(string sName, string sDefaultValue)
{
string sValue = uiPolicy.GetConfigSetting(sName);
if (sValue == null)
return sDefaultValue;
else
return sValue;
}
public void WriteConfig()
{
uiPolicy.WriteConfig();
}
}
}