Beispiel #1
0
        /// <summary>
        /// Default Constructor that initializes this entity
        /// </summary>
        public InpEntity()
        {
            ID = Guid.NewGuid();
            var resources = new InpResourceManager();

            Name = Description = Tag = resources.GetString("DefaultProperty", CultureInfo.CurrentCulture);
        }
Beispiel #2
0
        /// <summary>
        /// Create a new <see cref="InpParseException"/> with the default Culture appropriate message
        /// </summary>
        /// <param name="type">The type where the exception occurred</param>
        /// <returns>Returns: an <see cref="InpParseException"/> with the default message set</returns>
        internal static InpParseException CreateWithStandardMessage(Type type)
        {
            try
            {
                // Get the message from the resource manager
                var message = new InpResourceManager().GetString("InpParseException.DefaultMessage", CultureInfo.CurrentCulture);

                // Return a new inp parse exception
                return new InpParseException(message + type?.FullName);
            }
            catch(MissingManifestResourceException)
            {
                return new InpParseException();
            }
            catch(InvalidOperationException)
            {
                return new InpParseException();
            }
            catch (MissingSatelliteAssemblyException)
            {
                return new InpParseException();
            }
        }
Beispiel #3
0
        /// <summary>
        /// Create a new <see cref="InpParseException"/> with the default Culture appropriate message 
        /// and include the inner <see cref="Exception"/>
        /// </summary>
        /// <param name="type">The type where the exception occurred</param>
        /// <param name="inner">The inner Exception</param>
        /// <returns>Returns: A new <see cref="InpParseException"/></returns>
        internal static InpParseException CreateWithStandardMessage(Type type, Exception inner)
        {
            try
            {
                // Get message from the resource manager
                var message = new InpResourceManager().GetString("InpParseException.DefaultMessage", CultureInfo.CurrentCulture);

                // Return the exception and set the message and the inner exception
                return new InpParseException(message + type?.FullName, inner);
            }
            // Catch any other exceptions that could occur because of the above
            catch (MissingManifestResourceException)
            {
                return new InpParseException();
            }
            catch (InvalidOperationException)
            {
                return new InpParseException();
            }
            catch (MissingSatelliteAssemblyException)
            {
                return new InpParseException();
            }
        }