本文整理汇总了C#中ISettings类的典型用法代码示例。如果您正苦于以下问题:C# ISettings类的具体用法?C# ISettings怎么用?C# ISettings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISettings类属于命名空间,在下文中一共展示了ISettings类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:grokys,项目名称:StyleCopMagic,代码行数:25,代码来源:RuleRewriterFactory.cs
示例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();
}
开发者ID:sakisds,项目名称:Icy-Monitor,代码行数:31,代码来源:AbstractHarddrive.cs
示例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();
}
开发者ID:luxbet,项目名称:SS.Integration.Adapter,代码行数:32,代码来源:Adapter.cs
示例4: Context
public Context(ISettings settings, ILogicSettings logicSettings)
{
Settings = settings;
LogicSettings = logicSettings;
Reset(settings, LogicSettings);
}
开发者ID:ZgrK,项目名称:PoGoBoT,代码行数:7,代码来源:Context.cs
示例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);
}
开发者ID:cristianst85,项目名称:uRADMonitorX,代码行数:27,代码来源:FormDeviceConfiguration.cs
示例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;
}
}
开发者ID:kumavis,项目名称:NuGet,代码行数:32,代码来源:VSPackageSourceProvider.cs
示例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();
};
}
开发者ID:AlexVallat,项目名称:openhardwaremonitor,代码行数:25,代码来源:Sensor.cs
示例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();
}
开发者ID:kurdtkobain,项目名称:openhardwaremonitor,代码行数:29,代码来源:ATIGPU.cs
示例9: AccountController
public AccountController(IUser userRepository, ISettings settingsRepository, IRole roleRepository)
: base(settingsRepository)
{
_userRepository = userRepository;
_roleRepository = roleRepository;
ExpectedMasterName = string.Empty;
}
开发者ID:rinckd,项目名称:sblog.net,代码行数:7,代码来源:AccountController.cs
示例10: Logic
public Logic(ISettings clientSettings)
{
_clientSettings = clientSettings;
_client = new Client(_clientSettings);
_inventory = new Inventory(_client);
_navigation = new Navigation(_client);
}
开发者ID:RT-EB,项目名称:Pokemon-Go-Bot,代码行数:7,代码来源:Logic.cs
示例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();
}
}
开发者ID:xero-github,项目名称:Nuget,代码行数:25,代码来源:VsSourceControlTracker.cs
示例12: SingleWebServerApplicationState
public SingleWebServerApplicationState(ISettings settings, IApplicationBus bus, IDocumentSession docSession, HttpContextBase httpContext)
{
this.settings = settings;
this.bus = bus;
this.docSession = docSession;
this.httpContext = httpContext;
}
开发者ID:TallyDotNet,项目名称:event-site,代码行数:7,代码来源:SingleWebServerApplicationState.cs
示例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();
}
开发者ID:evicertia,项目名称:HermaFx,代码行数:9,代码来源:CustomViewPage.cs
示例14: SetUp
public void SetUp()
{
Test.SetUp();
settings = ServiceContainer.Resolve<ISettings>();
loginViewModel = new LoginViewModel();
}
开发者ID:AnnMarieTorres,项目名称:XamChat,代码行数:7,代码来源:LoginViewModelTests.cs
示例15: Sensor
public Sensor(string name, int index, SensorType sensorType,
Hardware hardware, ParameterDescription[] parameterDescriptions,
ISettings settings)
: this(name, index, false, sensorType, hardware,
parameterDescriptions, settings)
{
}
开发者ID:adamsp,项目名称:beastmon,代码行数:7,代码来源:Sensor.cs
示例16: FileStorage
public FileStorage(ISettings settings)
{
_settings = settings;
_resizeSettings = new ResizeSettings {
MaxWidth = settings.ThumbnailSize,
MaxHeight = settings.ThumbnailSize,
Format = "jpg"
};
_resizeSettings.Add("quality", ImageQuality);
//create FullsizedImagesFolder & SmallImagesFolder subfolders
string largeFilesFolder = Path.Combine(settings.ImagesLocalFolder, FullsizedImagesFolder);
string smallFilesFolder = Path.Combine(settings.ImagesLocalFolder, SmallImagesFolder);
if (!Directory.Exists(largeFilesFolder))
Directory.CreateDirectory(largeFilesFolder);
if (!Directory.Exists(smallFilesFolder))
Directory.CreateDirectory(smallFilesFolder);
_lastPhoto = Directory
.GetFiles(largeFilesFolder, "*.jpg")
.Select(i => int.Parse(Path.GetFileNameWithoutExtension(i).ToLower().Replace(".jpg", "")))
.OrderByDescending(i => i)
.FirstOrDefault();
if (_lastPhoto < 1)
_lastPhoto = 1;
}
开发者ID:EgorBo,项目名称:CrossChat-Xamarin.Forms,代码行数:29,代码来源:FileStorage.cs
示例17: InstallCommand
protected internal InstallCommand(
IPackageRepositoryFactory packageRepositoryFactory,
IPackageSourceProvider sourceProvider,
ISettings configSettings,
IPackageRepository cacheRepository)
{
if (packageRepositoryFactory == null)
{
throw new ArgumentNullException("packageRepositoryFactory");
}
if (sourceProvider == null)
{
throw new ArgumentNullException("sourceProvider");
}
if (configSettings == null)
{
throw new ArgumentNullException("configSettings");
}
RepositoryFactory = packageRepositoryFactory;
SourceProvider = sourceProvider;
_cacheRepository = cacheRepository;
_configSettings = configSettings;
}
开发者ID:themotleyfool,项目名称:NuGet,代码行数:26,代码来源:InstallCommand.cs
示例18: PackageRestoreManager
internal PackageRestoreManager(
DTE dte,
ISolutionManager solutionManager,
IFileSystemProvider fileSystemProvider,
IPackageRepositoryFactory packageRepositoryFactory,
IVsPackageSourceProvider packageSourceProvider,
IVsPackageManagerFactory packageManagerFactory,
IVsPackageInstallerEvents packageInstallerEvents,
IPackageRepository localCacheRepository,
IVsThreadedWaitDialogFactory waitDialogFactory,
ISettings settings)
{
Debug.Assert(solutionManager != null);
_dte = dte;
_fileSystemProvider = fileSystemProvider;
_solutionManager = solutionManager;
_packageRepositoryFactory = packageRepositoryFactory;
_packageSourceProvider = packageSourceProvider;
_waitDialogFactory = waitDialogFactory;
_packageManagerFactory = packageManagerFactory;
_localCacheRepository = localCacheRepository;
_settings = settings;
_solutionManager.ProjectAdded += OnProjectAdded;
_solutionManager.SolutionOpened += OnSolutionOpenedOrClosed;
_solutionManager.SolutionClosed += OnSolutionOpenedOrClosed;
packageInstallerEvents.PackageReferenceAdded += OnPackageReferenceAdded;
}
开发者ID:Mailaender,项目名称:xamarin-nuget,代码行数:27,代码来源:PackageRestoreManager.cs
示例19: Hardware
public Hardware(string name, Identifier identifier, ISettings settings) {
this.settings = settings;
this.identifier = identifier;
this.name = name;
this.customName = settings.GetValue(
new Identifier(Identifier, "name").ToString(), name);
}
开发者ID:sakisds,项目名称:Icy-Monitor,代码行数:7,代码来源:Hardware.cs
示例20: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
_logging = IoC.IoC.Get<ILog>();
_date = IoC.IoC.Get<IDate>();
_settings = IoC.IoC.Get<ISettings>();
_emailNotificationItems = IoC.IoC.Get<IEmailNotificationItems>();
_sendEmail = IoC.IoC.Get<IEmail>();
_status = IoC.IoC.Get<IStatus>();
var url = Request.Url.AbsoluteUri;
if (Request.QueryString["csvfile"] == null)
{
numberOfRun += 1;
_logging.Msg("CroneJob startet, " + numberOfRun);
if (DateTime.Now.Hour == 8)
{
_sendEmail.SendEmail("[email protected]", "[email protected]", "Cronejob startet kl. 8:00, antal gange det er kørt siden sidst: " + numberOfRun, "");
numberOfRun = 0;
}
url = null;
}
Run(url);
}
开发者ID:NNSostack,项目名称:DataJuggling,代码行数:25,代码来源:Notification.ascx.cs
注:本文中的ISettings类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论