public JrnlService(SettingElements settings, PluginInitContext context) { if (settings == null) throw new ArgumentNullException("settings", "settings is null."); if (context == null) throw new ArgumentNullException("context", "context is null."); _settings = settings; }
public void Init(PluginInitContext context) { if (context == null) throw new ArgumentNullException("context", "context is null."); _context = context; _settings = JsonConvert.DeserializeObject<SettingElements>( File.ReadAllText(Path.Combine(context.CurrentPluginMetadata.PluginDirectory, "setting.json"))); CustomResult.DefaultIcoPath = context.CurrentPluginMetadata.IcoPath; }
public SettingsForm(PluginInitContext context, SettingElements settings, SettingService service) { if (service == null) throw new ArgumentNullException("service", "service is null."); if (context == null) throw new ArgumentNullException("context", "context is null."); if (settings == null) throw new ArgumentNullException("settings", "settings is null."); _settings = settings; _service = service; _context = context; InitializeComponent(); _settings.PropertyChanged += (sender, e) => _service.SaveSettings(context, settings); DataContext = _settings; }