Core/Editor/Constructs/Definition/MethodDefiner.cs
/// <summary>
/// Attempts to create a new method if it does not exist. If it does, it ensures the parameters are the same.
/// </summary>
Attempts to create a new method if it does not exist. If it does, it ensures the parameters are the same.
Attempts to create a new method if it does not exist . If it does it ensures the parameters are the same .
public Method SetMethod(CustomClass instance, MethodDeclaration declaration)
        {
            Method _method = null;
            if (instance != null)
            {
                _method = decorated.overrides.Define(declaration.name, ref _defineAdded,
                (method) =>
                {
                    var newMethod = Method.Create(instance);
                    return newMethod;
                }, null);
                if (_method != null)
                {
                    _method.entry.declaration.Copy(declaration);
                    _method.name = declaration.name;
                    _method.entry.Define();
                    _method.entry.DefineReturns();
                }
            }
            return _method;
        }
public Method SetMethod ( CustomClass instance , MethodDeclaration declaration ) { Method _method = null ; if ( instance != null ) { _method = decorated . overrides . Define ( declaration . name , ref _defineAdded , ( method ) => { var newMethod = Method . Create ( instance ) ; return newMethod ; } , null ) ; if ( _method != null ) { _method . entry . declaration . Copy ( declaration ) ; _method . name = declaration . name ; _method . entry . Define ( ) ; _method . entry . DefineReturns ( ) ; } } return _method ; }
Attempts to create a new method if it does not exist.
Attempts to create a new method if it does not exist .
// If this is an override method we will attempt to create and define the method.
instance
CustomClass
declaration
MethodDeclaration