コード例 #1
0
 void ProcessPotentialName(ProcessedFieldInfo processedField)
 {
     if (RestrictedObjSelectors.IsImportantSelector(processedField.GetterName) || RestrictedObjSelectors.IsImportantSelector(processedField.SetterName))
     {
         string newName = "managed" + processedField.Name.PascalCase();
         Delayed.Add(ErrorHelper.CreateWarning(1051, $"Element {processedField.Name} is generated instead as {newName} because its name conflicts with an important objective-c selector."));
         processedField.NameOverride = newName;
     }
 }
コード例 #2
0
        void ProcessPotentialName(ProcessedProperty processedProperty)
        {
            string getSignature = processedProperty.HasGetter ? processedProperty.GetMethod.ObjCSignature : "";
            string setSignature = processedProperty.HasSetter ? processedProperty.SetMethod.ObjCSignature : "";

            if (RestrictedObjSelectors.IsImportantSelector(getSignature) || RestrictedObjSelectors.IsImportantSelector(setSignature))
            {
                string newName = "managed" + processedProperty.Name.PascalCase();
                Delayed.Add(ErrorHelper.CreateWarning(1051, $"Element {processedProperty.Name} is generated instead as {newName} because its name conflicts with an important objective-c selector."));
                processedProperty.NameOverride = newName;
            }
        }
コード例 #3
0
        void ProcessPotentialName(ProcessedMethod processedMethod)
        {
            MethodInfo method = processedMethod.Method;

            if (IsOperatorOrFriendlyVersion(method))
            {
                string nameOverride = OperatorOverloads.GetObjCName(processedMethod.Method.Name, processedMethod.Method.GetParameters().Length);
                if (nameOverride != null)
                {
                    processedMethod.NameOverride = nameOverride;
                }
            }

            string objCSignature = processedMethod.ObjCSignature;

            if (RestrictedObjSelectors.IsImportantSelector(objCSignature))
            {
                string newName = "managed" + method.Name.PascalCase();
                processedMethod.NameOverride = newName;
                Delayed.Add(ErrorHelper.CreateWarning(1051, $"Element {method.Name} is generated instead as {newName} because its name conflicts with an important objective-c selector."));
            }
        }