示例#1
0
 public static void SetClassProvider(ClassInformationProvider provider)
 {
     _ClassProvider = provider;
     foreach (AccessHelper var in _NonClassProviderHelperList)
     {
         ClassInformationProvider classProvider = (ClassInformationProvider)_ClassProvider.Clone();
         classProvider.AccessHelper = var;
         classProvider.CachePool    = var._CachePool;
         var._ClassHelper           = new ClassHelper(classProvider, var);
     }
     _NonClassProviderHelperList.Clear();
 }
示例#2
0
        /// <summary>
        /// 建構子
        /// </summary>
        public AccessHelper()
        {
            _CachePool = new System.Collections.Hashtable();
            if (_StudentProvider != null)
            {
                StudentInformationProvider studentProvider = (StudentInformationProvider)_StudentProvider.Clone();
                studentProvider.AccessHelper = this;
                studentProvider.CachePool    = _CachePool;
                _StudentHelper = new StudentHelper(studentProvider, this);
            }
            else
            {
                _NonStudentProviderHelperList.Add(this);
            }

            if (_ClassProvider != null)
            {
                ClassInformationProvider classProvider = (ClassInformationProvider)_ClassProvider.Clone();
                classProvider.AccessHelper = this;
                classProvider.CachePool    = _CachePool;
                _ClassHelper = new ClassHelper(classProvider, this);
            }
            else
            {
                _NonClassProviderHelperList.Add(this);
            }

            if (_CourseProvider != null)
            {
                CourseInformationProvider courseProvider = (CourseInformationProvider)_CourseProvider.Clone();
                courseProvider.AccessHelper = this;
                courseProvider.CachePool    = _CachePool;
                _CourseHelper = new CourseHelper(courseProvider, this);
            }
            else
            {
                _NonCourseProviderHelperList.Add(this);
            }

            if (_TeacherProvider != null)
            {
                TeacherInformationProvider teacherProvider = (TeacherInformationProvider)_TeacherProvider.Clone();
                teacherProvider.AccessHelper = this;
                teacherProvider.CachePool    = _CachePool;
                _TeacherHelper = new TeacherHelper(teacherProvider, this);
            }
            else
            {
                _NonTeacherProviderHelperList.Add(this);
            }
        }