public Task OnInitialise() { foreach (var si in _statusItems.OrderBy(x => OrderHintAttribute.GetOrderHint(x.Value.GetType()))) { Add(si.Value); } // Subscribe to context changes Oy.Subscribe <IContext>("Context:Changed", ContextChanged); return(Task.FromResult(0)); }
public Task OnStartup() { // Register the exported sidebar components foreach (var export in _sidebarComponents) { var ty = export.Value.GetType(); var hint = OrderHintAttribute.GetOrderHint(ty); Add(export.Value, hint); Log.Debug("Sidebar", "Loaded: " + export.Value.GetType().FullName); } // Subscribe to context changes Oy.Subscribe <IContext>("Context:Changed", ContextChanged); return(Task.CompletedTask); }
public async Task OnStartup() { // Register the exported tools foreach (var export in _tools.OrderBy(x => OrderHintAttribute.GetOrderHint(x.Value.GetType()))) { Log.Debug(nameof(ToolRegister), "Loaded: " + export.Value.GetType().FullName); _components.Add(export.Value); } // Subscribe to context changes Oy.Subscribe <IContext>("Context:Changed", ContextChanged); Oy.Subscribe <string>("ActivateTool", async x => { await ActivateTool(_components.FirstOrDefault(t => t.Name == x)); }); Oy.Subscribe <ITool>("ActivateTool", ActivateTool); }