CheckArgumentsAndReturnType() private static method

private static CheckArgumentsAndReturnType ( object args, MethodInfo method, Type returnType ) : bool
args object
method System.Reflection.MethodInfo
returnType System.Type
return bool
示例#1
0
        private static AssetMoveResult OnWillMoveAsset(string fromPath, string toPath, string[] newPaths, string[] NewMetaPaths)
        {
            AssetMoveResult assetMoveResult = AssetMoveResult.DidNotMove;

            if (!InternalEditorUtility.HasTeamLicense())
            {
                return(assetMoveResult);
            }
            assetMoveResult = AssetModificationHook.OnWillMoveAsset(fromPath, toPath);
            foreach (Type current in AssetModificationProcessorInternal.AssetModificationProcessors)
            {
                MethodInfo method = current.GetMethod("OnWillMoveAsset", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
                if (method != null)
                {
                    AssetModificationProcessorInternal.RequireTeamLicense();
                    object[] array = new object[]
                    {
                        fromPath,
                        toPath
                    };
                    if (AssetModificationProcessorInternal.CheckArgumentsAndReturnType(array, method, assetMoveResult.GetType()))
                    {
                        assetMoveResult |= (AssetMoveResult)((int)method.Invoke(null, array));
                    }
                }
            }
            return(assetMoveResult);
        }
示例#2
0
        private static AssetDeleteResult OnWillDeleteAsset(string assetPath, RemoveAssetOptions options)
        {
            AssetDeleteResult assetDeleteResult = AssetDeleteResult.DidNotDelete;

            if (!InternalEditorUtility.HasTeamLicense())
            {
                return(assetDeleteResult);
            }
            foreach (Type current in AssetModificationProcessorInternal.AssetModificationProcessors)
            {
                MethodInfo method = current.GetMethod("OnWillDeleteAsset", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
                if (method != null)
                {
                    AssetModificationProcessorInternal.RequireTeamLicense();
                    object[] array = new object[]
                    {
                        assetPath,
                        options
                    };
                    if (AssetModificationProcessorInternal.CheckArgumentsAndReturnType(array, method, assetDeleteResult.GetType()))
                    {
                        assetDeleteResult |= (AssetDeleteResult)((int)method.Invoke(null, array));
                    }
                }
            }
            if (assetDeleteResult != AssetDeleteResult.DidNotDelete)
            {
                return(assetDeleteResult);
            }
            assetDeleteResult = AssetModificationHook.OnWillDeleteAsset(assetPath, options);
            return(assetDeleteResult);
        }
示例#3
0
        private static AssetMoveResult OnWillMoveAsset(string fromPath, string toPath, string[] newPaths, string[] NewMetaPaths)
        {
            AssetMoveResult assetMoveResult1 = AssetMoveResult.DidNotMove;

            if (!InternalEditorUtility.HasTeamLicense())
            {
                return(assetMoveResult1);
            }
            AssetMoveResult assetMoveResult2 = AssetModificationHook.OnWillMoveAsset(fromPath, toPath);

            foreach (System.Type modificationProcessor in AssetModificationProcessorInternal.AssetModificationProcessors)
            {
                MethodInfo method = modificationProcessor.GetMethod("OnWillMoveAsset", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
                if (method != null)
                {
                    AssetModificationProcessorInternal.RequireTeamLicense();
                    object[] objArray = new object[2]
                    {
                        (object)fromPath,
                        (object)toPath
                    };
                    if (AssetModificationProcessorInternal.CheckArgumentsAndReturnType(objArray, method, assetMoveResult2.GetType()))
                    {
                        assetMoveResult2 |= (AssetMoveResult)method.Invoke((object)null, objArray);
                    }
                }
            }
            return(assetMoveResult2);
        }
示例#4
0
 internal static void OnStatusUpdated()
 {
     WindowPending.OnStatusUpdated();
     foreach (Type current in AssetModificationProcessorInternal.AssetModificationProcessors)
     {
         MethodInfo method = current.GetMethod("OnStatusUpdated", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
         if (method != null)
         {
             AssetModificationProcessorInternal.RequireTeamLicense();
             object[] array = new object[0];
             if (AssetModificationProcessorInternal.CheckArgumentsAndReturnType(array, method, typeof(void)))
             {
                 method.Invoke(null, array);
             }
         }
     }
 }