示例#1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Type.Length != 0)
            {
                hash ^= Type.GetHashCode();
            }
            hash ^= pattern_.GetHashCode();
            if (NameField.Length != 0)
            {
                hash ^= NameField.GetHashCode();
            }
            if (History != global::Google.Api.ResourceDescriptor.Types.History.Unspecified)
            {
                hash ^= History.GetHashCode();
            }
            if (Plural.Length != 0)
            {
                hash ^= Plural.GetHashCode();
            }
            if (Singular.Length != 0)
            {
                hash ^= Singular.GetHashCode();
            }
            hash ^= style_.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
示例#2
0
        public override int GetHashCode()
        {
            var hash = 0x1505L;

            if (Context != null)
            {
                hash = ((hash << 5) + hash) ^ Context.GetHashCode();
            }
            hash = ((hash << 5) + hash) ^ Singular.GetHashCode();
            if (Plural != null)
            {
                hash = ((hash << 5) + hash) ^ Plural.GetHashCode();
            }

            return(hash.GetHashCode());
        }
示例#3
0
        public string GetFormattedOutput(int id)
        {
            string output = "{dialog " + id;

            if (!String.IsNullOrWhiteSpace(Singular))
            {
                output += ", singular=\"" + Singular.TrimEnd() + " \"";
            }
            if (!String.IsNullOrWhiteSpace(Plural))
            {
                output += ", plural=\"" + Plural.TrimEnd() + "\"";
            }
            output += "}\n";
            output += Text + "\n";
            output += "{/dialog}\n\n";
            return(output);
        }
示例#4
0
        public Verbose(Type type)
        {
            var verboseAttributes = type.GetCustomAttributes(
                typeof(VerboseAttribute),
                false) as VerboseAttribute[];

            if (verboseAttributes.IsNullOrEmpty <VerboseAttribute>() == false)
            {
                var verbose = verboseAttributes.FirstOrDefault();
                Singular = verbose.Singular ?? type.Name.SplitCamelCase();
                Plural   = verbose.Plural ?? Singular.Pluralize().SplitCamelCase();
                Group    = verbose.GroupName ?? IlaroAdminResources.Others;
            }
            else
            {
                Singular = type.Name.SplitCamelCase();
                Plural   = Singular.Pluralize().SplitCamelCase();
                Group    = IlaroAdminResources.Others;
            }
        }
示例#5
0
 public Verbose(Type type)
 {
     Singular = type.Name.SplitCamelCase();
     Plural   = Singular.Pluralize().SplitCamelCase();
     Group    = IlaroAdminResources.Others;
 }
示例#6
0
文件: Keyword.cs 项目: qbikez/Odachi
 public override int GetHashCode()
 {
     return(Singular.GetHashCode() ^ (Plural?.GetHashCode() ?? 0) ^ (Context?.GetHashCode() ?? 0));
 }