本文整理汇总了C#中ISettingsService.RegisterSettings方法的典型用法代码示例。如果您正苦于以下问题:C# ISettingsService.RegisterSettings方法的具体用法?C# ISettingsService.RegisterSettings怎么用?C# ISettingsService.RegisterSettings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISettingsService
的用法示例。
在下文中一共展示了ISettingsService.RegisterSettings方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SledDebugHeartbeatService
public SledDebugHeartbeatService(ISettingsService settingsService)
{
// Save heartbeat settings
settingsService.RegisterSettings(
this,
new BoundPropertyDescriptor(
this,
() => HeartbeatSettings,
"Heartbeat Settings",
"DebugHeartbeat",
"Heartbeat Settings"));
// Add some user settings to edit > preferences
settingsService.RegisterUserSettings(
"Heartbeat",
new BoundPropertyDescriptor(
this,
() => Audible,
"Verbose",
null,
"Enable or disable heartbeat output"),
new BoundPropertyDescriptor(
this,
() => ControlConnection,
"Control Connection",
null,
"True if heartbeat can disconnect the connection after 3 timeouts or false if it cannot"));
}
示例2: SledSyntaxCheckerService
public SledSyntaxCheckerService(ISettingsService settingsService)
{
Enabled = true;
Verbosity = SledSyntaxCheckerVerbosity.Overall;
var enabledProp =
new BoundPropertyDescriptor(
this,
() => Enabled,
"Enabled",
null,
"Enable or disable the syntax checker");
var verboseProp =
new BoundPropertyDescriptor(
this,
() => Verbosity,
"Verbosity",
null,
"Verbosity level");
// Persist settings
settingsService.RegisterSettings(this, enabledProp, verboseProp);
// Add user settings
settingsService.RegisterUserSettings("Syntax Checker", enabledProp, verboseProp);
m_syncContext = SynchronizationContext.Current;
m_batchTimer = new Timerz { Interval = TimerIntervalMsec };
m_batchTimer.Tick += BatchTimerTick;
m_batchTimer.Start();
}
示例3: SledNetPluginTcp
public SledNetPluginTcp(ISettingsService settingsService)
{
// From AssemblyInfo.cs in this .dll
PluginGuid = new Guid("7cdb0b45-9c29-4412-8bcd-1413b058611c");
// Persist settings
settingsService.RegisterSettings(
this,
new BoundPropertyDescriptor(
this,
() => PersistedSettings,
"TCP Settings",
"Network",
"TCP Settings"));
// Add some user settings to edit > preferences
settingsService.RegisterUserSettings(
"Network",
new BoundPropertyDescriptor(
this,
() => DefaultPortUserSetting,
"TCP Default Port",
null,
"Default TCP port"));
}
示例4: SledLuaFunctionParserService
public SledLuaFunctionParserService(ISettingsService settingsService)
{
var verboseSetting =
new BoundPropertyDescriptor(
this,
() => Verbose,
Resources.Resource.Verbose,
Resources.Resource.LuaFunctionParser,
Resources.Resource.Verbose);
settingsService.RegisterSettings(this, verboseSetting);
settingsService.RegisterUserSettings(SledLuaSettings.Category, verboseSetting);
}
示例5: SledLuaCompilerService
public SledLuaCompilerService(
MainForm mainForm,
ICommandService commandService,
ISettingsService settingsService)
{
m_mainForm = mainForm;
commandService.RegisterCommand(
Command.Compile,
SledLuaMenuShared.MenuTag,
SledLuaMenuShared.CommandGroupTag,
Localization.SledLuaCompilerCompile,
Localization.SledLuaCompilerCompileComment,
Keys.None,
SledLuaIcon.Compile,
CommandVisibility.All,
this);
commandService.RegisterCommand(
Command.Settings,
SledLuaMenuShared.MenuTag,
SledLuaMenuShared.CommandGroupTag,
Localization.SledLuaCompilerSettings,
Localization.SledLuaCompilerSettingsComment,
Keys.None,
null,
CommandVisibility.Menu,
this);
// Save Lua compiler settings
settingsService.RegisterSettings(
this,
new BoundPropertyDescriptor(
this,
() => LuaCompilerSettings,
Resources.Resource.LuaCompilerSettingsTitle,
Resources.Resource.LuaCompilerSettings,
Resources.Resource.LuaCompilerSettingsTitle));
// Add some user settings to edit > preferences
settingsService.RegisterUserSettings(
SledLuaSettings.Category,
new BoundPropertyDescriptor(
this,
() => Verbose,
Resources.Resource.Verbose,
Resources.Resource.LuaCompilerSettingsTitle,
Resources.Resource.Verbose));
}
示例6: SledTargetService
public SledTargetService(
MainForm mainForm,
ICommandService commandService,
ISettingsService settingsService)
{
m_mainForm = mainForm;
// Create a new menu for target options
var targetMenuInfo =
commandService.RegisterMenu(
Menu.Target,
Localization.SledTargetMenuTitle,
Localization.SledTargetMenuTitleComment);
commandService.RegisterCommand(
Command.ShowDialog,
Menu.Target,
CommandGroup.Target,
Localization.SledTargetMenuManageTargets,
Localization.SledTargetMenuManageTargetsComment,
Keys.Control | Keys.T,
SledIcon.DebugManageTargets,
CommandVisibility.All,
this);
m_remoteTargetComboBox = new ToolStripComboBox(Resources.Resource.RemoteTargets);
m_remoteTargetComboBox.SelectedIndexChanged += RemoteTargetComboBoxSelectedIndexChanged;
m_remoteTargetComboBox.IntegralHeight = true;
m_remoteTargetComboBox.DropDownWidth += 100;
if (m_remoteTargetComboBox.ComboBox != null)
{
var iWidth = m_remoteTargetComboBox.ComboBox.Width;
m_remoteTargetComboBox.ComboBox.Width = iWidth + 100;
}
if (targetMenuInfo != null)
targetMenuInfo.GetToolStrip().Items.Add(m_remoteTargetComboBox);
settingsService.RegisterSettings(
this,
new BoundPropertyDescriptor(
this,
() => SledTargets,
"Sled Targets",
null,
null));
}
示例7: SledLanguageParserService
public SledLanguageParserService(ISettingsService settingsService)
{
Verbosity = SledLanguageParserVerbosity.Overall;
var verboseProp =
new BoundPropertyDescriptor(
this,
() => Verbosity,
"Verbosity",
null,
"Verbosity level");
// Persist settings
settingsService.RegisterSettings(this, verboseProp);
// Add user settings
settingsService.RegisterUserSettings("Language Parser", verboseProp);
m_syncContext = SynchronizationContext.Current;
m_batchTimer = new Timerz { Interval = TimerIntervalMsec };
m_batchTimer.Tick += BatchTimerTick;
m_batchTimer.Start();
}
示例8: CommonEditor
/// <summary>
/// Constructor that configures TreeListView. Creates and registers control it populates with desired buttons
/// that have the handler method BtnClick().</summary>
/// <param name="name">Name of editor</param>
/// <param name="style">TreeListView style</param>
/// <param name="flags">Flags indicating which buttons appear for this editor</param>
/// <param name="contextRegistry">Context registry</param>
/// <param name="settingsService">Settings service</param>
/// <param name="controlHostService">Control host service</param>
public CommonEditor(
string name,
TreeListView.Style style,
Buttons flags,
IContextRegistry contextRegistry,
ISettingsService settingsService,
IControlHostService controlHostService)
: base(style)
{
m_contextRegistry = contextRegistry;
TreeListView.Name = name;
TreeListView.NodeExpandedChanged += TreeListViewNodeExpandedChanged;
{
var owner =
string.Format(
"{0}-{1}-TreeListView",
this,
TreeListView.Name);
settingsService.RegisterSettings(
owner,
new BoundPropertyDescriptor(
TreeListView,
() => TreeListView.PersistedSettings,
SettingsDisplayName,
SettingsCategory,
SettingsDescription));
}
{
//
// Create custom control to contain any
// data creation buttons + TreeListView
//
m_uberControl = new UserControl {Dock = DockStyle.Fill};
int x = 2, y = 2;
var buttonHeight = -1;
if ((flags & Buttons.AddFlat) == Buttons.AddFlat)
{
var btn = CreateButton(AddFlatText, ref x, ref y, ref buttonHeight);
btn.Tag = Buttons.AddFlat;
btn.Click += BtnClick;
m_uberControl.Controls.Add(btn);
}
if ((flags & Buttons.AddHierarchical) == Buttons.AddHierarchical)
{
var btn = CreateButton(AddHierarchicalText, ref x, ref y, ref buttonHeight);
btn.Tag = Buttons.AddHierarchical;
btn.Click += BtnClick;
m_uberControl.Controls.Add(btn);
}
if ((flags & Buttons.AddVirtual) == Buttons.AddVirtual)
{
var btn = CreateButton(AddVirtualText, ref x, ref y, ref buttonHeight);
btn.Tag = Buttons.AddVirtual;
btn.Click += BtnClick;
m_uberControl.Controls.Add(btn);
}
if ((flags & Buttons.Reload) == Buttons.Reload)
{
var btn = CreateButton(ReloadText, ref x, ref y, ref buttonHeight);
btn.Tag = Buttons.Reload;
btn.Click += BtnClick;
m_uberControl.Controls.Add(btn);
}
if ((flags & Buttons.ExpandAll) == Buttons.ExpandAll)
{
var btn = CreateButton(ExpandAllText, ref x, ref y, ref buttonHeight);
btn.Tag = Buttons.ExpandAll;
btn.Click += BtnClick;
m_uberControl.Controls.Add(btn);
}
if ((flags & Buttons.CollapseAll) == Buttons.CollapseAll)
{
var btn = CreateButton(CollapseAllText, ref x, ref y, ref buttonHeight);
btn.Tag = Buttons.CollapseAll;
btn.Click += BtnClick;
m_uberControl.Controls.Add(btn);
}
if ((flags & Buttons.RemoveItem) == Buttons.RemoveItem)
//.........这里部分代码省略.........
示例9: SledSourceControlService
//.........这里部分代码省略.........
Atf.Resources.DocumentRevertImage,
CommandVisibility.All,
this);
commandService.RegisterCommand(
Command.CheckIn,
Menu.SourceControl,
Group.SourceControl,
SourceControlCommandPrefix + "Check In",
"Check in to source control",
Keys.None,
Atf.Resources.DocumentLockImage,
CommandVisibility.All,
this);
commandService.RegisterCommand(
Command.CheckOut,
Menu.SourceControl,
Group.SourceControl,
SourceControlCommandPrefix + "Check Out",
"Check out from source control",
Keys.None,
Atf.Resources.DocumentCheckOutImage,
CommandVisibility.All,
this);
commandService.RegisterCommand(
Command.Sync,
Menu.SourceControl,
Group.SourceControl,
SourceControlCommandPrefix + "Get Latest Version",
"Get latest version from source control",
Keys.None,
Atf.Resources.DocumentGetLatestImage,
CommandVisibility.All,
this);
commandService.RegisterCommand(
Command.Refresh,
Menu.SourceControl,
Group.SourceControl,
SourceControlCommandPrefix + "Refresh Status",
"Refresh status in source control",
Keys.None,
Atf.Resources.DocumentRefreshImage,
CommandVisibility.All,
this);
commandService.RegisterCommand(
Command.History,
Menu.SourceControl,
Group.SourceControl,
SourceControlCommandPrefix + "History",
"Obtain history of items in source control",
Keys.None,
Atf.Resources.ResourceFolderImage,
CommandVisibility.All,
this);
//if ((RegisterCommands & CommandRegister.Reconcile) == CommandRegister.Reconcile)
//{
// CommandServices.RegisterCommand(m_commandService,
// InternalCommand.Reconcile,
// StandardMenu.File,
// StandardCommandGroup.FileOther,
// Localizer.Localize("Source Control/Reconcile Offline Work..."),
// Localizer.Localize("Reconcile Offline Work"),
// Keys.None,
// Resources.DocumentRefreshImage,
// CommandVisibility.Menu,
// this);
//}
commandService.RegisterCommand(
Command.Connection,
Menu.SourceControl,
Group.SourceControl,
SourceControlCommandPrefix + "Open Connection...",
"Source control connection",
Keys.None,
Atf.Resources.ShowAllImage,
CommandVisibility.All,
this);
// Persist settings
settingsService.RegisterSettings(
this,
new BoundPropertyDescriptor(
this,
() => PersistedSettings,
SettingsDisplayName,
SettingsCategory,
SettingsDescription));
documentService.Opened += DocumentServiceOpened;
documentService.Closing += DocumentServiceClosing;
projectService.FileAdded += ProjectServiceFileAdded;
projectService.FileRemoving += ProjectServiceFileRemoving;
}
示例10: SledTtyService
public SledTtyService(
MainForm mainForm,
ICommandService commandService,
ISettingsService settingsService,
IControlHostService controlHostService)
{
m_mainForm = mainForm;
m_commandService = commandService;
m_lastFlush = DateTime.Now;
// Create GUI
m_control =
new SledTtyGui
{
Name = "TTY",
ColumnNames = new[] {"Time", "Data"}
};
m_control.SendClicked += ControlSendClicked;
// Register menu
commandService.RegisterMenu(
Menu.Tty,
Localization.SledTTY,
Localization.SledTTYOptions);
// Register command to bring up TTY filters
commandService.RegisterCommand(
Command.Filter,
Menu.Tty,
CommandGroup.Tty,
Localization.SledTTYFilterTTYOutput,
Localization.SledTTYFilterTTYOutputComment,
Keys.None,
null,
CommandVisibility.Menu,
this);
// Register clear TTY window command
commandService.RegisterCommand(
Command.Clear,
Menu.Tty,
CommandGroup.Tty,
Localization.SledTTYClearTTYWindow,
Localization.SledTTYClearTTYWindowComment,
Keys.None,
null,
CommandVisibility.Menu,
this);
// Save the TTY filter list
settingsService.RegisterSettings(
this,
new BoundPropertyDescriptor(
this,
() => TtyFilters,
Resources.Resource.TTYFilterListTitle,
Resources.Resource.TTY,
Resources.Resource.TTYFilterListComment));
// Save GUI settings
settingsService.RegisterSettings(
this,
new BoundPropertyDescriptor(
this,
() => GuiSettings,
"Tty GUI Settings",
Resources.Resource.TTY,
"Tty GUI settings"));
}
示例11: RegisterSettings
/// <summary>
/// Register settings.</summary>
/// <param name="settingsService"></param>
internal void RegisterSettings(ISettingsService settingsService)
{
if (settingsService == null || m_isSettingRegistered)
return;
m_isSettingRegistered = true;
// register settings.
m_curveControl.RegisterSettings(settingsService);
settingsService.RegisterSettings(this,
new BoundPropertyDescriptor(
this, () => this.InputMode, "Input mode".Localize(), null, null));
settingsService.RegisterSettings(this,
new BoundPropertyDescriptor(
this, () => FlipY, "Flip Y-axis".Localize("same as 'flip vertical axis'"), null, null));
}