Esempio n. 1
0
        /// <summary>
        /// Restore settings from JSON string.
        /// </summary>
        public static GblSettings FromJson
        (
            [NotNull] string text
        )
        {
            Sure.NotNullNorEmpty(text, nameof(text));

            GblSettings result = JsonConvert
                                 .DeserializeObject <GblSettings>(text);

            return(result);
        }
Esempio n. 2
0
        public static GblSettings ForSearchExpression
        (
            [NotNull] IrbisConnection connection,
            [NotNull] string searchExpression,
            [NotNull] IEnumerable <GblStatement> statements
        )
        {
            Sure.NotNull(connection, nameof(connection));
            Sure.NotNullNorEmpty(searchExpression, nameof(searchExpression));
            Sure.NotNull(statements, nameof(statements));

            GblSettings result = new GblSettings(connection, statements)
            {
                SearchExpression = searchExpression
            };

            return(result);
        }
Esempio n. 3
0
        public static GblSettings ForList
        (
            [NotNull] IrbisConnection connection,
            [NotNull] IEnumerable <int> mfnList,
            [NotNull] IEnumerable <GblStatement> statements
        )
        {
            Sure.NotNull(connection, nameof(connection));
            Sure.NotNull(mfnList, nameof(mfnList));
            Sure.NotNull(statements, nameof(statements));

            GblSettings result = new GblSettings(connection, statements)
            {
                MfnList = mfnList.ToArray()
            };

            return(result);
        }
Esempio n. 4
0
        public static GblSettings ForList
        (
            [NotNull] IrbisConnection connection,
            [NotNull] string database,
            [NotNull] IEnumerable <int> mfnList
        )
        {
            Sure.NotNull(connection, nameof(connection));
            Sure.NotNullNorEmpty(database, nameof(database));
            Sure.NotNull(mfnList, nameof(mfnList));

            GblSettings result = new GblSettings(connection)
            {
                Database = database,
                MfnList  = mfnList.ToArray()
            };

            return(result);
        }
Esempio n. 5
0
        public static GblSettings ForInterval
        (
            [NotNull] IrbisConnection connection,
            int minMfn,
            int maxMfn,
            [NotNull] IEnumerable <GblStatement> statements
        )
        {
            Sure.NotNull(connection, nameof(connection));
            Sure.NotNull(statements, nameof(statements));

            GblSettings result = new GblSettings(connection, statements)
            {
                MinMfn = minMfn,
                MaxMfn = maxMfn
            };

            return(result);
        }