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

40 lines
1019 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
{
2023-03-28 07:33:32 +03:00
return (string)this[nameof(PriceListPath)];
2023-03-28 07:25:10 +03:00
}
set
{
2023-03-28 07:33:32 +03:00
this[nameof(PriceListPath)] = value;
2023-03-28 07:25:10 +03:00
}
}
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();
}
}