public void Initialize() { Mock <ISettingsDataProvider> mock = new Mock <ISettingsDataProvider>(); settingsDataProvider = mock.Object; var settings = new List <SettingModel>(); settings.Add(new SettingModel() { SettingsID = 1, SettingsType = SettingType.Application.ToString(), SettingsTypeID = 1, Settings = "SettingName1", Value = "SettingValue1", IsActive = true, ModifiedBy = 1, ModifiedOn = DateTime.Now }); settings.Add(new SettingModel() { SettingsID = 2, SettingsType = SettingType.Application.ToString(), SettingsTypeID = 1, Settings = "SettingName2", Value = "SettingValue2", IsActive = true, ModifiedBy = 1, ModifiedOn = DateTime.Now }); var allSettings = new Response <SettingModel>() { DataItems = settings }; //GetNonUserSettings Response <SettingModel> settingResponse = new Response <SettingModel> { DataItems = settings.Where(s => s.Value.Contains("SettingValue")).ToList() }; mock.Setup(s => s.GetSettingsByType(It.IsAny <List <SettingType> >())).Returns(allSettings); //UpdateSetting mock.Setup(s => s.UpdateSetting(It.IsAny <SettingModel>())).Callback((SettingModel settingModel) => settings.Add(settingModel)).Returns(allSettings); //GetSettingsToCache Response <SettingModel> settingCacheResponse = new Response <SettingModel>(); settingCacheResponse.DataItems = settings.Where(s => s.Value.Contains("SettingValue")).ToList(); mock.Setup(s => s.GetSettingsToCache()).Returns(allSettings); }
public MainViewModel(IInkPageDataprovider inkPageDataProvider, ISettingsDataProvider settingsDataProvider, InkCanvas inkCanvas, Rectangle rectangle) { _settingsDataProvider = settingsDataProvider; _inkPageDataProvider = inkPageDataProvider; //DefaultColors Colors_BallpointPen = new BrushCollection() { new SolidColorBrush(Windows.UI.Colors.Black), new SolidColorBrush(Windows.UI.Colors.Gray), new SolidColorBrush(Windows.UI.Colors.MediumVioletRed), new SolidColorBrush(Windows.UI.Colors.Red), new SolidColorBrush(Windows.UI.Colors.Orange), new SolidColorBrush(Windows.UI.Colors.Gold), new SolidColorBrush(ColorsHelper.GetColorFromHexa("#A2E61B").Color), new SolidColorBrush(ColorsHelper.GetColorFromHexa("#008055").Color), new SolidColorBrush(ColorsHelper.GetColorFromHexa("#00AACC").Color), new SolidColorBrush(ColorsHelper.GetColorFromHexa("#004DE6").Color), new SolidColorBrush(ColorsHelper.GetColorFromHexa("#6600CC").Color), new SolidColorBrush(ColorsHelper.GetColorFromHexa("#8E562E").Color), }; Colors_Pencil = new BrushCollection() { new SolidColorBrush(Windows.UI.Colors.Black), new SolidColorBrush(Windows.UI.Colors.Gray), new SolidColorBrush(Windows.UI.Colors.MediumVioletRed), new SolidColorBrush(Windows.UI.Colors.Red), new SolidColorBrush(Windows.UI.Colors.Orange), new SolidColorBrush(Windows.UI.Colors.Gold), new SolidColorBrush(ColorsHelper.GetColorFromHexa("#A2E61B").Color), new SolidColorBrush(ColorsHelper.GetColorFromHexa("#008055").Color), new SolidColorBrush(ColorsHelper.GetColorFromHexa("#00AACC").Color), new SolidColorBrush(ColorsHelper.GetColorFromHexa("#004DE6").Color), new SolidColorBrush(ColorsHelper.GetColorFromHexa("#6600CC").Color), new SolidColorBrush(ColorsHelper.GetColorFromHexa("#8E562E").Color), }; Colors_Highlighter = new BrushCollection() { new SolidColorBrush(ColorsHelper.GetColorFromHexa("#FFE600").Color), new SolidColorBrush(ColorsHelper.GetColorFromHexa("#26E600").Color), new SolidColorBrush(ColorsHelper.GetColorFromHexa("#44C8F5").Color), new SolidColorBrush(ColorsHelper.GetColorFromHexa("#EC008C").Color), new SolidColorBrush(ColorsHelper.GetColorFromHexa("#FF5500").Color), new SolidColorBrush(ColorsHelper.GetColorFromHexa("#6600CC").Color), }; }
public SettingsController(ISettingsDataProvider settingsDataProvider) { this.settingsDataProvider = settingsDataProvider; }
public SettingsRetrieverProxy() { _provider = DI.Factory.GetInstance <ISettingsDataProvider <ParseObject> >(); _dictionary = _provider.GetOfflineSettings(); }
public ModuleSettingsInfo(string in_page_name, FrameworkElement in_form, ISettingsDataProvider in_data_provider) { PageName = in_page_name; Form = in_form; DataProvider = in_data_provider; }