mirror of
https://github.com/copyrighttxt/watrbx-game-engine.git
synced 2026-09-05 05:07:48 +00:00
GEEKING
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Roblox.Configuration
|
||||
{
|
||||
public class EndpointAddressElement : ConfigurationElement
|
||||
{
|
||||
static EndpointAddressElement()
|
||||
{
|
||||
nameProperty = new ConfigurationProperty("endpointConfigurationName", typeof(string), null, ConfigurationPropertyOptions.IsRequired);
|
||||
properties.Add(nameProperty);
|
||||
connectionStringProperty = new ConfigurationProperty("connectionString", typeof(string), null, ConfigurationPropertyOptions.IsRequired);
|
||||
properties.Add(connectionStringProperty);
|
||||
}
|
||||
|
||||
public string EndpointConfigurationName
|
||||
{
|
||||
get => (string)base[nameProperty];
|
||||
set => base[nameProperty] = value;
|
||||
}
|
||||
public string ConnectionString
|
||||
{
|
||||
get => (string)base[connectionStringProperty];
|
||||
set => base[connectionStringProperty] = value;
|
||||
}
|
||||
protected override ConfigurationPropertyCollection Properties => properties;
|
||||
|
||||
private static readonly ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection();
|
||||
private static readonly ConfigurationProperty nameProperty;
|
||||
private static readonly ConfigurationProperty connectionStringProperty;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Roblox.Configuration
|
||||
{
|
||||
public class EndpointAddressElements : ConfigurationElementCollection
|
||||
{
|
||||
public override ConfigurationElementCollectionType CollectionType => ConfigurationElementCollectionType.BasicMap;
|
||||
protected override string ElementName => "endpointAddress";
|
||||
protected override ConfigurationPropertyCollection Properties => new ConfigurationPropertyCollection();
|
||||
public EndpointAddressElement this[int index]
|
||||
{
|
||||
get => (EndpointAddressElement)BaseGet(index);
|
||||
set
|
||||
{
|
||||
if (BaseGet(index) != null) BaseRemoveAt(index);
|
||||
BaseAdd(index, value);
|
||||
}
|
||||
}
|
||||
new public EndpointAddressElement this[string name] => (EndpointAddressElement)BaseGet(name);
|
||||
|
||||
public void Add(EndpointAddressElement item) => BaseAdd(item);
|
||||
public void Remove(EndpointAddressElement item) => BaseRemove(item);
|
||||
public void RemoveAt(int index) => BaseRemoveAt(index);
|
||||
protected override ConfigurationElement CreateNewElement() => new EndpointAddressElement();
|
||||
protected override object GetElementKey(ConfigurationElement element) => (element as EndpointAddressElement).EndpointConfigurationName;
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Configuration;
|
||||
|
||||
namespace Roblox.Configuration
|
||||
{
|
||||
public class GroupConfigElement : ConfigurationElement
|
||||
{
|
||||
static GroupConfigElement()
|
||||
{
|
||||
groupNameProperty = new ConfigurationProperty("groupName", typeof(string), null, ConfigurationPropertyOptions.IsRequired);
|
||||
properties.Add(groupNameProperty);
|
||||
connectionStringProperty = new ConfigurationProperty("connectionString", typeof(string), null, ConfigurationPropertyOptions.None);
|
||||
properties.Add(connectionStringProperty);
|
||||
updateIntervalProperty = new ConfigurationProperty("updateInterval", typeof(TimeSpan), TimeSpan.Zero, ConfigurationPropertyOptions.None);
|
||||
properties.Add(updateIntervalProperty);
|
||||
}
|
||||
|
||||
public string GroupName
|
||||
{
|
||||
get => (string)base[groupNameProperty];
|
||||
set => base[groupNameProperty] = value;
|
||||
}
|
||||
public string ConnectionString
|
||||
{
|
||||
get => (string)base[connectionStringProperty];
|
||||
set => base[connectionStringProperty] = value;
|
||||
}
|
||||
public TimeSpan UpdateInterval
|
||||
{
|
||||
get => (TimeSpan)base[updateIntervalProperty];
|
||||
set => base[updateIntervalProperty] = value;
|
||||
}
|
||||
protected override ConfigurationPropertyCollection Properties => properties;
|
||||
|
||||
private static readonly ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection();
|
||||
private static readonly ConfigurationProperty groupNameProperty;
|
||||
private static readonly ConfigurationProperty connectionStringProperty;
|
||||
private static readonly ConfigurationProperty updateIntervalProperty;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Roblox.Configuration
|
||||
{
|
||||
public class GroupConfigElements : ConfigurationElementCollection
|
||||
{
|
||||
public override ConfigurationElementCollectionType CollectionType => ConfigurationElementCollectionType.BasicMap;
|
||||
protected override string ElementName => "group";
|
||||
protected override ConfigurationPropertyCollection Properties => new ConfigurationPropertyCollection();
|
||||
public GroupConfigElement this[int index]
|
||||
{
|
||||
get => (GroupConfigElement)BaseGet(index);
|
||||
set
|
||||
{
|
||||
if (BaseGet(index) != null) BaseRemoveAt(index);
|
||||
BaseAdd(index, value);
|
||||
}
|
||||
}
|
||||
new public GroupConfigElement this[string name] => (GroupConfigElement)BaseGet(name);
|
||||
|
||||
public void Add(GroupConfigElement item) => BaseAdd(item);
|
||||
public void Remove(GroupConfigElement item) => BaseRemove(item);
|
||||
public void RemoveAt(int index) => BaseRemoveAt(index);
|
||||
protected override ConfigurationElement CreateNewElement() => new GroupConfigElement();
|
||||
protected override object GetElementKey(ConfigurationElement element) => (element as GroupConfigElement).GroupName;
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
using System.Configuration;
|
||||
|
||||
namespace Roblox.Configuration
|
||||
{
|
||||
public class ProviderConfigSection : ConfigurationSection
|
||||
{
|
||||
static ProviderConfigSection()
|
||||
{
|
||||
isDatabaseWritableProperty = new ConfigurationProperty("isDatabaseWritable", typeof(bool), false, ConfigurationPropertyOptions.None);
|
||||
_Properties.Add(isDatabaseWritableProperty);
|
||||
groupConfigs = new ConfigurationProperty("groups", typeof(GroupConfigElements), null, ConfigurationPropertyOptions.IsRequired);
|
||||
_Properties.Add(groupConfigs);
|
||||
endpointAddressConfigs = new ConfigurationProperty("endpointAddresses", typeof(EndpointAddressElements), null, ConfigurationPropertyOptions.None);
|
||||
_Properties.Add(endpointAddressConfigs);
|
||||
}
|
||||
|
||||
public bool IsDatabaseReadonly
|
||||
{
|
||||
get => !(bool)base[isDatabaseWritableProperty];
|
||||
set => base[isDatabaseWritableProperty] = !value;
|
||||
}
|
||||
public GroupConfigElements GroupConfigs => (GroupConfigElements)base[groupConfigs];
|
||||
public EndpointAddressElements EndpointAddressConfigs => (EndpointAddressElements)base[endpointAddressConfigs];
|
||||
protected override ConfigurationPropertyCollection Properties => _Properties;
|
||||
|
||||
private static readonly ConfigurationPropertyCollection _Properties = new ConfigurationPropertyCollection();
|
||||
private static readonly ConfigurationProperty isDatabaseWritableProperty;
|
||||
private static readonly ConfigurationProperty groupConfigs;
|
||||
private static readonly ConfigurationProperty endpointAddressConfigs;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user