Ejemplo n.º 1
0
        public void SendSettingsChangeEvent (SettingName settingName)
        {
            string label;

            switch (settingName) {
            case SettingName.AskForProject:
                label = "AskForProject";
                break;
            case SettingName.IdleNotification:
                label = "IdleNotification";
                break;
            case SettingName.DefaultMobileTag:
                label = "DefaultMobileTag";
                break;
            case SettingName.GroupedTimeEntries:
                label = "GroupedTimeEntries";
                break;
            case SettingName.ShowNotification:
                label = "ShowNotification";
                break;
            default:
                #if DEBUG
                throw new ArgumentException ("Invalid value", "settingName");
                #else
                return;
                #endif
            }

            SendEvent ("Settings", "Change", label);
        }
Ejemplo n.º 2
0
        public bool CheckSetting(SettingName settingName)
        {
            bool ret = true;
            try
            {
                // var settings = IsolatedStorageSettings.ApplicationSettings;
                // txtInput is a TextBox defined in XAML.
                if (settings.Contains(settingName.ToString()))
                {

                    var store = IsolatedStorageFile.GetUserStoreForApplication();
                    switch (settingName)
                    {
                        case SettingName.Shares:
                            ret =  store.DirectoryExists("/Shares");
                            break;
                        case SettingName.Users:
                            ret = store.FileExists("/Users/Users.xml");
                            break;
                        case SettingName.Activity:
                            ret = store.FileExists("/Activity/Activity.xml");
                            break;
                        default:
                            throw new Exception("Setting not implemented " + settingName.ToString() + "!!!");
                    }

                }
                else
                {
                    ret = false;
                }

            } catch(Exception)
            {
                // insabbiamento
                ret = false;
            }

            return ret;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Gets the values of the Wiki Settings.
 /// </summary>
 /// <param name="name">The Setting's Name.</param>
 /// <returns>The Setting's value.</returns>
 public string GetSettingValue(SettingName name)
 {
     switch(name) {
         case SettingName.ContactEmail:
             return Settings.ContactEmail;
         case SettingName.DateTimeFormat:
             return Settings.DateTimeFormat;
         case SettingName.DefaultLanguage:
             return Settings.DefaultLanguage;
         case SettingName.RootNamespaceDefaultPage:
             return Settings.DefaultPage;
         case SettingName.DefaultTimeZone:
             return Settings.DefaultTimezone.ToString();
         case SettingName.MainUrl:
             return Settings.MainUrl;
         case SettingName.SenderEmail:
             return Settings.SenderEmail;
         case SettingName.WikiTitle:
             return Settings.WikiTitle;
         case SettingName.ThemesDirectory:
             return Settings.ThemesDirectory;
         case SettingName.PublicDirectory:
             return Settings.PublicDirectory;
         case SettingName.UsersCanRegister:
             return Settings.UsersCanRegister.ToString();
         case SettingName.UsernameRegex:
             return Settings.UsernameRegex;
         case SettingName.PasswordRegex:
             return Settings.PasswordRegex;
         case SettingName.EmailRegex:
             return Settings.EmailRegex;
         case SettingName.MainUrlRegex:
             return Settings.MainUrlRegex;
         case SettingName.EnableDoubleClickEditing:
             return Settings.EnableDoubleClickEditing.ToString();
         case SettingName.ProcessSingleLineBreaks:
             return Settings.ProcessSingleLineBreaks.ToString();
         case SettingName.AccountActivationMode:
             return Settings.AccountActivationMode.ToString();
         case SettingName.AllowedFileTypes:
             StringBuilder sb = new StringBuilder(50);
             foreach(string s in Settings.AllowedFileTypes) sb.Append(s + ",");
             return sb.ToString().TrimEnd(',');
         case SettingName.DisableAutomaticVersionCheck:
             return Settings.DisableAutomaticVersionCheck.ToString();
         case SettingName.DisableBreadcrumbsTrail:
             return Settings.DisableBreadcrumbsTrail.ToString();
         case SettingName.DisableCache:
             return Settings.DisableCache.ToString();
         case SettingName.DisableCaptchaControl:
             return Settings.DisableCaptchaControl.ToString();
         case SettingName.DisableConcurrentEditing:
             return Settings.DisableConcurrentEditing.ToString();
         case SettingName.EnableHttpCompression:
             return Settings.EnableHttpCompression.ToString();
         case SettingName.EnableViewStateCompression:
             return Settings.EnableViewStateCompression.ToString();
         case SettingName.LoggingLevel:
             return Settings.LoggingLevel.ToString();
         case SettingName.MaxFileSize:
             return Settings.MaxFileSize.ToString();
         case SettingName.PageExtension:
             return Settings.PageExtension;
         case SettingName.ScriptTagsAllowed:
             return Settings.ScriptTagsAllowed.ToString();
         case SettingName.WikiVersion:
             return Settings.WikiVersion;
         case SettingName.MaxLogSize:
             return Settings.MaxLogSize.ToString();
         case SettingName.MaxRecentChanges:
             return Settings.MaxRecentChanges.ToString();
         case SettingName.CacheSize:
             return Settings.CacheSize.ToString();
         case SettingName.CacheCutSize:
             return Settings.CacheCutSize.ToString();
         case SettingName.EditingSessionTimeout:
             return Collisions.EditingSessionTimeout.ToString();
         case SettingName.AdministratorsGroup:
             return Settings.AdministratorsGroup;
         case SettingName.UsersGroup:
             return Settings.UsersGroup;
         case SettingName.AnonymousGroup:
             return Settings.AnonymousGroup;
         case SettingName.ChangeModerationMode:
             return Settings.ChangeModerationMode.ToString();
         case SettingName.DefaultPagesStorageProvider:
             return Settings.DefaultPagesProvider;
         case SettingName.DefaultUsersStorageProvider:
             return Settings.DefaultUsersProvider;
         case SettingName.DefaultFilesStorageProvider:
             return Settings.DefaultFilesProvider;
         case SettingName.DefaultCacheProvider:
             return Settings.DefaultCacheProvider;
         case SettingName.RootNamespaceTheme:
             return Settings.GetTheme(null);
         case SettingName.ListSize:
             return Settings.ListSize.ToString();
     }
     return "";
 }
Ejemplo n.º 4
0
 protected void AddSection(SettingName settingName)
 {
     var node = CreateElement(settingName.ToString());
     FirstChild.AppendChild(node);
 }
Ejemplo n.º 5
0
        public string GetSettingValue(SettingName name)
        {
            switch (name)
            {
                case SettingName.PublicDirectory:
                    return this.workingDirectory;

                case SettingName.CacheSize:
                    return "1000";

                default:
                    throw new NotImplementedException();
            }
        }
Ejemplo n.º 6
0
 public async Task<SettingEntity> FindNamedAsync(SettingName name)
 {
     return await GroupGetAsync<SettingEntity>(name.ToString()).ConfigureAwait(false);
 }
Ejemplo n.º 7
0
 private void Remove(SettingName section)
 {
     Remove(section.ToString());
 }
Ejemplo n.º 8
0
 protected void AddSection(SettingName settingName)
 {
     CreateConfigurationDir(settingName.ToString() as string);
     CreateConfigurationFile(settingName.ToString(), settingName.ToString());
 }