PropertyWeaver.Execute C# (CSharp) Méthode

Execute() public méthode

public Execute ( ) : void
Résultat void
    public void Execute()
    {
        moduleWeaver.LogDebug("\t\t" + propertyData.PropertyDefinition.Name);
        var property = propertyData.PropertyDefinition;
        setMethodBody = property.SetMethod.Body;
        instructions = property.SetMethod.Body.Instructions;

        var indexes = GetIndexes();
        indexes.Reverse();
        foreach (var index in indexes)
        {
            InjectAtIndex(index);
        }
    }

Usage Example

    void ProcessTypes(List <TypeNode> notifyNodes)
    {
        foreach (var node in notifyNodes)
        {
            if (node.EventInvoker == null)
            {
                continue;
            }
            LogInfo("\t" + node.TypeDefinition.FullName);

            foreach (var propertyData in node.PropertyDatas)
            {
                var body = propertyData.PropertyDefinition.SetMethod.Body;

                var alreadyHasEquality = HasEqualityChecker.AlreadyHasEquality(propertyData.PropertyDefinition, propertyData.BackingFieldReference);

                body.SimplifyMacros();

                body.MakeLastStatementReturn();

                var propertyWeaver = new PropertyWeaver(this, propertyData, node, ModuleDefinition.TypeSystem);
                propertyWeaver.Execute();

                if (!alreadyHasEquality)
                {
                    var equalityCheckWeaver = new EqualityCheckWeaver(propertyData, this);
                    equalityCheckWeaver.Execute();
                }

                body.InitLocals = true;
                body.OptimizeMacros();
            }
            ProcessTypes(node.Nodes);
        }
    }
All Usage Examples Of PropertyWeaver::Execute