예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DbCardStyle"/> class.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <param name="checkId">if set to <c>true</c> [check id].</param>
        /// <param name="parentClass">The parent class.</param>
        /// <remarks>Documented by Dev03, 2009-01-13</remarks>
        public DbCardStyle(int id, bool checkId, ParentClass parentClass)
        {
            parent = parentClass;

            if (checkId)
                connector.CheckId(id);

            this.id = id;
            String XmlValue = connector.GetCardStyle(id);

            if ((XmlValue != null) && (XmlValue.Length > 0))
            {
                try
                {
                    xmlStyle = (XmlCardStyle)styleSerializer.Deserialize(new StringReader(XmlValue));
                }
                catch
                {
                    Debug.WriteLine("Failed to deserialize card style!");
                    xmlStyle = new XmlCardStyle(parentClass);
                }
            }
            else
            {
                xmlStyle = new XmlCardStyle(parentClass);
            }
        }
예제 #2
0
 public PreviewWord(string word, WordType type, bool isDefault, ParentClass parent)
 {
     this.word = word;
     this.type = type;
     this._default = isDefault;
     this.parent = parent;
 }
예제 #3
0
파일: XmlDistractor.cs 프로젝트: hmehr/OSS
 internal XmlDistractor(XmlElement card, string distractor,ParentClass parent)
 {
     m_Distractor = card.OwnerDocument.CreateElement(m_XPathDistractor);
     XmlHelper.CreateAndAppendAttribute(m_Distractor, m_XPathId, Convert.ToString(-1));
     m_Distractor.InnerText = distractor;
     this.parent = parent;
 }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DbChapter"/> class.
 /// </summary>
 /// <param name="id">The id.</param>
 /// <param name="CheckId">if set to <c>true</c> [check id].</param>
 /// <param name="parent">The parent.</param>
 /// <remarks>Documented by Dev03, 2009-01-13</remarks>
 public DbChapter(int id, bool CheckId, ParentClass parent)
 {
     this.parent = parent;
     if (CheckId)
         connector.CheckChapterId(id);
     this.id = id;
 }
예제 #5
0
 internal XmlAudio(XmlDictionary dictionary, string filename, bool active, bool defaultAudio, bool exampleAudio, ParentClass parent)
     : base(dictionary, EMedia.Audio, filename, parent)
 {
     m_active = active;
     m_default = defaultAudio;
     m_example = exampleAudio;
 }
예제 #6
0
        internal DbUser(UserStruct? user, ParentClass parent, ConnectionStringStruct connection, DataAccessErrorDelegate errorMessageDelegate, bool standAlone)
        {
            this.parent = parent;
            connectionString = connection;
            ErrorMessageDelegate = errorMessageDelegate;

            cache = new Cache(true);

            if (!user.HasValue)
                throw new NoValidUserException();

            this.authenticationStruct = user.Value;
            this.username = user.Value.UserName;
            this.hashedPassword = user.Value.Password;

            this.standAlone = standAlone;
            this.user = user;

            securityFramework = MLifter.DAL.Security.SecurityFramework.GetDataAdapter(this);
            if (username != null && securityFramework != null)
            {
                try
                {
                    securityToken = securityFramework.CreateSecurityToken(this.username);
                    securityToken.IsCaching = cachePermissions;
                }
                catch (Exception ex)
                {
                    Debug.WriteLine("Failed to create security token! (" + ex.Message + ")");
                }
            }

            Login();
        }
예제 #7
0
 /// <summary>
 /// Cards the added.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <remarks>Documented by Dev05, 2009-05-25</remarks>
 public static void CardAdded(ParentClass parent)
 {
     if (parent.CurrentUser.ConnectionString.Typ == DatabaseType.Xml)
         return;
     else
         GetSessionConnector(parent).CardAdded(lastSessionId);
 }
예제 #8
0
 internal XmlImage(XmlDictionary dictionary, string filename, int width, int height, bool active, ParentClass parent)
     : base(dictionary, EMedia.Image, filename, parent)
 {
     m_active = active;
     m_width = width;
     m_height = height;
 }
예제 #9
0
 protected XmlMedia(XmlDictionary dictionary, EMedia mediaType, string filename, ParentClass parent)
 {
     this.parent = parent;
     m_mediaIdentifier = mediaType;
     m_oDictionary = dictionary;
     m_filename = filename;
 }
예제 #10
0
 internal XmlWord(string word, WordType type, bool isDefault, ParentClass parent)
 {
     m_word = (word == null) ? String.Empty : word;
     m_type = type;
     m_default = isDefault;
     this.parent = parent;
 }
예제 #11
0
파일: DbWords.cs 프로젝트: hmehr/OSS
 public DbWords(int CardId, Side ListSide, WordType ListType, ParentClass parentClass)
 {
     id = CardId;
     side = ListSide;
     type = ListType;
     parent = parentClass;
 }
예제 #12
0
 internal XmlAnswerExample(XmlCard card, ParentClass parent)
     : base(parent)
 {
     base.m_basePath = m_basePath;
     this.m_Culture = card.Dictionary.AnswerCulture;
     Initialize(card, WordType.Sentence);
 }
예제 #13
0
 internal XmlChapters(XmlDictionary dictionary, ParentClass parent)
 {
     this.parent = parent;
     m_oDictionary = dictionary;
     m_dictionary = dictionary.Dictionary;
     Initialize();
     PrepareIdNavigator();
 }
예제 #14
0
 internal XmlAnswerDistractors(XmlDictionary dic, XmlCard card, ParentClass parent)
     : base(parent)
 {
     base.m_oDictionary = dic;
     base.m_XPathBasePath = m_XPathBasePath;
     this.m_Culture = card.Dictionary.AnswerCulture;
     Initialize(card);
 }
예제 #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WebUser"/> class.
 /// </summary>
 /// <param name="userId">The user id.</param>
 /// <param name="authenticationStruct">The authentication struct.</param>
 /// <param name="connection">The connection.</param>
 /// <param name="service">The service.</param>
 /// <param name="parent">The parent.</param>
 /// <remarks>Documented by Dev05, 2009-03-06</remarks>
 internal WebUser(int userId, UserStruct authenticationStruct, ConnectionStringStruct connection, MLifterLearningModulesService service, ParentClass parent)
 {
     id = userId;
     authStruct = authenticationStruct;
     ConnectionString = connection;
     WebService = service;
     this.parent = parent;
 }
예제 #16
0
        internal XmlQueryOptions(XmlDictionary dictionary, ParentClass parentClass)
        {
            parent = parentClass;

            m_dictionary = dictionary.Dictionary;
            m_userSettings = (XmlElement)m_dictionary.SelectSingleNode(m_basePath);
            m_MultipleChoiceOptions = new XmlQueryMultipleChoiceOptions(dictionary, Parent.GetChildParentClass(this));
        }
        public DbQueryMultipleChoiceOptions(int id, bool checkId, ParentClass parent)
        {
            this.parent = parent;

            if (checkId)
                connector.CheckId(id);

            this.id = id;
        }
        public static MsSqlCeChapterConnector GetInstance(ParentClass parentClass)
        {
            ConnectionStringStruct connection = parentClass.CurrentUser.ConnectionString;

            if (!instances.ContainsKey(connection))
                instances.Add(connection, new MsSqlCeChapterConnector(parentClass));

            return instances[connection];
        }
예제 #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PreviewDictionary"/> class.
 /// </summary>
 /// <param name="user">The user.</param>
 /// <remarks>Documented by Dev03, 2009-03-23</remarks>
 public PreviewDictionary(IUser user)
 {
     parent = new ParentClass(user, this);
     cards = new PreviewCards(parent.GetChildParentClass(this));
     userSettings = new PreviewSettings(parent.GetChildParentClass(this));
     allowedSettings = new PreviewSettings(parent.GetChildParentClass(this));
     defaultSettings = new PreviewSettings(parent.GetChildParentClass(this));
     statistics = new PreviewStatistics();
 }
예제 #20
0
        internal XmlCards(XmlDictionary dictionary, ParentClass parentClass)
        {
            parent = parentClass;

            m_oDictionary = dictionary;
            m_dictionary = dictionary.Dictionary;
            PrepareIdNavigator();
            Initialize();
        }
        public static PgSqlDictionariesConnector GetInstance(ParentClass parentClass)
        {
            ConnectionStringStruct connection = parentClass.CurrentUser.ConnectionString;

            if (!instances.ContainsKey(connection))
                instances.Add(connection, new PgSqlDictionariesConnector(parentClass));

            return instances[connection];
        }
예제 #22
0
        public DbQueryDirections(int id, bool checkId, ParentClass parent)
        {
            this.parent = parent;

            if (checkId)
                connector.CheckId(id);

            this.id = id;
        }
예제 #23
0
        public DbGradeSynonyms(int id, bool checkId, ParentClass parent)
        {
            this.parent = parent;

            if (checkId)
                connector.CheckId(id);

            this.id = id;
        }
예제 #24
0
파일: DbSettings.cs 프로젝트: hmehr/OSS
        /// <summary>
        /// Initializes a new instance of the <see cref="DbSettings"/> class.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <param name="checkId">if set to <c>true</c> [check id].</param>
        /// <param name="parent">The parent.</param>
        /// <remarks>Documented by Dev03, 2009-01-15</remarks>
        public DbSettings(int id, bool checkId, ParentClass parent)
        {
            this.parent = parent;

            if (checkId)
                connector.CheckSettingsId(id);

            this.id = id;
        }
예제 #25
0
파일: DbWord.cs 프로젝트: hmehr/OSS
 public DbWord(int id, string word, WordType type, bool isDefault, ParentClass parent)
 {
     loading = true;
     this.id = id;
     Word = word;
     Type = type;
     Default = isDefault;
     this.parent = parent;
     loading = false;
 }
예제 #26
0
파일: DbWord.cs 프로젝트: hmehr/OSS
 public DbWord(int id, ParentClass parent)
 {
     loading = true;
     this.id = id;
     Word = connector.GetWord(id);
     Type = connector.GetType(id);
     Default = connector.GetDefault(id);
     this.parent = parent;
     loading = false;
 }
예제 #27
0
파일: DbStatistics.cs 프로젝트: hmehr/OSS
        public DbStatistics(int lmId, ParentClass parentClass)
        {
            this.parent = parentClass;
            this.learningModuleId = lmId;

            //Update the whole Statistics list
            stats.Clear();
            List<int> learnSessions = connector.GetLearnSessions(learningModuleId);
            foreach (int id in learnSessions)
                stats.Add(new DbStatistic(id, parent));
        }
        public static PgSqlQueryMultipleChoiceOptionsConnector GetInstance(ParentClass parentClass)
        {
            lock (instances)
            {
                ConnectionStringStruct connection = parentClass.CurrentUser.ConnectionString;

                if (!instances.ContainsKey(connection))
                    instances.Add(connection, new PgSqlQueryMultipleChoiceOptionsConnector(parentClass));

                return instances[connection];
            }
        }
        public static PgSqlStatisticConnector GetInstance(ParentClass parent)
        {
            lock (instance)
            {
                ConnectionStringStruct connection = parent.CurrentUser.ConnectionString;

                if (!instance.ContainsKey(connection))
                    instance.Add(connection, new PgSqlStatisticConnector(parent));

                return instance[connection];
            }
        }
        public static MsSqlCeQueryTypesConnector GetInstance(ParentClass ParentClass)
        {
            lock (instances)
            {
                ConnectionStringStruct connection = ParentClass.CurrentUser.ConnectionString;

                if (!instances.ContainsKey(connection))
                    instances.Add(connection, new MsSqlCeQueryTypesConnector(ParentClass));

                return instances[connection];
            }
        }