本文整理汇总了C#中IApp.GetService方法的典型用法代码示例。如果您正苦于以下问题:C# IApp.GetService方法的具体用法?C# IApp.GetService怎么用?C# IApp.GetService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IApp
的用法示例。
在下文中一共展示了IApp.GetService方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
public override void Initialize(IApp app)
{
base.Initialize(app);
control.App = app;
app.GetService<IDocumentService>().DocumentAdded += DocumentAdded;
app.GetService<IDocumentService>().DocumentRemoved += DocumentRemoved;
BuildNodes();
}
示例2: BuildLogger
internal BuildLogger(IApp app, Document doc, ScintillaControl sci, BuildOptions options)
{
this.app = app;
this.doc = doc;
this.sci = sci;
this.options = options;
app.CloseView("ErrorList");
this.err = app.GetService<IErrorListService>();
this.output = app.GetService<IOutputService>();
}
示例3: Initialize
internal void Initialize(IApp app)
{
this.app = app;
contextMenu = new ContextMenuStrip();
contextMenu.Items.Add("Remove Bookmark", null, (o, e) => RemoveBookmark(lastNodeClick));
MenuRenderer.ApplySkin(contextMenu);
this.sciMap = new Dictionary<ScintillaControl,Object>();
this.nodeMap = new Dictionary<Document,TreeNode>();
this.treeView = new BufferedTreeView();
this.treeView.Font = Fonts.Text;
this.treeView.BorderStyle = BorderStyle.None;
this.treeView.ShowLines = false;
this.treeView.BeforeExpand += TreeViewBeforeExpand;
this.treeView.NodeMouseClick += NodeMouseClick;
var img = new ImageList();
img.ColorDepth = ColorDepth.Depth32Bit;
img.TransparentColor = Color.Magenta;
img.ImageSize = new Size(16, 16);
img.Images.Add("Folder", Bitmaps.Load<NS>("Folder"));
img.Images.Add("Bookmark", Bitmaps.Load<NS>("Bookmark"));
treeView.ImageList = img;
var srv = app.GetService<IDocumentService>();
srv.EnumerateDocuments().ForEach(d => AddDocument(d as TextDocument));
srv.DocumentAdded += DocumentAdded;
srv.DocumentRemoved += DocumentRemoved;
}
示例4: Initialize
public void Initialize(IApp app)
{
viewer = new ObjectFileViewer();
App = app;
app.GetService<IConfigService>().ConfigUpdated += ConfigUpdated;
contextMenu = BuildContextMenu();
}
示例5: Initialize
public override void Initialize(IApp app)
{
base.Initialize(app);
if (man == null)
man = new TaskManager(app, (TaskListService)app.GetService<ITaskListService>());
}
示例6: TaskManager
public TaskManager(IApp app, TaskListService service)
{
this.app = app;
this.service = service;
this.sciMap = new Dictionary<ScintillaControl,Object>();
this.nodeMap = new Dictionary<CodeDocument,TreeNode>();
this.treeView = new BufferedTreeView();
this.treeView.Font = Fonts.Text;
this.treeView.BorderStyle = BorderStyle.None;
this.treeView.ShowLines = false;
this.treeView.BeforeExpand += TreeViewBeforeExpand;
this.treeView.NodeMouseClick += NodeMouseClick;
var img = new ImageList();
img.ColorDepth = ColorDepth.Depth32Bit;
img.TransparentColor = Color.Magenta;
img.ImageSize = new Size(16, 16);
img.Images.Add("Folder", Bitmaps.Load<NS>("Folder"));
img.Images.Add("Task", Bitmaps.Load<NS>("Task"));
treeView.ImageList = img;
var srv = app.GetService<IDocumentService>();
srv.EnumerateDocuments().ForEach(d => AddDocument(d as CodeDocument));
srv.DocumentAdded += DocumentAdded;
srv.DocumentRemoved += DocumentRemoved;
}
示例7: Initialize
public override void Initialize(IApp app)
{
base.Initialize(app);
WB.Form.Initialize(app);
var cs = app.GetService<IConfigService>();
cs.ConfigUpdated += ConfigUpdated;
}
示例8: Initialize
public override void Initialize(IApp app)
{
base.Initialize(app);
grid.App = app;
var builder = app.GetService<IMenuService>().CreateMenuBuilder<ContextMenuStrip>();
grid.ContextMenuStrip = builder.Item("Clear", ClearItems, () => grid.ItemsCount > 0).Finish();
}
示例9: Initialize
public override void Initialize(IApp app)
{
base.Initialize(app);
var docs = app.GetService<IDocumentService>();
docs.ActiveDocumentChanged += ActiveDocumentChanged;
docs.DocumentAdded += DocumentAdded;
docs.DocumentClosed += DocumentClosed;
docs.DocumentRemoved += DocumentRemoved;
}
示例10: Initialize
public override void Initialize(IApp app)
{
base.Initialize(app);
treeView.NodesNeeded += (o,e) => NodesNeeded(e.Node);
treeView.NodeMouseDoubleClick += (o,e) =>
{
if (e.Node.Tag is FileInfo)
App.GetService<IFileService>().OpenFile((FileInfo)e.Node.Tag);
};
app.GetService<IConfigService>().ConfigUpdated += ConfigUpdated;
}
示例11: DocReader
internal DocReader(IApp app)
{
this.baseDir = app.GetService<IPathService>().GetPath(PlatformPath.Docs);
}
示例12: Initialize
internal void Initialize(IApp app)
{
topBorderPanel.BackColor = toolDock.BackColor = mainSplit.BackColor = UserColors.Background;
mainSplit.SplitterDistance = mainSplit.ClientSize.Height - mainSplit.Panel2MinSize - mainSplit.SplitterWidth;
App = app;
documentContainer.SelectedDocumentFunc = App.Document;
documentContainer.DocumentCaptionRedraw += (o,e) => UpdateWindowHeader();
App.GetService<IDocumentService>().DocumentClosed += (o,e) => UpdateWindowHeader();
}
示例13: Initialize
public override void Initialize(IApp app)
{
base.Initialize(app);
Compilers.ForEach(b =>
{
if (b.Type.GetInterface(typeof(IBackgroundCompiler).Name) == null)
throw new ElideException("Compiler '{0}' doesn't implement IBackgroundCompiler interface.", b.Type);
var bc = TypeCreator.New<IBackgroundCompiler>(b.Type);
var inf = (EditorInfo)app.GetService<IEditorService>().GetInfo("editors", b.EditorKey);
var ins = inf.Instance as ICodeEditor;
if (ins == null)
throw new ElideException("Compiler '{0}' can be only registered for the code editor.", b.Type);
var sci = ins.Control as ScintillaControl;
var wrap = new BackgroundCompiler(app, sci, bc, this);
CompilerInstances.Add(b.EditorKey, wrap);
});
app.GetService<IDaemonService>().RegisterDaemon(this);
app.GetService<IDocumentService>().DocumentAdded += (_,e) => DocumentOpened(e.Document);
}
示例14: CodeSamplesReader
internal CodeSamplesReader(IApp app)
{
this.baseDir = Path.Combine(app.GetService<IPathService>().GetPath(PlatformPath.Docs), "samples");
}
示例15: SwiftPaymentStatusUpdateFactoryEngine
public SwiftPaymentStatusUpdateFactoryEngine(IApp app)
: base(app, AppEvents.Initialize | AppEvents.PostRun | AppEvents.PreStop)
{
app.GetService<ILogProvider>().System.Info("Constructing SWIFT payment status update engine...");
}