コード例 #1
0
ファイル: DbCardStyle.cs プロジェクト: Stoner19/Memory-Lifter
        /// <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
ファイル: PreviewWord.cs プロジェクト: Stoner19/Memory-Lifter
 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
ファイル: DbChapter.cs プロジェクト: Stoner19/Memory-Lifter
 /// <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
ファイル: XmlAudio.cs プロジェクト: Stoner19/Memory-Lifter
 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
ファイル: DbUser.cs プロジェクト: Stoner19/Memory-Lifter
        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
ファイル: Log.cs プロジェクト: Stoner19/Memory-Lifter
 /// <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
ファイル: XmlImage.cs プロジェクト: Stoner19/Memory-Lifter
 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
ファイル: XmlMedia.cs プロジェクト: Stoner19/Memory-Lifter
 protected XmlMedia(XmlDictionary dictionary, EMedia mediaType, string filename, ParentClass parent)
 {
     this.parent = parent;
     m_mediaIdentifier = mediaType;
     m_oDictionary = dictionary;
     m_filename = filename;
 }
コード例 #10
0
ファイル: XmlWord.cs プロジェクト: Stoner19/Memory-Lifter
 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
ファイル: XmlWords.cs プロジェクト: Stoner19/Memory-Lifter
 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
ファイル: XmlChapters.cs プロジェクト: Stoner19/Memory-Lifter
 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
ファイル: WebUser.cs プロジェクト: Stoner19/Memory-Lifter
 /// <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));
        }
コード例 #17
0
        public DbQueryMultipleChoiceOptions(int id, bool checkId, ParentClass parent)
        {
            this.parent = parent;

            if (checkId)
                connector.CheckId(id);

            this.id = id;
        }
コード例 #18
0
        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
ファイル: XmlCards.cs プロジェクト: Stoner19/Memory-Lifter
        internal XmlCards(XmlDictionary dictionary, ParentClass parentClass)
        {
            parent = parentClass;

            m_oDictionary = dictionary;
            m_dictionary = dictionary.Dictionary;
            PrepareIdNavigator();
            Initialize();
        }
コード例 #21
0
        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
ファイル: DbGradeSynonyms.cs プロジェクト: hmehr/OSS
        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];
            }
        }
コード例 #29
0
        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];
            }
        }
コード例 #30
0
        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];
            }
        }