Exemple #1
0
        public static string GetPropertyRef(IMember property, IEmitter emitter, bool isSetter = false, bool noOverload = false, bool ignoreInterface = false, bool withoutTypeParams = false, bool skipPrefix = false)
        {
            var attrName = emitter.GetEntityNameFromAttr(property, isSetter);

            if (!string.IsNullOrEmpty(attrName))
            {
                return(Helpers.AddInterfacePrefix(property, emitter, ignoreInterface, attrName, isSetter));
            }

            string name            = null;
            bool   isFieldProperty = Helpers.IsFieldProperty(property, emitter);

            if (isFieldProperty)
            {
                return(emitter.GetEntityName(property, false, ignoreInterface));
            }

            if (!noOverload)
            {
                var overloads = OverloadsCollection.Create(emitter, property, isSetter);
                return(overloads.GetOverloadName(ignoreInterface, skipPrefix ? null : GetSetOrGet(isSetter), withoutTypeParams));
            }

            name = emitter.GetEntityName(property, true, ignoreInterface);
            return(skipPrefix ? name : GetSetOrGet(isSetter, name));
        }
Exemple #2
0
        public static string GetIndexerRef(IMember property, IEmitter emitter, bool isSetter = false, bool noOverload = false, bool ignoreInterface = false)
        {
            var attrName = emitter.GetEntityNameFromAttr(property, isSetter);

            if (!string.IsNullOrEmpty(attrName))
            {
                return(Helpers.AddInterfacePrefix(property, emitter, ignoreInterface, attrName, isSetter));
            }

            if (!noOverload)
            {
                var overloads = OverloadsCollection.Create(emitter, property, isSetter);
                return(overloads.GetOverloadName(ignoreInterface, GetSetOrGet(isSetter)));
            }

            var name = emitter.GetEntityName(property, true, ignoreInterface);

            return(GetSetOrGet(isSetter, name));
        }
Exemple #3
0
        public static string GetEventRef(IMember property, IEmitter emitter, bool remove = false, bool noOverload = false, bool ignoreInterface = false, bool withoutTypeParams = false, bool skipPrefix = false)
        {
            var attrName = emitter.GetEntityNameFromAttr(property, remove);

            if (!string.IsNullOrEmpty(attrName))
            {
                return(Helpers.AddInterfacePrefix(property, emitter, ignoreInterface, attrName, remove));
            }

            if (!noOverload)
            {
                var overloads = OverloadsCollection.Create(emitter, property, remove);
                return(overloads.GetOverloadName(ignoreInterface, skipPrefix ? null : GetAddOrRemove(!remove), withoutTypeParams));
            }

            var name = emitter.GetEntityName(property, true, ignoreInterface);

            return(skipPrefix ? name : GetAddOrRemove(!remove, name));
        }