本文整理汇总了C#中ISettings类的典型用法代码示例。如果您正苦于以下问题:C# ISettings类的具体用法?C# ISettings怎么用?C# ISettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISettings类属于命名空间,在下文中一共展示了ISettings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public static RuleRewriter Create(Type type, ISettings settings, Func<SemanticModel> semanticModel)
{
// A dictionary of all recognised constructor parameters.
Dictionary<Type, Func<object>> parameterTypes = new Dictionary<Type, Func<object>>
{
{ typeof(ISettings), () => settings },
{ typeof(SemanticModel), semanticModel },
};
// Get a list of the type's constructors together with the constructor parameters types,
// ordered by number of parameters descending.
var ctors = (from c in type.GetConstructors()
select new
{
ConstructorInfo = c,
Parameters = c.GetParameters()
}).OrderByDescending(x => x.Parameters.Length).ToArray();
// Get the first constructor in which we recognise all parameter types.
var ctor = ctors.FirstOrDefault(x => x.Parameters.All(p => parameterTypes.Keys.Contains(p.ParameterType)));
object[] parameters = ctor.Parameters.Select(x => parameterTypes[x.ParameterType]()).ToArray();
return (RuleRewriter)ctor.ConstructorInfo.Invoke(parameters);
}
示例2: AbstractHarddrive
protected AbstractHarddrive(ISmart smart, string name,
string firmwareRevision, int index,
IEnumerable<SmartAttribute> smartAttributes, ISettings settings)
: base(name, new Identifier("hdd",
index.ToString(CultureInfo.InvariantCulture)), settings)
{
this.firmwareRevision = firmwareRevision;
this.smart = smart;
handle = smart.OpenDrive(index);
if (handle != smart.InvalidHandle)
smart.EnableSmart(handle, index);
this.index = index;
this.count = 0;
this.smartAttributes = new List<SmartAttribute>(smartAttributes);
string[] logicalDrives = smart.GetLogicalDrives(index);
List<DriveInfo> driveInfoList = new List<DriveInfo>(logicalDrives.Length);
foreach (string logicalDrive in logicalDrives) {
try {
DriveInfo di = new DriveInfo(logicalDrive);
if (di.TotalSize > 0)
driveInfoList.Add(new DriveInfo(logicalDrive));
} catch (ArgumentException) { } catch (IOException) { }
}
driveInfos = driveInfoList.ToArray();
CreateSensors();
}
示例3: Adapter
public Adapter(ISettings settings, IServiceFacade udapiServiceFacade, IAdapterPlugin platformConnector, IStreamListenerManager listenersManager)
{
_listenersManager = listenersManager;
Settings = settings;
UDAPIService = udapiServiceFacade;
PlatformConnector = platformConnector;
var statemanager = new StateManager(settings,platformConnector);
StateManager = statemanager;
StateProviderProxy.Init(statemanager);
listenersManager.StateManager = statemanager;
if (settings.StatsEnabled)
StatsManager.Configure();
// we just need the initialisation
new SuspensionManager(statemanager, PlatformConnector);
platformConnector.Initialise();
statemanager.AddRules(platformConnector.MarketRules);
ThreadPool.SetMinThreads(500, 500);
_sports = new List<string>();
_stats = StatsManager.Instance["adapter.core"].GetHandle();
PopuplateAdapterVersionInfo();
}
示例4: Context
public Context(ISettings settings, ILogicSettings logicSettings)
{
Settings = settings;
LogicSettings = logicSettings;
Reset(settings, LogicSettings);
}
示例5: FormDeviceConfiguration
public FormDeviceConfiguration(ISettings settings)
{
InitializeComponent();
this.settings = settings;
// Init.
this.buttonSave.Enabled = false;
this.textBoxIPAddress.Text = settings.DeviceIPAddress;
this.textBoxIPAddress.SelectionStart = this.textBoxIPAddress.Text.Length; // Don't select text content.
if (settings.PollingType == Core.PollingType.WDTSync) {
this.radioButtonPollingTypeWDTSync.Checked = true;
this.textBoxPollingInterval.Enabled = false;
this.labelPollingIntervalUnits.Enabled = false;
}
else {
this.radioButtonPollingTypeInterval.Checked = true;
}
this.textBoxPollingInterval.Text = String.Format("{0}", settings.PollingInterval);
this.textBoxIPAddress.TextChanged += new EventHandler(textBoxIPAddress_TextChanged);
this.radioButtonPollingTypeWDTSync.CheckedChanged += new EventHandler(radioButtons_CheckedChanged);
this.radioButtonPollingTypeInterval.CheckedChanged += new EventHandler(radioButtons_CheckedChanged);
this.textBoxPollingInterval.TextChanged += new EventHandler(textBoxPollingInterval_TextChanged);
}
示例6: VsPackageSourceProvider
private VsPackageSourceProvider(
ISettings settings,
IPackageSourceProvider packageSourceProvider,
IVsShellInfo vsShellInfo,
ISolutionManager solutionManager)
{
if (settings == null)
{
throw new ArgumentNullException("settings");
}
if (packageSourceProvider == null)
{
throw new ArgumentNullException("packageSourceProvider");
}
if (vsShellInfo == null)
{
throw new ArgumentNullException("vsShellInfo");
}
_packageSourceProvider = packageSourceProvider;
_solutionManager = solutionManager;
_settings = settings;
_vsShellInfo = vsShellInfo;
if (null != _solutionManager)
{
_solutionManager.SolutionClosed += OnSolutionOpenedOrClosed;
_solutionManager.SolutionOpened += OnSolutionOpenedOrClosed;
}
}
示例7: Sensor
public Sensor(string name, int index, bool defaultHidden,
SensorType sensorType, Hardware hardware,
ParameterDescription[] parameterDescriptions, ISettings settings)
{
this.index = index;
this.defaultHidden = defaultHidden;
this.sensorType = sensorType;
this.hardware = hardware;
Parameter[] parameters = new Parameter[parameterDescriptions == null ?
0 : parameterDescriptions.Length];
for (int i = 0; i < parameters.Length; i++ )
parameters[i] = new Parameter(parameterDescriptions[i], this, settings);
this.parameters = parameters;
this.settings = settings;
this.defaultName = name;
this.name = settings.GetValue(
new Identifier(Identifier, "name").ToString(), name);
GetSensorValuesFromSettings();
hardware.Closing += delegate(IHardware h) {
SetSensorValuesToSettings();
};
}
示例8: ATIGPU
public ATIGPU(string name, int adapterIndex, int busNumber, int deviceNumber, ISettings settings)
: base(name, new Identifier("atigpu", adapterIndex.ToString(CultureInfo.InvariantCulture)), settings)
{
this.adapterIndex = adapterIndex;
this.busNumber = busNumber;
this.deviceNumber = deviceNumber;
this.temperature = new Sensor("GPU Core", 0, SensorType.Temperature, this, settings);
this.fan = new Sensor("GPU Fan", 0, SensorType.Fan, this, settings);
this.coreClock = new Sensor("GPU Core", 0, SensorType.Clock, this, settings);
this.memoryClock = new Sensor("GPU Memory", 1, SensorType.Clock, this, settings);
this.coreVoltage = new Sensor("GPU Core", 0, SensorType.Voltage, this, settings);
this.coreLoad = new Sensor("GPU Core", 0, SensorType.Load, this, settings);
this.controlSensor = new Sensor("GPU Fan", 0, SensorType.Control, this, settings);
ADLOD6ThermalControllerCaps adltcc = new ADLOD6ThermalControllerCaps();
if (ADL.ADL_Overdrive6_ThermalController_Caps(adapterIndex, ref adltcc) != ADL.ADL_OK)
{
adltcc.iFanMinPercent = 0;
adltcc.iFanMaxPercent = 100;
}
this.fanControl = new Control(controlSensor, settings, adltcc.iFanMinPercent, adltcc.iFanMaxPercent);
this.fanControl.ControlModeChanged += ControlModeChanged;
this.fanControl.SoftwareControlValueChanged += SoftwareControlValueChanged;
ControlModeChanged(fanControl);
this.controlSensor.Control = fanControl;
Update();
}
示例9: AccountController
public AccountController(IUser userRepository, ISettings settingsRepository, IRole roleRepository)
: base(settingsRepository)
{
_userRepository = userRepository;
_roleRepository = roleRepository;
ExpectedMasterName = string.Empty;
}
示例10: Logic
public Logic(ISettings clientSettings)
{
_clientSettings = clientSettings;
_client = new Client(_clientSettings);
_inventory = new Inventory(_client);
_navigation = new Navigation(_client);
}
示例11: VsSourceControlTracker
public VsSourceControlTracker(
ISolutionManager solutionManager,
IFileSystemProvider fileSystemProvider,
IVsTrackProjectDocuments2 projectTracker,
ISettings solutionSettings)
{
if (projectTracker == null)
{
throw new ArgumentNullException("projectTracker");
}
_solutionManager = solutionManager;
_projectTracker = projectTracker;
_fileSystemProvider = fileSystemProvider;
_solutionSettings = solutionSettings;
_projectDocumentListener = new TrackProjectDocumentEventListener(this);
_solutionManager.SolutionOpened += OnSolutionOpened;
_solutionManager.SolutionClosed += OnSolutionClosed;
if (_solutionManager.IsSolutionOpen)
{
StartTracking();
}
}
示例12: SingleWebServerApplicationState
public SingleWebServerApplicationState(ISettings settings, IApplicationBus bus, IDocumentSession docSession, HttpContextBase httpContext)
{
this.settings = settings;
this.bus = bus;
this.docSession = docSession;
this.httpContext = httpContext;
}
示例13: InitHelpers
// TODO: At some point we should try to inject this during view creation, by means of ViewEngineFactory.
// This is not really an issue for ISettings, as this is a singleton, not requiring disposal. (pruiz)
public override void InitHelpers()
{
base.InitHelpers();
Bootstrap = Html.Bootstrap();
Settings = this.GetSettings();
}
示例14: SetUp
public void SetUp()
{
Test.SetUp();
settings = ServiceContainer.Resolve<ISettings>();
loginViewModel = new LoginViewModel();
}
示例15: Sensor
public Sensor(string name, int index, SensorType sensorType,
Hardware hardware, ParameterDescription[] parameterDescriptions,
ISettings settings)
: this(name, index, false, sensorType, hardware,
parameterDescriptions, settings)
{
}