/// <summary>Gets a <see cref="IObjectStreamer"/> object with repsect to a specific file extension. /// </summary> /// <param name="fileExtension">The (unique) file extension of the <see cref="IObjectStreamer"/> to search.</param> /// <param name="value">An instance of <see cref="IObjectStreamer"/>, where <see cref="IObjectStreamer.FileExtension"/> equals to /// <paramref name="fileExtension"/> (output).</param> /// <returns>A value indicating whether <paramref name="value"/> contains valid data.</returns> public static bool TryGetObjectStreamerByFileExtension(string fileExtension, out IObjectStreamer value) { string idFileExtension = fileExtension.ToIDString(); foreach (var objectStreamer in sm_Pool.Values) { if (objectStreamer.FileExtension.IDString == idFileExtension) { value = objectStreamer; return(true); } } value = null; return(false); }
/// <summary>Adds a specific <see cref="IObjectStreamer"/>. /// </summary> /// <param name="objectStreamer">The <see cref="IObjectStreamer"/> to add.</param> /// <returns>A value indicating whether <paramref name="objectStreamer"/> has been added.</returns> public static ItemAddedState Add(IObjectStreamer objectStreamer) { return(sm_Pool.Add(objectStreamer)); }
/// <summary>Gets a <see cref="IObjectStreamer"/> object with repsect to a specific name. /// </summary> /// <param name="objectStreamerName">The (unique) name of the <see cref="IObjectStreamer"/> to search.</param> /// <param name="value">An instance of <see cref="IObjectStreamer"/>, where <see cref="IIdentifierNameable.Name"/> equals to /// <paramref name="objectStreamerName"/> (output).</param> /// <returns>A value indicating whether <paramref name="value"/> contains valid data.</returns> public static bool TryGetObjectStreamer(string objectStreamerName, out IObjectStreamer value) { return(sm_Pool.TryGetValue(objectStreamerName, out value)); }