/// <summary> /// Parse event resource. /// </summary> /// <param name="name">Name of the event resource.</param> /// <returns><see cref="EventResource"/> for the name.</returns> public static EventResource Parse(string name) { EventResource eventResource = null; if (name == null || !EVENT_RESOURCES.TryGetValue(name, out eventResource)) { eventResource = new EventResource(name); } return(eventResource); }
/// <summary> /// Determines whether this instance and another specified <see cref="EventResource"/> object have the same value. /// </summary> /// <param name="value">The event resource to compare to this instance.</param> /// <returns>true if the value of the parameter is the same as the value of this instance; otherwise, false. If value is null, the method returns false.</returns> public bool Equals(EventResource value) { if (Object.ReferenceEquals(value, null)) { return(false); } if (Object.ReferenceEquals(this, value)) { return(true); } return(this.Name == value.Name); }
/// <summary> /// Checks and gets resource data. /// </summary> /// <typeparam name="TTeamsData">Type of resource data.</typeparam> /// <param name="eventResource"><see cref="EventResource"/> to be checked.</param> /// <returns>Resource data.</returns> private TTeamsData checkAndGetResourceData <TTeamsData>(EventResource eventResource) where TTeamsData : TeamsData, new() { TTeamsData result; if (this.Resource == eventResource) { result = this.GetResourceData <TTeamsData>(); } else { result = new TTeamsData(); result.HasValues = false; } return(result); }