Пример #1
0
        /// <summary>
        /// Creates a new Resource object with data. The data can be later saved to a file.
        /// </summary>
        /// <param name="type">Type of the resource; may be one of the ResourceType constants or a user-defined type.</param>
        /// <param name="name">Name of the resource. For a numeric resource identifier, prefix the decimal number with a "#".</param>
        /// <param name="locale">Locale of the resource</param>
        /// <param name="data">Raw resource data</param>
        public Resource(ResourceType type, string name, int locale, byte[] data)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            this.type = type;
            this.name = name;
            this.locale = locale;
            this.data = data;
        }
Пример #2
0
 /// <summary>
 /// Creates a new Resource object without any data. The data can be later loaded from a file.
 /// </summary>
 /// <param name="type">Type of the resource; may be one of the ResourceType constants or a user-defined type.</param>
 /// <param name="name">Name of the resource. For a numeric resource identifier, prefix the decimal number with a "#".</param>
 /// <param name="locale">Locale of the resource</param>
 public Resource(ResourceType type, string name, int locale)
     : this(type, name, locale, null)
 {
 }
Пример #3
0
 /// <summary>
 /// Tests whether one resource type equals another.
 /// </summary>
 /// <param name="otherType">Other resource type.</param>
 /// <returns>True if equal, else false.</returns>
 public bool Equals(ResourceType otherType)
 {
     return otherType != null && this.resourceType.Equals(otherType.resourceType, StringComparison.Ordinal);
 }