Ejemplo n.º 1
0
 public SessionFactoryHolder(ShellSettings shellSetting, IEnumerable<RecordBlueprint> records,
     ISessionConfigurationCache sessionConfigurationCache, IDataServicesProviderFactory dataServicesProviderFactory, IDatabaseCacheConfiguration cacheConfiguration)
 {
     _shellSettings = shellSetting;
     _records = records;
     _sessionConfigurationCache = sessionConfigurationCache;
     _dataServicesProviderFactory = dataServicesProviderFactory;
     _cacheConfiguration = cacheConfiguration;
     Logger = NullLogger.Instance;
 }
Ejemplo n.º 2
0
        public SessionConfigurationCache(ShellSettings shellSettings, IEnumerable<RecordBlueprint> records, IAppDataFolder appFolder, IEnumerable<ISessionConfigurationEvents> configurers)
        {
            _shellSettings = shellSettings;
            _records = records;
            _appDataFolder = appFolder;
            _configurers = configurers;
            _currentConfig = null;

            Logger = NullLogger.Instance;
        }
Ejemplo n.º 3
0
 public ShellSettings(ShellSettings settings)
 {
     Name = settings.Name;
     DataProvider = settings.DataProvider;
     DataConnectionString = settings.DataConnectionString;
     DataTablePrefix = settings.DataTablePrefix;
     RequestUrlHost = settings.RequestUrlHost;
     RequestUrlPrefix = settings.RequestUrlPrefix;
     EncryptionAlgorithm = settings.EncryptionAlgorithm;
     EncryptionKey = settings.EncryptionKey;
     HashAlgorithm = settings.HashAlgorithm;
     HashKey = settings.HashKey;
     //State = settings.State;
     Themes = settings.Themes;
 }
Ejemplo n.º 4
0
        public static string ComposeSettings(ShellSettings settings)
        {
            if (settings == null)
                return "";

            return string.Format("Name: {0}\r\nDataProvider: {1}\r\nDataConnectionString: {2}\r\nDataPrefix: {3}\r\nRequestUrlHost: {4}\r\nRequestUrlPrefix: {5}\r\nState: {6}\r\nEncryptionAlgorithm: {7}\r\nEncryptionKey: {8}\r\nHashAlgorithm: {9}\r\nHashKey: {10}\r\nThemes: {11}\r\n",
                                 settings.Name,
                                 settings.DataProvider,
                                 settings.DataConnectionString ?? EmptyValue,
                                 settings.DataTablePrefix ?? EmptyValue,
                                 settings.RequestUrlHost ?? EmptyValue,
                                 settings.RequestUrlPrefix ?? EmptyValue,
                                 //settings.State != null ? settings.State.ToString() : String.Empty,
                                 settings.EncryptionAlgorithm ?? EmptyValue,
                                 settings.EncryptionKey ?? EmptyValue,
                                 settings.HashAlgorithm ?? EmptyValue,
                                 settings.HashKey ?? EmptyValue,
                                 String.Join(";", settings.Themes ?? new string[0])
                );
        }
Ejemplo n.º 5
0
        public static ShellSettings ParseSettings(string text)
        {
            var shellSettings = new ShellSettings();
            if (String.IsNullOrEmpty(text))
                return shellSettings;

            var settings = new StringReader(text);
            string setting;
            while ((setting = settings.ReadLine()) != null)
            {
                if (string.IsNullOrWhiteSpace(setting)) continue; ;
                var separatorIndex = setting.IndexOf(Separator);
                if (separatorIndex == -1)
                {
                    continue;
                }
                string key = setting.Substring(0, separatorIndex).Trim();
                string value = setting.Substring(separatorIndex + 1).Trim();

                if (value != EmptyValue)
                {
                    switch (key)
                    {
                        case "Name":
                            shellSettings.Name = value;
                            break;
                        case "DataProvider":
                            shellSettings.DataProvider = value;
                            break;
                        //case "State":
                        //    shellSettings.State = new TenantState(value);
                        //    break;
                        case "DataConnectionString":
                            shellSettings.DataConnectionString = value;
                            break;
                        case "DataPrefix":
                            shellSettings.DataTablePrefix = value;
                            break;
                        case "RequestUrlHost":
                            shellSettings.RequestUrlHost = value;
                            break;
                        case "RequestUrlPrefix":
                            shellSettings.RequestUrlPrefix = value;
                            break;
                        case "EncryptionAlgorithm":
                            shellSettings.EncryptionAlgorithm = value;
                            break;
                        case "EncryptionKey":
                            shellSettings.EncryptionKey = value;
                            break;
                        case "HashAlgorithm":
                            shellSettings.HashAlgorithm = value;
                            break;
                        case "HashKey":
                            shellSettings.HashKey = value;
                            break;
                        case "Themes":
                            shellSettings.Themes = value.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                            break;
                    }
                }
            }

            return shellSettings;
        }
Ejemplo n.º 6
0
        public static ShellSettings ParseSettings(string text)
        {
            var shellSettings = new ShellSettings();

            if (String.IsNullOrEmpty(text))
            {
                return(shellSettings);
            }

            var    settings = new StringReader(text);
            string setting;

            while ((setting = settings.ReadLine()) != null)
            {
                if (string.IsNullOrWhiteSpace(setting))
                {
                    continue;
                }
                ;
                var separatorIndex = setting.IndexOf(Separator);
                if (separatorIndex == -1)
                {
                    continue;
                }
                string key   = setting.Substring(0, separatorIndex).Trim();
                string value = setting.Substring(separatorIndex + 1).Trim();

                if (value != EmptyValue)
                {
                    switch (key)
                    {
                    case "Name":
                        shellSettings.Name = value;
                        break;

                    case "DataProvider":
                        shellSettings.DataProvider = value;
                        break;

                    //case "State":
                    //    shellSettings.State = new TenantState(value);
                    //    break;
                    case "DataConnectionString":
                        shellSettings.DataConnectionString = value;
                        break;

                    case "DataPrefix":
                        shellSettings.DataTablePrefix = value;
                        break;

                    case "RequestUrlHost":
                        shellSettings.RequestUrlHost = value;
                        break;

                    case "RequestUrlPrefix":
                        shellSettings.RequestUrlPrefix = value;
                        break;

                    case "EncryptionAlgorithm":
                        shellSettings.EncryptionAlgorithm = value;
                        break;

                    case "EncryptionKey":
                        shellSettings.EncryptionKey = value;
                        break;

                    case "HashAlgorithm":
                        shellSettings.HashAlgorithm = value;
                        break;

                    case "HashKey":
                        shellSettings.HashKey = value;
                        break;

                    case "Themes":
                        shellSettings.Themes = value.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                        break;
                    }
                }
            }

            return(shellSettings);
        }