コード例 #1
0
    public static string ToString(PossibleValues enumPos)
    {
        switch ((int)enumPos)
        {
        case 0:
            return("-");

            break;

        case 1:
            return("Left end");

            break;

        case 2:
            return("Middle left");

            break;

        case 3:
            return("Middle");

            break;

        case 4:
            return("Middle right");

            break;

        case 5:
            return("Right end");

            break;
        }
        return("-");
    }
コード例 #2
0
        public bool Equals(CustomField other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Id == other.Id &&
                   IsFilter == other.IsFilter &&
                   IsRequired == other.IsRequired &&
                   Multiple == other.Multiple &&
                   Searchable == other.Searchable &&
                   Visible == other.Visible &&
                   CustomizedType.Equals(other.CustomizedType) &&
                   DefaultValue.Equals(other.DefaultValue) &&
                   FieldFormat.Equals(other.FieldFormat) &&
                   MaxLength == other.MaxLength &&
                   MinLength == other.MinLength &&
                   Name.Equals(other.Name) &&
                   Regexp.Equals(other.Regexp) &&
                   PossibleValues.Equals(other.PossibleValues) &&
                   Roles.Equals(other.Roles) &&
                   Trackers.Equals(other.Trackers));
        }
コード例 #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public bool Equals(CustomField other)
        {
            if (other == null)
            {
                return(false);
            }

            return(Id == other.Id &&
                   IsFilter == other.IsFilter &&
                   IsRequired == other.IsRequired &&
                   Multiple == other.Multiple &&
                   Searchable == other.Searchable &&
                   Visible == other.Visible &&
                   string.Equals(CustomizedType, other.CustomizedType, StringComparison.OrdinalIgnoreCase) &&
                   string.Equals(DefaultValue, other.DefaultValue, StringComparison.OrdinalIgnoreCase) &&
                   string.Equals(FieldFormat, other.FieldFormat, StringComparison.OrdinalIgnoreCase) &&
                   MaxLength == other.MaxLength &&
                   MinLength == other.MinLength &&
                   string.Equals(Name, other.Name, StringComparison.OrdinalIgnoreCase) &&
                   string.Equals(Regexp, other.Regexp, StringComparison.OrdinalIgnoreCase) &&
                   PossibleValues.Equals(other.PossibleValues) &&
                   Roles.Equals(other.Roles) &&
                   Trackers.Equals(other.Trackers));
        }
コード例 #4
0
    public static string ToString(PossibleValues enumPos)
    {
        switch ((int)enumPos)
        {
        case 0:
            return("-");

            break;

        case 1:
            return("Orange");

            break;

        case 2:
            return("Blue");

            break;

        case 3:
            return("Green");

            break;

        case 4:
            return("Purple");

            break;

        case 5:
            return("Red");

            break;
        }
        return("-");
    }
コード例 #5
0
        public ArgumentUsageInfo(PropertyInfo toAutoGen)
            : this()
        {
            Property = toAutoGen;
            Name     = "-" + NameTranslators.CombineByPascalCase(toAutoGen.Name, "-").ToLower();

            Aliases.Add("-" + Property.Name);
            if (Aliases.Count == 0)
            {
                Aliases.Add("-" + Name.ToLower());
            }

            var argAliases = Property.HasAttr <ArgAliasAttribute>() ? Property.Attr <ArgAliasAttribute>().Aliases : null;

            if (argAliases != null)
            {
                Aliases.AddRange(argAliases.Select(x => "-" + NameTranslators.CombineByPascalCase(x, "-")));
            }

            Description = Property.HasAttr <ArgDescriptionAttribute>()
                                ? Property.Attr <ArgDescriptionAttribute>().Description
                                : "";
            Group = Property.HasAttr <ArgDescriptionAttribute>() ? Property.Attr <ArgDescriptionAttribute>().Group : "";

            if (Property.PropertyType.IsEnum)
            {
                foreach (var val in toAutoGen.PropertyType.GetFields().Where(v => v.IsSpecialName == false))
                {
                    var description = val.HasAttr <ArgDescriptionAttribute>()
                                                ? " - " + val.Attr <ArgDescriptionAttribute>().Description
                                                : "";
                    var valText = val.Name;
                    PossibleValues.Add(valText + description);
                }
            }
        }
コード例 #6
0
 public override string ToString()
 {
     return(string.Format("Name={0};Order={1};Values={2};DependsOn={3}",
                          Name, Order, PossibleValues.Print <string>(), DependsOn.Print <SnippetProperty>()));
 }
コード例 #7
0
 public override object GetXslOutput()
 {
     return(PossibleValues.IndexOf(textValue));
 }
コード例 #8
0
 /// <summary>
 /// Creates a deep copy of this heuristic. Requires <c>rules</c> to contain an
 /// <see cref="IMissingBoxValuesTracker"/>, an <see cref="IMissingColumnValuesTracker"/>,
 /// and an <see cref="IMissingRowValuesTracker"/>.
 /// </summary>
 public ISudokuHeuristic CopyWithNewReferences(
     IReadOnlyPuzzle puzzle,
     PossibleValues possibleValues,
     IReadOnlyList <ISudokuRule> rules) => new StandardHeuristic(this, puzzle, possibleValues, rules);
コード例 #9
0
ファイル: Sudoku.cs プロジェクト: llenroc/LeetCode-11
 public Slot(char v, bool confirmed = false)
 {
     Value     = v;
     Confirmed = confirmed;
     PossibleValues.Remove(v);
 }
コード例 #10
0
ファイル: Cell.cs プロジェクト: mtszmj/SudokuSolverCS
 /// <summary>
 /// Remove possible value from a set (if present).
 /// </summary>
 /// <param name="value">Value removed from set of possible values.</param>
 public void RemovePossibleValue(byte value)
 {
     PossibleValues.Remove(value);
 }
コード例 #11
0
ファイル: Cell.cs プロジェクト: mtszmj/SudokuSolverCS
 /// <summary>
 /// Intersect cell's possible values with given set (i.e. set of possible values from region).
 /// </summary>
 /// <param name="set">Set to intersect with instance's possible values.</param>
 public void IntersectPossibleValues(IEnumerable <byte> set)
 {
     PossibleValues.IntersectWith(set);
 }