RootWorkItem.UIExtensionSites.RegisterSite(“FileMenu”, Shell.MainMenuStrip);WorkItems.
ToolStripMenuItem printItem = new ToolStripMenuItem("Print");
RootWorkItem.UIExtensionSites[“FileMenu”].Add(printItem);
adding services to a workitem. ie creates an instance
WorkItem.Services.AddNew<CustomerFinderService, ICustomerFinderService>();creates an instance of the OfficerView class
WorkItem.SmartParts.AddNew<OfficerView>();get another component in a workitem
ICustomerFinderService customerFinderServcie =
WorkItem.Services.Get<ICustomerFinderService>();
EVents.
publishing
[EventPublication("topic://UpdatesAvailable", PublicationScope.Global)]subscription
public event EventHandler<DataEventArgs<UpdateData>> UpdatesAvailable;
// or
[EventPublication("topic://UpdatesAvailable", PublicationScope.Global)]
public event EventHandler UpdatesAvailable;
[EventSubscription("topic://UpdatesAvailable")]
public void SomethingHappened(object sender, DataEventArgs<UpdateData> e)
{ ... }
Module.
Module Dependencies
[assembly: ModuleDependency("BranchSystems.Module")]Loading Modules- default file is ProfileCatalog.xml
services.<?xml version="1.0" encoding="utf-8" ?>
<SolutionProfile xmlns="http://schemas.microsoft.com/pag/cab-profile" >
<Modules>
<ModuleInfo
AssemblyFile="GlobalBank.AppraiserWorkbench.AppraiserWorkbenchModule.dll" /></Modules></SolutionProfile>
Registering a service
[Service(typeof(IMyService))]
public class MyService : IMyService
{
}
Locating a Service.
private IMyService service;
[ServiceDependency]
public IMyService MyService
{
set { service = value; }
}
No comments:
Post a Comment