Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
        /// <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());
        }
Exemplo n.º 3
0
        public void Start(IBundleContext context)
        {
            LogService logService = new LogService();

            serviceRegistration = context.RegisterService <ILogService>(logService);
            logger = logService.GetLogger();
            logger.Debug("LogPlugin Started!");
        }
Exemplo n.º 4
0
        /// <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());
        }
Exemplo n.º 5
0
 /// <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));
				}
			}
		}
Exemplo n.º 7
0
        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!");
        }
Exemplo n.º 8
0
        //////////////////////////////////////////////////////////////////////////

        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));
                }
            }
        }
Exemplo n.º 9
0
        /// <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" }
            });
        }
Exemplo n.º 10
0
        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!");
        }
Exemplo n.º 11
0
 public override void Start(IBundleContext context)
 {
     Log2Service.ITextLog log = new Log2Net.TextLog();
     mybllserver = context.RegisterService<Log2Service.ITextLog>(log, null);
     mcontext = context;
 }
Exemplo n.º 12
0
 public override void Start(IBundleContext context)
 {
     IBLL.IMyBll mybll = new BLL.MyBll();
        mybllserver=context.RegisterService<IBLL.IMyBll>(mybll, null);
        mcontext = context;
 }