Permalink
Browse files

Simplify/fix install process, format fixes

  • Loading branch information...
lmontoute committed Jan 8, 2019
1 parent 8d11812 commit 02fcdbcfa6cd3d9159953a2f6663a891733bbace
@@ -1,7 +1,8 @@
{
"csharpfixformat.style.braces.allowInlines": false,
"csharpfixformat.style.newline.atEnd": true,
"csharpfixformat.style.newline.elseCatch": true,
"csharpfixformat.style.spaces.beforeParenthesis": false,
"csharpfixformat.style.braces.onSameLine": false
}
"csharpfixformat.style.braces.allowInlines": false,
"csharpfixformat.style.newline.atEnd": true,
"csharpfixformat.style.newline.elseCatch": true,
"csharpfixformat.style.spaces.beforeParenthesis": false,
"csharpfixformat.style.spaces.afterParenthesis": true,
"csharpfixformat.style.braces.onSameLine": false
}
@@ -69,7 +69,7 @@ protected override sealed VFXExpression[] BuildExpression(VFXExpression[] inputE
new VFXTexture2DValue(FluvioSolverData ? FluvioSolverData : null),
new VFXExpressionCombine(new []
{
VFXValue.Constant((float)(FluvioSolverData? FluvioSolverData.width : 0)), VFXValue.Constant((float)(FluvioSolverData ? FluvioSolverData.height : 0))
VFXValue.Constant((float) (FluvioSolverData? FluvioSolverData.width : 0)), VFXValue.Constant((float) (FluvioSolverData ? FluvioSolverData.height : 0))
}),
};
}
@@ -49,20 +49,23 @@ static ReflectionHelpers()
}
else if (assembly.FullName.StartsWith("UnityEditor"))
{
// HACK
if (type.Name == "CSharpNamespaceParser") continue;

_editorTypeMap[type.Name] = type;
}
}
}
internal static T Cast<T>(this object obj)
{
if (obj == null)throw new ArgumentNullException("obj");
if (obj == null) throw new ArgumentNullException("obj");
var type = typeof(T);
return (T)Cast(obj, type);
return (T) Cast(obj, type);
}
internal static object Cast(this object obj, Type type)
{
if (obj == null)throw new ArgumentNullException("obj");
if (type == null)throw new ArgumentNullException("type");
if (obj == null) throw new ArgumentNullException("obj");
if (type == null) throw new ArgumentNullException("type");
if (type.IsEnum)
{
return Enum.ToObject(type, obj);
@@ -75,7 +78,7 @@ internal static object Cast(this object obj, Type type)
}
internal static Type GetEditorType(string typeName)
{
if (typeName == null)throw new ArgumentNullException("typeName");
if (typeName == null) throw new ArgumentNullException("typeName");

Type type;
if (_editorTypeMap.TryGetValue(typeName, out type))
@@ -88,8 +91,8 @@ internal static Type GetEditorType(string typeName)
}
internal static FieldInfo GetField(this object obj, string fieldName)
{
if (obj == null)throw new ArgumentNullException("obj");
if (fieldName == null)throw new ArgumentNullException("fieldName");
if (obj == null) throw new ArgumentNullException("obj");
if (fieldName == null) throw new ArgumentNullException("fieldName");

var t = obj.GetType();

@@ -99,16 +102,16 @@ internal static FieldInfo GetField(this object obj, string fieldName)
BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic |
BindingFlags.Public);

if (candidate != null)return candidate;
if (candidate != null) return candidate;
t = t.BaseType;
}
return null;

}
internal static Type GetFieldType(this Type type, string fieldName)
{
if (type == null)throw new ArgumentNullException("type");
if (fieldName == null)throw new ArgumentNullException("fieldName");
if (type == null) throw new ArgumentNullException("type");
if (fieldName == null) throw new ArgumentNullException("fieldName");

var t = type;

@@ -118,45 +121,45 @@ internal static Type GetFieldType(this Type type, string fieldName)
BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic |
BindingFlags.Public);

if (candidate != null)return candidate.FieldType;
if (candidate != null) return candidate.FieldType;
t = t.BaseType;
}
return null;
}
internal static Type GetFieldType(this object obj, string fieldName)
{
if (obj == null)throw new ArgumentNullException("obj");
if (fieldName == null)throw new ArgumentNullException("fieldName");
if (obj == null) throw new ArgumentNullException("obj");
if (fieldName == null) throw new ArgumentNullException("fieldName");
return GetFieldType(obj.GetType(), fieldName);
}
internal static object GetFieldValue(this Type type, string fieldName)
{
if (type == null)throw new ArgumentNullException("type");
if (fieldName == null)throw new ArgumentNullException("fieldName");
if (type == null) throw new ArgumentNullException("type");
if (fieldName == null) throw new ArgumentNullException("fieldName");
return GetFieldValue<object>(type, null, fieldName);
}
internal static T GetFieldValue<T>(this Type type, string fieldName)
{
if (type == null)throw new ArgumentNullException("type");
if (fieldName == null)throw new ArgumentNullException("fieldName");
if (type == null) throw new ArgumentNullException("type");
if (fieldName == null) throw new ArgumentNullException("fieldName");
return GetFieldValue<T>(type, null, fieldName);
}
internal static object GetFieldValue(this object obj, string fieldName)
{
if (obj == null)throw new ArgumentNullException("obj");
if (fieldName == null)throw new ArgumentNullException("fieldName");
if (obj == null) throw new ArgumentNullException("obj");
if (fieldName == null) throw new ArgumentNullException("fieldName");
return GetFieldValue<object>(obj.GetType(), obj, fieldName);
}
internal static T GetFieldValue<T>(this object obj, string fieldName)
{
if (obj == null)throw new ArgumentNullException("obj");
if (fieldName == null)throw new ArgumentNullException("fieldName");
if (obj == null) throw new ArgumentNullException("obj");
if (fieldName == null) throw new ArgumentNullException("fieldName");
return GetFieldValue<T>(obj.GetType(), obj, fieldName);
}
internal static MethodInfo GetMethod(this object obj, string methodName)
{
if (obj == null)throw new ArgumentNullException("obj");
if (methodName == null)throw new ArgumentNullException("methodName");
if (obj == null) throw new ArgumentNullException("obj");
if (methodName == null) throw new ArgumentNullException("methodName");

var t = obj.GetType();

@@ -166,16 +169,16 @@ internal static MethodInfo GetMethod(this object obj, string methodName)
BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic |
BindingFlags.Public);

if (candidate != null)return candidate;
if (candidate != null) return candidate;
t = t.BaseType;
}

return null;
}
internal static PropertyInfo GetProperty(this object obj, string propertyName)
{
if (obj == null)throw new ArgumentNullException("obj");
if (propertyName == null)throw new ArgumentNullException("propertyName");
if (obj == null) throw new ArgumentNullException("obj");
if (propertyName == null) throw new ArgumentNullException("propertyName");

var t = obj.GetType();

@@ -185,15 +188,15 @@ internal static PropertyInfo GetProperty(this object obj, string propertyName)
BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic |
BindingFlags.Public);

if (candidate != null)return candidate;
if (candidate != null) return candidate;
t = t.BaseType;
}
return null;
}
internal static Type GetPropertyType(this Type type, string propertyName)
{
if (type == null)throw new ArgumentNullException("type");
if (propertyName == null)throw new ArgumentNullException("propertyName");
if (type == null) throw new ArgumentNullException("type");
if (propertyName == null) throw new ArgumentNullException("propertyName");

var t = type;

@@ -203,15 +206,15 @@ internal static Type GetPropertyType(this Type type, string propertyName)
BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic |
BindingFlags.Public);

if (candidate != null)return candidate.PropertyType;
if (candidate != null) return candidate.PropertyType;
t = t.BaseType;
}
return null;
}
internal static Type GetPropertyType(this object obj, string propertyName)
{
if (obj == null)throw new ArgumentNullException("obj");
if (propertyName == null)throw new ArgumentNullException("propertyName");
if (obj == null) throw new ArgumentNullException("obj");
if (propertyName == null) throw new ArgumentNullException("propertyName");
return GetPropertyType(obj.GetType(), propertyName);
}
internal static int GetLength(this object obj)
@@ -220,31 +223,31 @@ internal static int GetLength(this object obj)
}
internal static object GetPropertyValue(this Type type, string propertyName)
{
if (type == null)throw new ArgumentNullException("type");
if (propertyName == null)throw new ArgumentNullException("propertyName");
if (type == null) throw new ArgumentNullException("type");
if (propertyName == null) throw new ArgumentNullException("propertyName");
return GetPropertyValue<object>(type, null, propertyName);
}
internal static T GetPropertyValue<T>(this Type type, string propertyName)
{
if (type == null)throw new ArgumentNullException("type");
if (propertyName == null)throw new ArgumentNullException("propertyName");
if (type == null) throw new ArgumentNullException("type");
if (propertyName == null) throw new ArgumentNullException("propertyName");
return GetPropertyValue<T>(type, null, propertyName);
}
internal static object GetPropertyValue(this object obj, string propertyName)
{
if (obj == null)throw new ArgumentNullException("obj");
if (propertyName == null)throw new ArgumentNullException("propertyName");
if (obj == null) throw new ArgumentNullException("obj");
if (propertyName == null) throw new ArgumentNullException("propertyName");
return GetPropertyValue<object>(obj.GetType(), obj, propertyName);
}
internal static T GetPropertyValue<T>(this object obj, string propertyName)
{
if (obj == null)throw new ArgumentNullException("obj");
if (propertyName == null)throw new ArgumentNullException("propertyName");
if (obj == null) throw new ArgumentNullException("obj");
if (propertyName == null) throw new ArgumentNullException("propertyName");
return GetPropertyValue<T>(obj.GetType(), obj, propertyName);
}
internal static Type GetRuntimeType(string typeName)
{
if (typeName == null)throw new ArgumentNullException("typeName");
if (typeName == null) throw new ArgumentNullException("typeName");

Type type;
if (_runtimeTypeMap.TryGetValue(typeName, out type))
@@ -257,69 +260,69 @@ internal static Type GetRuntimeType(string typeName)
}
internal static Type GetTypeInAssembly(this Type type, string typeName)
{
if (type == null)throw new ArgumentNullException("type");
if (typeName == null)throw new ArgumentNullException("typeName");
if (type == null) throw new ArgumentNullException("type");
if (typeName == null) throw new ArgumentNullException("typeName");
return type.Assembly.GetType(typeName);
}
internal static object Invoke(this Type type, string methodName, params Parameter[] parameters)
{
if (type == null)throw new ArgumentNullException("type");
if (methodName == null)throw new ArgumentNullException("methodName");
if (type == null) throw new ArgumentNullException("type");
if (methodName == null) throw new ArgumentNullException("methodName");
return Invoke<object>(type, null, methodName, parameters);
}
internal static T Invoke<T>(this Type type, string methodName, params Parameter[] parameters)
{
if (type == null)throw new ArgumentNullException("type");
if (methodName == null)throw new ArgumentNullException("methodName");
if (type == null) throw new ArgumentNullException("type");
if (methodName == null) throw new ArgumentNullException("methodName");
return Invoke<T>(type, null, methodName, parameters);
}
internal static object Invoke(this object obj, string methodName, params Parameter[] parameters)
{
if (obj == null)throw new ArgumentNullException("obj");
if (methodName == null)throw new ArgumentNullException("methodName");
if (obj == null) throw new ArgumentNullException("obj");
if (methodName == null) throw new ArgumentNullException("methodName");
return Invoke<object>(obj.GetType(), obj, methodName, parameters);
}
internal static T Invoke<T>(this object obj, string methodName, params Parameter[] parameters)
{
if (obj == null)throw new ArgumentNullException("obj");
if (methodName == null)throw new ArgumentNullException("methodName");
if (obj == null) throw new ArgumentNullException("obj");
if (methodName == null) throw new ArgumentNullException("methodName");
return Invoke<T>(obj.GetType(), obj, methodName, parameters);
}
internal static Type NestedType(this Type type, string typeName)
{
if (type == null)throw new ArgumentNullException("type");
if (typeName == null)throw new ArgumentNullException("typeName");
if (type == null) throw new ArgumentNullException("type");
if (typeName == null) throw new ArgumentNullException("typeName");
return type.GetNestedType(typeName,
BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic |
BindingFlags.Public);
}
internal static Parameter Param(this object obj)
{
if (obj == null)throw new ArgumentNullException("obj");
if (obj == null) throw new ArgumentNullException("obj");
return new Parameter(obj);
}
internal static void SetFieldValue(this Type type, string fieldName, object value)
{
if (type == null)throw new ArgumentNullException("type");
if (fieldName == null)throw new ArgumentNullException("fieldName");
if (type == null) throw new ArgumentNullException("type");
if (fieldName == null) throw new ArgumentNullException("fieldName");
SetFieldValue(type, null, fieldName, value);
}
internal static void SetFieldValue(this object obj, string fieldName, object value)
{
if (obj == null)throw new ArgumentNullException("obj");
if (fieldName == null)throw new ArgumentNullException("fieldName");
if (obj == null) throw new ArgumentNullException("obj");
if (fieldName == null) throw new ArgumentNullException("fieldName");
SetFieldValue(obj.GetType(), obj, fieldName, value);
}
internal static void SetPropertyValue(this Type type, string propertyName, object value)
{
if (type == null)throw new ArgumentNullException("type");
if (propertyName == null)throw new ArgumentNullException("propertyName");
if (type == null) throw new ArgumentNullException("type");
if (propertyName == null) throw new ArgumentNullException("propertyName");
SetPropertyValue(type, null, propertyName, value);
}
internal static void SetPropertyValue(this object obj, string propertyName, object value)
{
if (obj == null)throw new ArgumentNullException("obj");
if (propertyName == null)throw new ArgumentNullException("propertyName");
if (obj == null) throw new ArgumentNullException("obj");
if (propertyName == null) throw new ArgumentNullException("propertyName");
SetPropertyValue(obj.GetType(), obj, propertyName, value);
}
internal static object Create(this Type type, params Parameter[] parameters)
@@ -328,7 +331,7 @@ internal static object Create(this Type type, params Parameter[] parameters)
}
internal static T Create<T>(this Type type, params Parameter[] parameters)
{
if (type == null)throw new ArgumentNullException("type");
if (type == null) throw new ArgumentNullException("type");
return (T)
type.GetConstructor(
BindingFlags.Static | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null,
@@ -345,7 +348,7 @@ static T GetFieldValue<T>(Type type, object obj, string fieldName)
BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic |
BindingFlags.Public);

if (candidate != null)return (T)candidate.GetValue(obj);
if (candidate != null) return (T) candidate.GetValue(obj);
t = t.BaseType;
}
return default(T);
@@ -360,7 +363,7 @@ static T GetPropertyValue<T>(Type type, object obj, string propertyName)
BindingFlags.Static | BindingFlags.Instance | BindingFlags.NonPublic |
BindingFlags.Public);

if (candidate != null)return (T)candidate.GetValue(obj, null);
if (candidate != null) return (T) candidate.GetValue(obj, null);
t = t.BaseType;
}

@@ -377,7 +380,7 @@ static T Invoke<T>(Type type, object obj, string methodName, params Parameter[]
BindingFlags.Public, null, parameters.Select(p => p.parameterType).ToArray(),
null);

if (candidate != null)return (T)candidate.Invoke(obj, parameters.Select(p => p.obj).ToArray());
if (candidate != null) return (T) candidate.Invoke(obj, parameters.Select(p => p.obj).ToArray());
t = t.BaseType;
}

Oops, something went wrong.

0 comments on commit 02fcdbc

Please sign in to comment.