public override bool UpdateSettings(IPropertySettings settings)
        {
            var tinyMceSettings = (TinyMCESettings) settings;

            string preUpdate = SerializeValues(tinyMceSettings);
            
            tinyMceSettings.ToolbarRows = new List<ToolbarRow>();
            IEnumerable<string[]> toolbarRowSpecifications = GetToolBarRows();
            foreach (var rowSpecification in toolbarRowSpecifications)
            {
                var row = new ToolbarRow();
                foreach (var buttonName in rowSpecification)
                {
                    row.Buttons.Add(buttonName);
                }
                tinyMceSettings.ToolbarRows.Add(row);
            }

            if (Width == IntegerNotSetValue)
                tinyMceSettings.Width = ((TinyMCESettings)tinyMceSettings.GetDefaultValues()).Width;
            else
                tinyMceSettings.Width = Width;

            if (Height == IntegerNotSetValue)
                tinyMceSettings.Height = ((TinyMCESettings)tinyMceSettings.GetDefaultValues()).Height;
            else
                tinyMceSettings.Height = Height;

            string afterUpdate = SerializeValues(tinyMceSettings);
            
            return !afterUpdate.Equals(preUpdate);
        }
 public void CustomizeLaunchConfiguration(DebugLaunchActionContext debugLaunchActionContext, IPropertySettings launchSettings) {
     launchSettings[PythonLaunchDebugTargetProvider.InterpreterKey] = "(default)";
     launchSettings[PythonLaunchDebugTargetProvider.InterpreterArgumentsKey] = string.Empty;
     launchSettings[PythonLaunchDebugTargetProvider.ScriptArgumentsKey] = string.Empty;
     launchSettings[PythonLaunchDebugTargetProvider.NativeDebuggingKey] = false;
     launchSettings[PythonLaunchDebugTargetProvider.WebBrowserUrlKey] = string.Empty;
 }
Exemple #3
0
        public T Get <T>(string name, T defaultValue, params Func <UIComponentMetadata, IEnumerable <IPropertySettings> >[] propertySettingsGetters)
        {
            if (values.TryGetValue(name, out object value))
            {
                return((T)value);
            }

            if (Metadata != null && propertySettingsGetters.Any())
            {
                IPropertySettings propertySettings = propertySettingsGetters.
                                                     SelectMany(x => x(Metadata)).
                                                     Where(x => x != null).
                                                     FirstOrDefault(x => x.Properties.Contains(name));

                if (propertySettings != null)
                {
                    return((T)propertySettings.Properties[name]);
                }
            }

            return(defaultValue);
        }
        public GroupsModule(
            GroupService groupService,
            GroupValidator validator,
            ILogger logger,
            IPropertySettings propertySettings = null) : base("/v1/groups", logger, validator, propertySettings)
        {
            _groupService = groupService;

            Post("/", async _ => await AddGroup(), null, "AddGroup");

            Post("/UpdateGroups", async _ => await UpdateGroupList().ConfigureAwait(false), null, "UpdateGroups");

            base.Get("/{groupName}", async p => await this.GetGroup(p).ConfigureAwait(false), null, "GetGroup");

            base.Delete("/{groupName}", async p => await this.DeleteGroup(p).ConfigureAwait(false), null,
                        "DeleteGroup");

            // group->role mappings
            Get("/{groupName}/roles", async _ => await GetRolesFromGroup().ConfigureAwait(false), null,
                "GetRolesFromGroup");

            Post("/{groupName}/roles", async _ => await AddRoleToGroup().ConfigureAwait(false), null,
                 "AddRoleToGroup");

            Delete("/{groupName}/roles", async _ => await DeleteRoleFromGroup().ConfigureAwait(false), null,
                   "DeleteRoleFromGroup");

            // (custom) group->user mappings
            Get("/{groupName}/users", async _ => await GetUsersFromGroup().ConfigureAwait(false), null,
                "GetUsersFromGroup");

            Post("/{groupName}/users", async _ => await AddUserToGroup().ConfigureAwait(false), null, "AddUserToGroup");

            Delete("/{groupName}/users", async _ => await DeleteUserFromGroup().ConfigureAwait(false), null,
                   "DeleteUserFromGroup");
        }
 public abstract bool UpdateSettings(IPropertySettings settings);
Exemple #6
0
 public void CustomizeLaunchConfiguration(DebugLaunchActionContext debugLaunchActionContext, IPropertySettings launchSettings)
 {
 }
 public abstract bool UpdateSettings(IPropertySettings settings);
 public PropertySettingsUpdateResult(IPropertySettings settings, bool updated)
 {
     Settings = settings;
     Updated  = updated;
 }
Exemple #9
0
 public void CustomizeLaunchConfiguration(DebugLaunchActionContext debugLaunchActionContext, IPropertySettings launchSettings)
 {
     launchSettings[PythonLaunchDebugTargetProvider.InterpreterKey]          = "(default)";
     launchSettings[PythonLaunchDebugTargetProvider.InterpreterArgumentsKey] = string.Empty;
     launchSettings[PythonLaunchDebugTargetProvider.ScriptArgumentsKey]      = string.Empty;
     launchSettings[PythonLaunchDebugTargetProvider.EnvKey]             = PropertySettings.EmptySettings;
     launchSettings[PythonLaunchDebugTargetProvider.NativeDebuggingKey] = false;
     launchSettings[PythonLaunchDebugTargetProvider.WebBrowserUrlKey]   = string.Empty;
 }
        public GroupsModule(
            GroupService groupService,
            GroupValidator validator,
            ILogger logger,
            AccessService accessService,
            ClientService clientService,
            GrainService grainService,
            IPropertySettings propertySettings = null) : base("/v1/groups", logger, validator, accessService, propertySettings)
        {
            _groupService  = groupService;
            _clientService = clientService;
            _grainService  = grainService;

            Get("/",
                async _ => await GetGroups().ConfigureAwait(false),
                null,
                "GetGroups");

            base.Get("/{groupName}",
                     async p => await this.GetGroup(p).ConfigureAwait(false),
                     null,
                     "GetGroup");

            Post("/",
                 async _ => await AddGroup().ConfigureAwait(false),
                 null,
                 "AddGroup");

            Post("/UpdateGroups",
                 async _ => await UpdateGroupList().ConfigureAwait(false),
                 null,
                 "UpdateGroups");

            Patch("/{groupName}",
                  async parameters => await this.UpdateGroup(parameters).ConfigureAwait(false),
                  null,
                  "UpdateGroup");

            base.Delete("/{groupName}",
                        async p => await this.DeleteGroup(p).ConfigureAwait(false),
                        null,
                        "DeleteGroup");

            // group->role mappings
            Get("/{groupName}/roles",
                async _ => await GetRolesFromGroup().ConfigureAwait(false),
                null,
                "GetRolesFromGroup");

            Get("/{groupName}/{grain}/{securableItem}/roles",
                async p => await GetRolesForGroup(p).ConfigureAwait(false),
                null,
                "GetRolesForGroup");

            Post("/{groupName}/roles",
                 async p => await AddRolesToGroup(p).ConfigureAwait(false),
                 null,
                 "AddRolesToGroup");

            Delete("/{groupName}/roles",
                   async p => await DeleteRolesFromGroup(p).ConfigureAwait(false),
                   null,
                   "DeleteRolesFromGroup");

            // (custom) group->user mappings
            Get("/{groupName}/users",
                async _ => await GetUsersFromGroup().ConfigureAwait(false),
                null,
                "GetUsersFromGroup");

            Post("/{groupName}/users",
                 async p => await AddUsersToGroup(p).ConfigureAwait(false),
                 null,
                 "AddUserToGroup");

            Delete("/{groupName}/users",
                   async _ => await DeleteUserFromGroup().ConfigureAwait(false),
                   null,
                   "DeleteUserFromGroup");
        }
 public void CustomizeLaunchConfiguration(DebugLaunchActionContext debugLaunchActionContext, IPropertySettings launchSettings) {
 }
Exemple #12
0
        public int GetSettingsHashCode(IPropertySettings settings)
        {
            var hashCodeMethod = typeof(IUpdatePropertySettings <>).MakeGenericType(SettingsType).GetMethod("GetSettingsHashCode", new[] { SettingsType });

            return((int)hashCodeMethod.Invoke(invokationTarget, new object[] { settings }));
        }
Exemple #13
0
        public void UpdateSettings(IPropertySettings settings)
        {
            var updateMethod = typeof(IUpdatePropertySettings <>).MakeGenericType(SettingsType).GetMethod("UpdateSettings", new[] { SettingsType });

            updateMethod.Invoke(invokationTarget, new object[] { settings });
        }
 public PropertySettingsUpdateResult(IPropertySettings settings, bool updated)
 {
     Settings = settings;
     Updated = updated;
 }