public override void Start(IBundleContext context) { TestIBll.IMessage message = new TestBll.MessageBll(); Message = message; TestIBll.ISayYear year = new TestBll.SayYearBll(); SayYear = year; messageReg = context.RegisterService<TestIBll.IMessage>(message, null); sayyear = context.RegisterService<TestIBll.ISayYear>(year, null); mcontext = context; }
/// <summary> /// /// </summary> /// <param name="context"></param> public void Start(IBundleContext context) { var serviceRef = context.GetServiceReference <IAttachContent>(); AttachContentService = context.GetService <IAttachContent>(serviceRef); serviceRegistration = context.RegisterService <IMenuItemEvent>(new MenuItemEvent()); }
public void Start(IBundleContext context) { LogService logService = new LogService(); serviceRegistration = context.RegisterService <ILogService>(logService); logger = logService.GetLogger(); logger.Debug("LogPlugin Started!"); }
/// <summary> /// /// </summary> /// <param name="context"></param> public void Start(IBundleContext context) { BundleContext = context; LeftMenu = new UserControl1(); context.ExtensionChanged += ContextOnExtensionChanged; serviceRegistration = context.RegisterService <ILoadMenuView>(new LoadMenuView()); }
/// <summary> /// 注册服务 /// </summary> /// <param name="names"></param> /// <param name="service"></param> /// <param name="properties"></param> /// <returns></returns> internal static IServiceRegistration Register(string[] names, object service, IDictionary <string, object> properties) { if (properties == null) { properties = new Dictionary <string, object>(); } properties.Add(ConfigConstant.SERVICE_RANKING, int.MaxValue); properties.Add(ConfigConstant.SERVICE_PID, bundle.BundleId + "." + service.GetType().FullName); //$NON-NLS-1$ return(bundleContext.RegisterService(names, service, properties)); }
////////////////////////////////////////////////////////////////////////// public void Start(IBundleContext context) { Assembly asm = Assembly.GetExecutingAssembly(); Type[] types = asm.GetTypes(); foreach (Type t in types) { object[] attrs = t.GetCustomAttributes(typeof(FrameworkService), false); foreach (object attr in attrs) { FrameworkService svc_attr = (FrameworkService)attr; context.RegisterService(t.FullName, asm.CreateInstance(t.FullName)); } } }
public void Start(IBundleContext context) { string fullName = typeof(ILogService).Assembly.FullName; var logServiceReference = context.GetServiceReference <ILogService>(); logService = context.GetService <ILogService>(logServiceReference); logger = logService.GetLogger(); // 注册服务 serviceRegistration = context.RegisterService <IEventService>(new EventService()); logger.Info("EventHandlePlugin Started!"); }
/// <summary> /// /// </summary> /// <param name="context"></param> public void Start(IBundleContext context) { context.ServiceChanged += contextServiceChanged; context.ExtensionChanged += ContextOnExtensionChanged; serviceRegistration = context.RegisterService <IHelloWord>(new BundleAHelloWord()); context.RegisterService <IMutilImplement>(new MutilImplementA(), new Dictionary <string, object> { { "id", "1" } }); context.RegisterService <IMutilImplement>(new MutilImplementB(), new Dictionary <string, object> { { "id", "2" } }); context.RegisterService <IMutilImplement>(new MutilImplementC(), new Dictionary <string, object> { { "id", "3" } }); }
public void Start(IBundleContext context) { // 获取服务 var logServiceReference = context.GetServiceReference <ILogService>(); logService = context.GetService <ILogService>(logServiceReference); var eventServiceReference = context.GetServiceReference <IEventService>(); eventService = context.GetService <IEventService>(eventServiceReference); logger = logService.GetLogger(); // 注册服务 serviceRegistration = context.RegisterService <IDBServices>(new DBServices(logService, eventService)); logger.Debug("DBPlugin Started!"); }
public override void Start(IBundleContext context) { Log2Service.ITextLog log = new Log2Net.TextLog(); mybllserver = context.RegisterService<Log2Service.ITextLog>(log, null); mcontext = context; }
public override void Start(IBundleContext context) { IBLL.IMyBll mybll = new BLL.MyBll(); mybllserver=context.RegisterService<IBLL.IMyBll>(mybll, null); mcontext = context; }