RhSolutions-AddIn/RhSolutions.AddIn/Services/AddInConfiguration.cs

40 lines
1007 B
C#
Raw Normal View History

2023-03-28 07:25:10 +03:00
using System;
using System.Configuration;
using System.IO;
namespace RhSolutions.Services
{
public class AddInConfiguration : ApplicationSettingsBase, IAddInConfiguration
{
[UserScopedSetting]
public string PriceListPath
{
get
{
return (string)this["PriceListPath"];
}
set
{
this["PriceListPath"] = value;
}
}
public event SettingChangingEventHandler OnSettingsChange
{
add
{
base.SettingChanging += value;
}
remove
{
base.SettingChanging -= value;
}
}
public string GetPriceListFileName() => Path.GetFileName(PriceListPath);
public string GetPriceListPath() => PriceListPath;
public void SetPriceListPath(string value) => PriceListPath = value;
public void SaveSettings() => base.Save();
}
}