コード例 #1
0
        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;
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: Plasma-Paris/Wox.Plugins
        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;
        }
コード例 #3
0
        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;
        }