private static void ProcessRule()

in SharpGen/Model/CppElement.Extensions.cs [97:155]


        private static void ProcessRule(CppElement element, MappingRule newRule, Regex patchRegex)
        {
            var tag = element.Rule;

            if (newRule.Assembly != null) tag.Assembly = newRule.Assembly;
            if (newRule.Namespace != null) tag.Namespace = newRule.Namespace;
            if (newRule.DefaultValue != null) tag.DefaultValue = newRule.DefaultValue;
            if (newRule.MethodCheckReturnType.HasValue) tag.MethodCheckReturnType = newRule.MethodCheckReturnType;
            if (newRule.AlwaysReturnHResult.HasValue) tag.AlwaysReturnHResult = newRule.AlwaysReturnHResult;
            if (newRule.RawPtr.HasValue) tag.RawPtr = newRule.RawPtr;
            if (newRule.Visibility.HasValue) tag.Visibility = newRule.Visibility;
            if (newRule.NativeCallbackVisibility.HasValue)
                tag.NativeCallbackVisibility = newRule.NativeCallbackVisibility;
            if (newRule.ShadowVisibility.HasValue)
                tag.ShadowVisibility = newRule.ShadowVisibility;
            if (newRule.VtblVisibility.HasValue)
                tag.VtblVisibility = newRule.VtblVisibility;
            if (newRule.NativeCallbackName != null)
                tag.NativeCallbackName = RegexRename(patchRegex, element.FullName, newRule.NativeCallbackName);
            if (newRule.Property.HasValue) tag.Property = newRule.Property;
            if (newRule.CustomVtbl.HasValue) tag.CustomVtbl = newRule.CustomVtbl;
            if (newRule.Persist.HasValue) tag.Persist = newRule.Persist;
            if (newRule.MappingName != null)
                tag.MappingName = RegexRename(patchRegex, element.FullName, newRule.MappingName);
            if (newRule.NamingFlags.HasValue) tag.NamingFlags = newRule.NamingFlags.Value;
            if (newRule.IsFinalMappingName != null) tag.IsFinalMappingName = newRule.IsFinalMappingName;
            if (newRule.StructPack != null) tag.StructPack = newRule.StructPack;
            if (newRule.StructHasNativeValueType != null)
                tag.StructHasNativeValueType = newRule.StructHasNativeValueType;
            if (newRule.StructToClass != null) tag.StructToClass = newRule.StructToClass;
            if (newRule.StructCustomMarshal != null) tag.StructCustomMarshal = newRule.StructCustomMarshal;
            if (newRule.StructCustomNew != null) tag.StructCustomNew = newRule.StructCustomNew;
            if (newRule.IsStaticMarshal != null) tag.IsStaticMarshal = newRule.IsStaticMarshal;
            if (newRule.MappingType != null)
                tag.MappingType = RegexRename(patchRegex, element.FullName, newRule.MappingType);
            if (newRule.OverrideNativeType != null) tag.OverrideNativeType = newRule.OverrideNativeType;
            if (newRule.Pointer is { } pointer) tag.Pointer = pointer;
            if (newRule.TypeArrayDimension is { } arrayDimension) tag.TypeArrayDimension = arrayDimension;
            if (newRule.EnumHasFlags != null) tag.EnumHasFlags = newRule.EnumHasFlags;
            if (newRule.EnumHasNone != null) tag.EnumHasNone = newRule.EnumHasNone;
            if (newRule.IsCallbackInterface != null) tag.IsCallbackInterface = newRule.IsCallbackInterface;
            if (newRule.IsDualCallbackInterface != null) tag.IsDualCallbackInterface = newRule.IsDualCallbackInterface;
            if (newRule.AutoGenerateShadow != null) tag.AutoGenerateShadow = newRule.AutoGenerateShadow;
            if (newRule.AutoGenerateVtbl != null) tag.AutoGenerateVtbl = newRule.AutoGenerateVtbl;
            if (newRule.StaticShadowVtbl != null) tag.StaticShadowVtbl = newRule.StaticShadowVtbl;
            if (newRule.ShadowName != null)
                tag.ShadowName = RegexRename(patchRegex, element.FullName, newRule.ShadowName);
            if (newRule.VtblName != null) tag.VtblName = RegexRename(patchRegex, element.FullName, newRule.VtblName);
            if (newRule.IsKeepImplementPublic != null) tag.IsKeepImplementPublic = newRule.IsKeepImplementPublic;
            if (newRule.FunctionDllName != null)
                tag.FunctionDllName = RegexRename(patchRegex, element.FullName, newRule.FunctionDllName);
            if (newRule.Group != null) tag.Group = newRule.Group;
            if (newRule.ParameterAttribute is { } paramAttributeValue) tag.ParameterAttribute = paramAttributeValue;
            if (newRule.ParameterUsedAsReturnType != null)
                tag.ParameterUsedAsReturnType = newRule.ParameterUsedAsReturnType;
            if (newRule.Relation != null) tag.Relation = newRule.Relation;
            if (newRule.Hidden != null) tag.Hidden = newRule.Hidden;
            if (newRule.KeepPointers != null) tag.KeepPointers = newRule.KeepPointers;
        }