コード例 #1
0
ファイル: Services.cs プロジェクト: RozenbergMikhail/Optimum
		/// <summary>
		/// Creates new instance of <see cref="Services"/>
		/// </summary>
		/// <param name="platformFullSectionName">full section name of platform section</param>
		/// <param name="platformWebFullSectionName">full section name of platform web section</param>
		/// <param name="sampleFullSectionName">full section name of sample web section</param>
		public Services(string platformFullSectionName, string platformWebFullSectionName, string sampleFullSectionName)
		{
			if (platformFullSectionName == null)
				throw new MemoryPointerIsNullException("platformFullSectionName");

			if (platformWebFullSectionName == null)
				throw new MemoryPointerIsNullException("platformWebFullSectionName");

			if (sampleFullSectionName == null)
				throw new MemoryPointerIsNullException("sampleFullSectionName");

			this.Bundle.AddServiceResolversFromAnotherBundle(new Platform.Bundles.System.Services(platformFullSectionName).Bundle);
			this.Bundle.AddServiceResolversFromAnotherBundle(new Platform.Web.Bundles.Auth.Services(platformWebFullSectionName).Bundle);
			this.Bundle.AddServiceResolversFromAnotherBundle(new Sample.Bundles.Auth.Services(this.Bundle.GetServiceResolver<IUTCTimeProvider>()).Bundle);
			this.Bundle.AddServiceResolversFromAnotherBundle(new Sample.Bundles.Delegates.Services().Bundle);
			this.Bundle.AddServiceResolversFromAnotherBundle(new Sample.Bundles.SampleTypes.Services(sampleFullSectionName).Bundle);
			this.Bundle.AddServiceResolversFromAnotherBundle(new Sample.Bundles.AnotherTypes.Services(sampleFullSectionName).Bundle);
			this.Bundle.AddServiceResolversFromAnotherBundle(new Sample.Bundles.YetAnotherTypes.Services(sampleFullSectionName).Bundle);
			this.Bundle.AddServiceResolversFromAnotherBundle(new Sample.Bundles.Meetings.Services(this.Bundle.GetServiceResolver<IDelegateProvider>()).Bundle);

			var contextInitData = new ContextInitData()
			{
				UTCTimeProviderResolver = this.Bundle.GetServiceResolver<IUTCTimeProvider>(),
				LocalTimeOffsetProviderResolver = this.Bundle.GetServiceResolver<ILocalTimeOffsetProvider>(),
				UICultureProviderResolver = this.Bundle.GetServiceResolver<IUICultureProvider>(),
			};

			var contextServices = new Sample.Bundles.Contexts.Services(contextInitData,
				this.Bundle.GetServiceResolver<IUserDataProvider>(),
				this.Bundle.GetServiceResolver<IMeetingProvider>());
			this.Bundle.AddServiceResolversFromAnotherBundle(contextServices.Bundle);
		}
コード例 #2
0
		/// <summary>
		/// Creates new instance of <see cref="ContextInitData"/>
		/// </summary>
		/// <param name="other">other context init data</param>
		public ContextInitData(ContextInitData other)
		{
			if (other == null)
				throw new MemoryPointerIsNullException("other");

			this.UTCTimeProviderResolver = other.UTCTimeProviderResolver;
			this.LocalTimeOffsetProviderResolver = other.LocalTimeOffsetProviderResolver;
			this.UICultureProviderResolver = other.UICultureProviderResolver;
		}
コード例 #3
0
		/// <summary>
		/// Creates new instance of <see cref="ContextProvider"/>
		/// </summary>
		/// <param name="contextInitData">context initialization data</param>
		/// <param name="userDataProvider">user data provider</param>
		public ContextProvider(ContextInitData contextInitData, IServiceResolver<IUserDataProvider> userDataProviderResolver)
		{
			if (contextInitData == null)
				throw new MemoryPointerIsNullException("contextInitData");

			if (userDataProviderResolver == null)
				throw new MemoryPointerIsNullException("userDataProviderResolver");

			this.contextInitData = contextInitData;
			this.userDataProviderResolver = userDataProviderResolver;
		}
コード例 #4
0
        /// <summary>
        /// Creates new instance of <see cref="ContextInitData"/>
        /// </summary>
        /// <param name="other">other context init data</param>
        public ContextInitData(ContextInitData other)
        {
            if (other == null)
            {
                throw new MemoryPointerIsNullException("other");
            }

            this.UTCTimeProviderResolver         = other.UTCTimeProviderResolver;
            this.LocalTimeOffsetProviderResolver = other.LocalTimeOffsetProviderResolver;
            this.UICultureProviderResolver       = other.UICultureProviderResolver;
        }
コード例 #5
0
		/// <summary>
		/// Creates new instance of <see cref="SampleContextProvider"/>
		/// </summary>
		/// <param name="contextInitData">context initialization data</param>
		/// <param name="userDataProviderResolver">user data provider resolver</param>
		/// <param name="meetingProviderResolver">meeting provider resolver</param>
		public SampleContextProvider(
			ContextInitData contextInitData, 
			IServiceResolver<IUserDataProvider> userDataProviderResolver,
			IServiceResolver<IMeetingProvider> meetingProviderResolver)
			: base(contextInitData, userDataProviderResolver)
		{
			if (meetingProviderResolver == null)
				throw new MemoryPointerIsNullException("meetingProviderResolver");

			this.meetingProviderResolver = meetingProviderResolver;
		}
コード例 #6
0
		/// <summary>
		/// Creates new instance of <see cref="SampleServices"/>
		/// </summary>
		/// <param name="contextInitData">context init data</param>
		/// <param name="sampleFullSectionName">sample full section name</param>
		public SampleServices(ContextInitData contextInitData, string sampleFullSectionName)
		{
			if (contextInitData == null)
				throw new MemoryPointerIsNullException("contextInitData");

			if (sampleFullSectionName == null)
				throw new MemoryPointerIsNullException("sampleFullSectionName");

			this.contextInitData = contextInitData;
			this.sampleFullSectionName = sampleFullSectionName;
			InitializeBundle();
		}
コード例 #7
0
ファイル: Context.cs プロジェクト: RozenbergMikhail/Optimum
		/// <summary>
		/// Creates new instance of <see cref="Context"/>
		/// </summary>
		/// <param name="initData">initialization data</param>
		public Context(ContextInitData initData)
		{
			if (initData == null)
				throw new MemoryPointerIsNullException("initData");

			initData.ValidatePropertiesNotNull();

			this.UTCTimeProviderResolver = initData.UTCTimeProviderResolver;
			this.localTimeOffsetProviderResolver = initData.LocalTimeOffsetProviderResolver;
			this.UICultureProviderResolver = initData.UICultureProviderResolver;

			this.items = new Dictionary<string, object>();
		}
コード例 #8
0
ファイル: Services.cs プロジェクト: RozenbergMikhail/Optimum
		/// <summary>
		/// Creates new instance of <see cref="Services"/>
		/// </summary>
		/// <param name="contextInitData">context initialization data</param>
		/// <param name="userDataProviderResolver">user data provider resolver</param>
		/// <param name="meetingProviderResolver">meeting provider resolver</param>
		public Services(ContextInitData contextInitData, IServiceResolver<IUserDataProvider> userDataProviderResolver, IServiceResolver<IMeetingProvider> meetingProviderResolver)
		{
			if (contextInitData == null)
				throw new MemoryPointerIsNullException("contextInitData");

			if (userDataProviderResolver == null)
				throw new MemoryPointerIsNullException("userDataProviderResolver");

			if (meetingProviderResolver == null)
				throw new MemoryPointerIsNullException("meetingProviderResolver");

			var contextProvider = new SampleContextProvider(contextInitData, userDataProviderResolver, meetingProviderResolver);
			this.Bundle.AddServiceResolver(new ServiceResolver<ISampleContextProvider>(contextProvider));
		}
コード例 #9
0
        /// <summary>
        /// Creates new instance of <see cref="ContextProvider"/>
        /// </summary>
        /// <param name="contextInitData">context initialization data</param>
        /// <param name="userDataProvider">user data provider</param>
        public ContextProvider(ContextInitData contextInitData, IServiceResolver <IUserDataProvider> userDataProviderResolver)
        {
            if (contextInitData == null)
            {
                throw new MemoryPointerIsNullException("contextInitData");
            }

            if (userDataProviderResolver == null)
            {
                throw new MemoryPointerIsNullException("userDataProviderResolver");
            }

            this.contextInitData          = contextInitData;
            this.userDataProviderResolver = userDataProviderResolver;
        }
コード例 #10
0
        /// <summary>
        /// Creates new instance of <see cref="Context"/>
        /// </summary>
        /// <param name="initData">initialization data</param>
        public Context(ContextInitData initData)
        {
            if (initData == null)
            {
                throw new MemoryPointerIsNullException("initData");
            }

            initData.ValidatePropertiesNotNull();

            this.UTCTimeProviderResolver         = initData.UTCTimeProviderResolver;
            this.localTimeOffsetProviderResolver = initData.LocalTimeOffsetProviderResolver;
            this.UICultureProviderResolver       = initData.UICultureProviderResolver;

            this.items = new Dictionary <string, object>();
        }
コード例 #11
0
		/// <summary>
		/// Creates new instance of <see cref="MeetingContextInitData"/>
		/// </summary>
		/// <param name="contextInitData">context init data</param>
		public MeetingContextInitData(ContextInitData contextInitData)
			: base(contextInitData)
		{
		}
コード例 #12
0
		/// <summary>
		/// Creates new instance of <see cref="UserContextInitData"/>
		/// </summary>
		/// <param name="contextInitData">context init data</param>
		public UserContextInitData(ContextInitData contextInitData)
			: base(contextInitData)
		{
		}
コード例 #13
0
 /// <summary>
 /// Creates new instance of <see cref="UserContextInitData"/>
 /// </summary>
 /// <param name="contextInitData">context init data</param>
 public UserContextInitData(ContextInitData contextInitData)
     : base(contextInitData)
 {
 }