protected override void OnInitialize()
        {
            base.OnInitialize();
            var action = new ConfigItemAction( this.ConfigManager, new SimpleCommand( StartScrollEditor ) );
            action.ImagePath = "Forward.png";
            action.DisplayName = R.ScrollConfig;
            this.Items.Add( action );

            this.AddLink( _scVm ?? (_scVm = new ScrollingModulesConfigurationViewModel( R.OtherScrollConfig, _app )) );
        }
        protected override void OnInitialize()
        {
            var profiles = this.AddCurrentItem( R.Profile, "", _app.CivikeyHost.Context.ConfigManager.SystemConfiguration, a => a.CurrentUserProfile, a => a.UserProfiles, false, "" );
            _app.CivikeyHost.Context.ConfigManager.SystemConfiguration.UserProfiles.CollectionChanged += ( s, e ) =>
            {
                profiles.RefreshValues( s, e );
            };

            {
                var action = new ConfigItemAction( this.ConfigManager, new SimpleCommand( StartImport ) );
                action.ImagePath = "Forward.png";
                action.DisplayName = R.ImportKeyboard;
                this.Items.Add( action );
            }

            {
                var action = new ConfigItemAction( this.ConfigManager, new SimpleCommand( StartExport) );
                action.ImagePath = "Forward.png";
                action.DisplayName = R.ExportKeyboard;
                this.Items.Add( action );
            }

            base.OnInitialize();
        }
        protected override void OnInitialize()
        {
            _keyboardEditorId = new Guid( "{66AD1D1C-BF19-405D-93D3-30CA39B9E52F}" );

            var profiles = this.AddCurrentItem( R.Profile, "", _app.CivikeyHost.Context.ConfigManager.SystemConfiguration, a => a.CurrentUserProfile, a => a.UserProfiles, false, "" );
            _app.CivikeyHost.Context.ConfigManager.SystemConfiguration.UserProfiles.CollectionChanged += ( s, e ) =>
            {
                profiles.RefreshValues( s, e );
            };

            //JL : this feature has been removed.
            //this.AddLink( _sVm ?? ( _sVm = new SkinViewModel( _app ) ) );

            //JL : 13/12/2013 : The screenscroller editor presents performance issues when modifying parameters.
            //For now, I'll let this plugin without configuration, we'll ask the ergotherapist whether the configuration panel is necessary before spending time on it.
            //this.AddLink( _ssVm ?? ( _ssVm = new ScreenScrollerViewModel( _app ) ) );

            var g = this.AddGroup();

            g.AddLink( _appAdvcVm ?? (_appAdvcVm = new AppAdvancedConfigViewModel( _app )) );
            g.AddLink( _scVm ?? (_scVm = new ScrollingViewModel( R.ScrollConfig, _app )) );
            g.AddLink( _acVm ?? (_acVm = new AutoClickViewModel( _app )) );
            g.AddLink( _wpVm ?? (_wpVm = new WordPredictionViewModel( _app )) );

            g.AddLink( _skVm ?? (_skVm = new ShareKeyboardViewModel( _app )) );

            {
                var action = new ConfigItemAction( this.ConfigManager, new SimpleCommand( StartKeyboardEditor ) );
                action.ImagePath = "Forward.png";
                action.DisplayName = R.SkinEditorSectionName;
                g.Items.Add( action );
            }

            //{
            //    var action = new ConfigItemAction( this.ConfigManager, new SimpleCommand( StartRadarEditor ) );
            //    action.ImagePath = "Forward.png";
            //    action.DisplayName = R.RadarConfiguration;
            //    this.Items.Add( action );
            //}

            //{
            //    var action = new ConfigItemAction( this.ConfigManager, new SimpleCommand( StartScreenScrollerEditor ) );
            //    action.ImagePath = "Forward.png";
            //    action.DisplayName = R.ScreenScrollerConfiguration;
            //    this.Items.Add( action );
            //}

            g.AddLink( new CreditViewModel( _app ) );

            this.AddAction( R.ObjectExplorer, R.AdvancedUserNotice, StartObjectExplorer );

            base.OnInitialize();
        }
Example #4
0
        protected override void OnInitialize()
        {
            _keyboardEditorId = new Guid( "{66AD1D1C-BF19-405D-93D3-30CA39B9E52F}" );

            var profiles = this.AddCurrentItem( R.Profile, "", _app.CivikeyHost.Context.ConfigManager.SystemConfiguration, a => a.CurrentUserProfile, a => a.UserProfiles, false, "" );
            _app.CivikeyHost.Context.ConfigManager.SystemConfiguration.UserProfiles.CollectionChanged += ( s, e ) =>
            {
                profiles.RefreshValues( s, e );
            };

            this.AddLink( _appAdvcVm ?? ( _appAdvcVm = new AppAdvancedConfigViewModel( _app ) ) );
            this.AddLink( _sVm ?? ( _sVm = new SkinViewModel( _app ) ) );
            this.AddLink( _acVm ?? (_acVm = new AutoClickViewModel( _app )) );
            this.AddLink( _wpVm ?? (_wpVm = new WordPredictionViewModel( _app )) );

            {
                var action = new ConfigItemAction( this.ConfigManager, new SimpleCommand( StartScrollEditor ) );
                action.ImagePath = "Forward.png";
                action.DisplayName = R.ScrollConfig;
                this.Items.Add( action );
            }

            {
                var action = new ConfigItemAction( this.ConfigManager, new SimpleCommand( StartKeyboardEditor ) );
                action.ImagePath = "Forward.png";
                action.DisplayName = R.SkinEditorSectionName;
                this.Items.Add( action );
            }

            this.AddAction( R.ObjectExplorer, R.AdvancedUserNotice, StartObjectExplorer );

            base.OnInitialize();
        }
        private void ApplyConfig(ConfigItemAction action)
        {
            IntPtr pStruct = IntPtr.Zero;

            HttpApi.HTTP_SERVICE_CONFIG_URLACL_SET setStruct = new HttpApi.HTTP_SERVICE_CONFIG_URLACL_SET();

            setStruct.KeyDesc.pUrlPrefix = this.Url;

            setStruct.ParamDesc.pStringSecurityDescriptor = this.Dacl.ToSddl();

            try
            {
                pStruct = Marshal.AllocHGlobal(Marshal.SizeOf(setStruct));

                Marshal.StructureToPtr(setStruct, pStruct, false);

                //if(this.presentInHttpCfg && 
                //    (action == ConfigItemAction.Delete || action == ConfigItemAction.Update))
                if (this.presentInHttpCfg)
                {
                    HttpApi.Error error = HttpApi.HttpDeleteServiceConfiguration(
                        IntPtr.Zero,
                        HttpApi.HTTP_SERVICE_CONFIG_ID.HttpServiceConfigUrlAclInfo,
                        pStruct,
                        Marshal.SizeOf(setStruct),
                        IntPtr.Zero);
                        
                    ErrorCheck.VerifySuccess(error, "HttpDeleteServiceConfiguration (URLACL) failed.");
                }

                if (action == ConfigItemAction.Create|| action == ConfigItemAction.Update)
                {
                    HttpApi.Error error = HttpApi.HttpSetServiceConfiguration(
                        IntPtr.Zero,
                        HttpApi.HTTP_SERVICE_CONFIG_ID.HttpServiceConfigUrlAclInfo,
                        pStruct,
                        Marshal.SizeOf(setStruct),
                        IntPtr.Zero);

                    if (error != HttpApi.Error.ERROR_ALREADY_EXISTS)
                        ErrorCheck.VerifySuccess(error, "HttpSetServiceConfiguration (URLACL) failed.");
                }
            }
            finally
            {
                if(pStruct != IntPtr.Zero)
                {
                    Marshal.DestroyStructure(pStruct, typeof(HttpApi.HTTP_SERVICE_CONFIG_URLACL_SET));
                    Marshal.FreeHGlobal(pStruct);
                }
            }
        }