本文整理汇总了C#中ISettings.GetSetting方法的典型用法代码示例。如果您正苦于以下问题:C# ISettings.GetSetting方法的具体用法?C# ISettings.GetSetting怎么用?C# ISettings.GetSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISettings
的用法示例。
在下文中一共展示了ISettings.GetSetting方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
void Init(Rect screenActivatorRect, CodeCompletionWindowInput input, ISettings settings)
{
_input = input;
_activatorRect = screenActivatorRect;
_userWidth = settings.GetSetting("PopupUserWidth") as IntSetting ?? new IntSetting("PopupUserWidth", -1, settings);
_userHeight = settings.GetSetting("PopupUserHeight") as IntSetting ?? new IntSetting("PopupUserHeight", -1, settings);
ShowAsDropDown(screenActivatorRect, GetWindowSize());
Repaint();
}
开发者ID:transformersprimeabcxyz,项目名称:_TO-DO-CodeEditor-Unity-Technologies,代码行数:10,代码来源:CodeCompletionWindow.cs
示例2: GetContainerConfigTags
private static IEnumerable<string> GetContainerConfigTags(ISettings settings)
{
var configurationTagsSetting = settings.GetSetting("ElasticAnalytics.Configuration.Tags");
IEnumerable<string> configurationTags = Enumerable.Empty<string>();
if (!string.IsNullOrWhiteSpace(configurationTagsSetting))
{
configurationTags = configurationTagsSetting.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
}
var cleanedTags = new[] { "default" }.Concat(configurationTags).Select(t => t.ToLower()).Distinct();
return cleanedTags;
}
示例3: GetAllTasks
public IEnumerable<TaskDto> GetAllTasks(ISettings settings)
{
var allTasks = new List<TaskDto>();
using(var connection = new SqlConnection(settings.GetSetting("TaskDatabaseConnectionString")))
{
connection.Open();
using(var transaction = connection.BeginTransaction())
{
var command = connection.CreateCommand();
command.Transaction = transaction;
command.CommandType = CommandType.StoredProcedure;
command.CommandText = "[dbo].[get_all_tasks]";
using(var reader = command.ExecuteReader(CommandBehavior.CloseConnection))
{
if (reader.HasRows)
{
while (reader.Read())
{
allTasks.Add(
new TaskDto
{
ID = reader.GetInt32(IDIndex),
Description = reader.GetString(DescriptionIndex),
Priority = reader.GetString(PriorityIndex),
DueDate = reader.GetDateTime(DueDateIndex),
Completed = reader.GetBoolean(CompletedIndex)
}
);
}
}
}
}
}
return allTasks;
}
示例4: OnLoad
protected override void OnLoad(EventArgs e)
{
// NOTE: DesignMode is not true when display is nested in another
// user control and the containing form is displayed in the designer.
// This is a problem with VS.Net.
//
// Consequently, we rely on the fact that Services.UserSettings
// returns a dummy Service, if the ServiceManager has not been
// initialized.
if ( !this.DesignMode )
{
this.settings = Services.UserSettings;
settings.Changed += new SettingsEventHandler(UserSettings_Changed);
int splitPosition = settings.GetSetting( "Gui.ResultTabs.ErrorsTabSplitterPosition", tabSplitter.SplitPosition );
if ( splitPosition >= tabSplitter.MinSize && splitPosition < this.ClientSize.Height )
this.tabSplitter.SplitPosition = splitPosition;
this.WordWrap = settings.GetSetting( "Gui.ResultTabs.ErrorsTab.WordWrapEnabled", true );
this.detailList.Font = this.stackTraceDisplay.Font =
settings.GetSetting( "Gui.FixedFont", DefaultFixedFont );
Orientation splitOrientation = (Orientation)settings.GetSetting(
"Gui.ResultTabs.ErrorBrowser.SplitterOrientation", Orientation.Vertical);
float splitterDistance = splitOrientation == Orientation.Vertical
? settings.GetSetting( "Gui.ResultTabs.ErrorBrowser.VerticalPosition", 0.3f )
: settings.GetSetting( "Gui.ResultTabs.ErrorBrowser.HorizontalPosition", 0.3f );
sourceCode.SplitOrientation = splitOrientation;
sourceCode.SplitterDistance = splitterDistance;
sourceCode.SplitOrientationChanged += new EventHandler(sourceCode_SplitOrientationChanged);
sourceCode.SplitterDistanceChanged += new EventHandler(sourceCode_SplitterDistanceChanged);
if ( settings.GetSetting("Gui.ResultTabs.ErrorBrowser.SourceCodeDisplay", false) )
errorBrowser.SelectedDisplay = sourceCode;
else
errorBrowser.SelectedDisplay = stackTraceDisplay;
errorBrowser.StackTraceDisplayChanged += new EventHandler(errorBrowser_StackTraceDisplayChanged);
}
base.OnLoad (e);
}
示例5: StartService
public override void StartService()
{
try
{
// DomainManager has a soft dependency on the SettingsService.
// If it's not available, default values are used.
_settingsService = ServiceContext.GetService<ISettings>();
if (_settingsService != null)
{
var pathSetting = _settingsService.GetSetting("Options.TestLoader.ShadowCopyPath", "");
if (pathSetting != "")
_shadowCopyPath = Environment.ExpandEnvironmentVariables(pathSetting);
}
Status = ServiceStatus.Started;
}
catch
{
Status = ServiceStatus.Error;
throw;
}
}
示例6: OnLoad
protected override void OnLoad(EventArgs e)
{
// NOTE: DesignMode is not true when display is nested in another
// user control and the containing form is displayed in the designer.
// This is a problem with VS.Net.
//
// Consequently, we rely on the fact that Services.UserSettings
// returns a dummy Service, if the ServiceManager has not been
// initialized.
if ( !this.DesignMode )
{
this.settings = Services.UserSettings;
settings.Changed += new SettingsEventHandler(UserSettings_Changed);
int splitPosition = settings.GetSetting( "Gui.ResultTabs.ErrorsTabSplitterPosition", tabSplitter.SplitPosition );
if ( splitPosition >= tabSplitter.MinSize && splitPosition < this.ClientSize.Height )
this.tabSplitter.SplitPosition = splitPosition;
stackTrace.AutoExpand = settings.GetSetting( "Gui.ResultTabs.ErrorsTab.ToolTipsEnabled", true );
this.WordWrap = settings.GetSetting( "Gui.ResultTabs.ErrorsTab.WordWrapEnabled", true );
}
base.OnLoad (e);
}
示例7: LoadEntriesFromSettings
private void LoadEntriesFromSettings( ISettings settings )
{
fileEntries.Clear();
string prefix = Environment.Version.Major >= 2
? "RecentProjects.V2"
: "RecentProjects.V1";
for ( int index = 1; index <= MaxFiles; index++ )
{
string fileSpec = settings.GetSetting( GetRecentFileKey( prefix, index ) ) as string;
if ( fileSpec != null ) fileEntries.Add( new RecentFileEntry( fileSpec ) );
}
// Try legacy entries if nothing was found
if ( fileEntries.Count == 0 )
{
for ( int index = 1; index <= MaxFiles; index++ )
{
string fileSpec = settings.GetSetting( GetRecentFileKey( "RecentProjects", index ) ) as string;
if ( fileSpec != null )
{
RecentFileEntry entry = RecentFileEntry.Parse( fileSpec );
if ( entry.CLRVersion.Major <= Environment.Version.Major )
fileEntries.Add( entry );
}
}
};
}
示例8: OptionsDialog_Load
private void OptionsDialog_Load(object sender, System.EventArgs e)
{
this.settings = Services.UserSettings;
recentFilesCountTextBox.Text = Services.RecentFiles.MaxFiles.ToString();
loadLastProjectCheckBox.Checked = settings.GetSetting( "Options.LoadLastProject", true );
initialDisplayComboBox.SelectedIndex = (int)(TestSuiteTreeView.DisplayStyle)settings.GetSetting( "Gui.TestTree.InitialTreeDisplay", TestSuiteTreeView.DisplayStyle.Auto );
visualStudioSupportCheckBox.Checked = settings.GetSetting( "Options.TestLoader.VisualStudioSupport", false );
shadowCopyCheckBox.Checked = settings.GetSetting( "Options.TestLoader.ShadowCopyFiles", true );
reloadOnChangeCheckBox.Enabled = Environment.OSVersion.Platform == System.PlatformID.Win32NT;
reloadOnChangeCheckBox.Checked = settings.GetSetting( "Options.TestLoader.ReloadOnChange", true );
rerunOnChangeCheckBox.Checked = settings.GetSetting( "Options.TestLoader.RerunOnChange", false );
reloadOnRunCheckBox.Checked = settings.GetSetting( "Options.TestLoader.ReloadOnRun", true );
clearResultsCheckBox.Checked = settings.GetSetting( "Options.TestLoader.ClearResultsOnReload", true );
bool multiDomain = settings.GetSetting( "Options.TestLoader.MultiDomain", false );
multiDomainRadioButton.Checked = multiDomain;
singleDomainRadioButton.Checked = !multiDomain;
mergeAssembliesCheckBox.Enabled = !multiDomain;
mergeAssembliesCheckBox.Checked = settings.GetSetting( "Options.TestLoader.MergeAssemblies", false );
autoNamespaceSuites.Checked = settings.GetSetting( "Options.TestLoader.AutoNamespaceSuites", true );
flatTestList.Checked = !autoNamespaceSuites.Checked;
errorsTabCheckBox.Checked = settings.GetSetting( "Gui.ResultTabs.DisplayErrorsTab", true );
notRunTabCheckBox.Checked = settings.GetSetting( "Gui.ResultTabs.DisplayNotRunTab", true );
consoleOutputCheckBox.Checked = settings.GetSetting( "Gui.ResultTabs.DisplayConsoleOutputTab", true );
consoleErrrorCheckBox.Checked = settings.GetSetting( "Gui.ResultTabs.DisplayConsoleErrorTab", true )
|| settings.GetSetting( "Gui.ResultTabs.MergeErrorOutput", false );
traceOutputCheckBox.Checked = settings.GetSetting( "Gui.ResultTabs.DisplayTraceTab", true )
|| settings.GetSetting( "Gui.ResultTabs.MergeTraceOutput", false );
labelTestOutputCheckBox.Checked = settings.GetSetting( "Gui.ResultTabs.DisplayTestLabels", false );
failureToolTips.Checked = settings.GetSetting( "Gui.ResultTabs.ErrorsTab.ToolTipsEnabled", true );
enableWordWrap.Checked = settings.GetSetting( "Gui.ResultTabs.ErrorsTab.WordWrapEnabled", true );
mergeErrors.Checked = settings.GetSetting( "Gui.ResultTabs.MergeErrorOutput", false );
mergeTrace.Checked = settings.GetSetting( "Gui.ResultTabs.MergeTraceOutput", false );
}