Exemplo n.º 1
0
        public string ShowOptionsDialog(IntPtr hParentWnd, string parameters)
        {
            ISettingsOriginator originator = RestoreFromParameters(parameters);

            //Show the options dialog
            FormOptions  frm          = _kernel.Get <FormOptions>(new ConstructorArgument("originator", originator));
            NativeWindow nativeWindow = new NativeWindow();

            try
            {
                nativeWindow.AssignHandle(hParentWnd);
            }
            catch { nativeWindow = null; }

            if (nativeWindow != null)
            {
                frm.ShowDialog(nativeWindow);
            }
            else
            {
                frm.ShowDialog();
            }

            //Save our memento
            return(originator.GetMemento().ToString());
        }
Exemplo n.º 2
0
        private void SaveCurrentUserSettings(ISettingsOriginator orig)
        {
            //Grab settings as string
            ISettingsService svc = _kernel.Get <ISettingsService>();

            foreach (ISetting sett in orig.GetMemento().Settings)
            {
                svc.Set(sett);
            }
        }
Exemplo n.º 3
0
        public void Initalize()
        {
            //Reset our settings memento before we start
            _memento = _settings.GetMemento();

            //Set up the view
            ISetting url = _settings.Get(YurtleTrackPlugin.URLOPTIONNAME);

            if (url != null)
            {
                _view.URL = url.Value;
            }
            else
            {
                _view.URL = string.Empty;
            }

            ISetting user = _settings.Get(YurtleTrackPlugin.USEROPTIONNAME);

            if (url != null)
            {
                _view.UserName = user.Value;
            }
            else
            {
                _view.UserName = string.Empty;
            }

            ISetting pass = _settings.Get(YurtleTrackPlugin.PASSWORDOPTIONNAME);

            if (url != null)
            {
                _view.Password = pass.Value;
            }
            else
            {
                _view.Password = string.Empty;
            }
        }
Exemplo n.º 4
0
        private void SaveCurrentUserSettings(ISettingsOriginator orig)
        {
            //Grab settings as string
            ISettingsService svc = _kernel.Get<ISettingsService>();

            foreach (ISetting sett in orig.GetMemento().Settings)
                svc.Set(sett);
        }