Exemplo n.º 1
0
 public CompositeEntry(string pathList)
 {
     foreach (var path in pathList.Split(";"))
     {
         _entryList.Add(EntryFactory.GetEntry(path));
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 解析用户自定义的classpath
 /// </summary>
 /// <param name="classpathOption"></param>
 private void ParseUserClasspath(CommandLine commandLine)
 {
     if (string.IsNullOrEmpty(commandLine.UserClasspathInfo))
     {
         commandLine.UserClasspathInfo = ".";
     }
     this.UserClasspath = EntryFactory.GetEntry(commandLine.UserClasspathInfo);
 }
 protected override void OnParentSet()
 {
     base.OnParentSet();
     if (BorderColor != null)
     {
         entry = EntryFactory.GetEntry(BorderColor);
     }
     Bind();
     this.Children.Add(label);
     this.Children.Add(entry);
 }
Exemplo n.º 4
0
        /// <summary>
        /// Registers a concrete class type in the container
        /// </summary>
        /// <typeparam name="classType">The type to register</typeparam>
        /// <param name="entry">The container entry to be added</param>
        private void RegisterClassType(Type classType, LifestyleType lifestyleType)
        {
            // Abort if the lookupType is not a class
            if (!classType.IsClass)
            {
                throw new ArgumentException(string.Format("Expected lookup type of class, but received type of {0}", classType.ToString()));
            }

            lock (_registerLock)
            {
                if (!_entries.ContainsKey(classType))
                {
                    _entries.TryAdd(classType, EntryFactory.GetEntry(lifestyleType, classType));
                }
            }
        }
Exemplo n.º 5
0
        public void TestGetTransientEntry()
        {
            IContainerEntry entry = EntryFactory.GetEntry(LifestyleType.Transient, typeof(ConnectionName));

            Assert.NotNull(entry);
        }
Exemplo n.º 6
0
        public void TestGetSingletonEntry()
        {
            IContainerEntry entry = EntryFactory.GetEntry(LifestyleType.Singleton, typeof(ConnectionName));

            Assert.NotNull(entry);
        }