AGENT.Contrib.Reflection.Utilities.LoadByType C# (CSharp) Method

LoadByType() public static method

public static LoadByType ( Type type ) : object
type System.Type
return object
        public static object LoadByType(Type type)
        {
            try
            {
                if (type != null)
                {
                    var ctor = type.GetConstructor(new Type[0]);
                    if (ctor != null)
                    {
                        return ctor.Invoke(new object[0]);
                    }
                }
            }
            catch (Exception)
            {
            }

            return null;
        }