コード例 #1
0
ファイル: TextRules.cs プロジェクト: syurov/rt.srz
        // --------------------------------------------------------

        // основной конструктор
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="TextRules"/> class.
        /// </summary>
        /// <param name="rootRulesLoader">
        /// The root rules loader.
        /// </param>
        /// <param name="FieldNameResolver">
        /// The field name resolver.
        /// </param>
        public TextRules(XElement rootRulesLoader = null, PolicySearchFieldNameResolver FieldNameResolver = null)
        {
            this.FieldNameResolver = FieldNameResolver;

            if (rootRulesLoader != null)
            {
                LoadRules(rootRulesLoader);
            }
        }
コード例 #2
0
ファイル: TextRules.cs プロジェクト: syurov/rt.srz
 /// <summary>
 /// Initializes a new instance of the <see cref="StringParamReplacer"/> class.
 /// </summary>
 /// <param name="StringMatcher">
 /// The string matcher.
 /// </param>
 /// <param name="Replacer">
 /// The replacer.
 /// </param>
 /// <param name="FlaggedOnly">
 /// The flagged only.
 /// </param>
 /// <param name="FieldNameResolver">
 /// The field name resolver.
 /// </param>
 public StringParamReplacer(
     StringMatchingBase StringMatcher,
     string Replacer,
     bool FlaggedOnly = false,
     PolicySearchFieldNameResolver FieldNameResolver = null)
     : base(StringMatcher, FlaggedOnly, FieldNameResolver)
 {
     this.Replacer = Replacer;
 }
コード例 #3
0
ファイル: TextRules.cs プロジェクト: syurov/rt.srz
 /// <summary>
 /// Initializes a new instance of the <see cref="StringParamTrimmer"/> class.
 /// </summary>
 /// <param name="StringMatcher">
 /// The string matcher.
 /// </param>
 /// <param name="Direction">
 /// The direction.
 /// </param>
 /// <param name="FlaggedOnly">
 /// The flagged only.
 /// </param>
 /// <param name="FieldNameResolver">
 /// The field name resolver.
 /// </param>
 public StringParamTrimmer(
     StringMatchingBase StringMatcher,
     WardUnidimensional Direction,
     bool FlaggedOnly = false,
     PolicySearchFieldNameResolver FieldNameResolver = null)
     : base(StringMatcher, FlaggedOnly, FieldNameResolver)
 {
     this.Direction = Direction;
 }
コード例 #4
0
ファイル: StringConverterBase.cs プロジェクト: syurov/rt.srz
        // --------------------------------------------------------

        // конвертировать строку

        // --------------------------------------------------------
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="StringConverterBase"/> class.
        /// </summary>
        /// <param name="StringMatcher">
        /// The string matcher.
        /// </param>
        /// <param name="FlaggedOnly">
        /// The flagged only.
        /// </param>
        /// <param name="FieldNameResolver">
        /// The field name resolver.
        /// </param>
        protected StringConverterBase(
            StringMatchingBase StringMatcher,
            bool FlaggedOnly = false,
            PolicySearchFieldNameResolver FieldNameResolver = null)
        {
            this.StringMatcher = StringMatcher;
            this.FlaggedOnly   = FlaggedOnly;
            AllowedFields      = new PolicySearchFields(FieldNameResolver);
        }
コード例 #5
0
        // --------------------------------------------------------
        // public statics

        // public static FieldTypes IndexToField(int index)
        // {
        // unchecked
        // {
        // return (FieldTypes)index;
        // }
        // }

        // --------------------------------------------------------

        // public static int FieldToIndex(FieldTypes field)
        // {
        // unchecked
        // {
        // return (int)field;
        // }
        // }

        // --------------------------------------------------------

        // public static FieldTypes TryResolveFieldName(string fieldName, PolicySearchFieldNameResolver resolver = null)
        // {
        // FieldTypes field;
        // if (resolver != null)
        // {
        // field = resolver(fieldName);
        // if (field != FieldTypes.Undefined)
        // return field;
        // }
        // try
        // {
        // return (FieldTypes)Enum.Parse(typeof(FieldTypes), fieldName, ignoreCase: true);
        // }
        // catch { }
        // return FieldTypes.Undefined;
        // }

        // --------------------------------------------------------
        // properties

        // --------------------------------------------------------

        // public IEnumerable<FieldTypes> Fields // !! может вернуть null
        // {
        // get
        // {
        // CheckWhetherResolved();
        // return fields;
        // }
        // }

        // --------------------------------------------------------
        // publics
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="PolicySearchFields"/> class.
        /// </summary>
        /// <param name="FieldNameResolver">
        /// The field name resolver.
        /// </param>
        public PolicySearchFields(PolicySearchFieldNameResolver FieldNameResolver = null)
        {
            this.FieldNameResolver = FieldNameResolver;
        }