예제 #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;
        }
예제 #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());
        }
예제 #3
0
        public void Start(IBundleContext context)
        {
            LogService logService = new LogService();

            serviceRegistration = context.RegisterService <ILogService>(logService);
            logger = logService.GetLogger();
            logger.Debug("LogPlugin Started!");
        }
예제 #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());
        }
예제 #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));
				}
			}
		}
예제 #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!");
        }
예제 #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));
                }
            }
        }
예제 #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" }
            });
        }
예제 #10
0
파일: Class1.cs 프로젝트: Team605/X_Project
        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!");
        }
예제 #11
0
 public override void Start(IBundleContext context)
 {
     Log2Service.ITextLog log = new Log2Net.TextLog();
     mybllserver = context.RegisterService<Log2Service.ITextLog>(log, null);
     mcontext = context;
 }
예제 #12
0
 public override void Start(IBundleContext context)
 {
     IBLL.IMyBll mybll = new BLL.MyBll();
        mybllserver=context.RegisterService<IBLL.IMyBll>(mybll, null);
        mcontext = context;
 }