GetName() 공개 정적인 메소드

public static GetName ( IEventReference value ) : string
value IEventReference
리턴 string
예제 #1
0
        public static string GetResolutionScope(ITypeReference value)
        {
            IModule module = value.Owner as IModule;

            if (module != null)
            {
                return(value.Namespace);
            }

            ITypeDeclaration declaringType = value.Owner as ITypeDeclaration;

            if (declaringType != null)
            {
                return(Helper.GetResolutionScope(declaringType) + "+" + Helper.GetName(declaringType));
            }

            throw new NotSupportedException();
        }
예제 #2
0
        public static string GetNameWithResolutionScope(ITypeReference value)
        {
            if (value != null)
            {
                ITypeReference declaringType = value.Owner as ITypeReference;
                if (declaringType != null)
                {
                    return(Helper.GetNameWithResolutionScope(declaringType) + "+" + Helper.GetName(value));
                }

                string namespaceName = value.Namespace;
                if (namespaceName.Length == 0)
                {
                    return(Helper.GetName(value));
                }

                return(namespaceName + "." + Helper.GetName(value));
            }

            throw new NotSupportedException();
        }
예제 #3
0
        public static string GetNameWithParameterList(IMethodReference value)
        {
            using (StringWriter writer = new StringWriter(CultureInfo.InvariantCulture))
            {
                writer.Write(Helper.GetName(value));
                writer.Write("(");

                IParameterDeclarationCollection parameters = value.Parameters;
                for (int i = 0; i < parameters.Count; i++)
                {
                    if (i != 0)
                    {
                        writer.Write(", ");
                    }

                    writer.Write(parameters[i].ParameterType.ToString());
                }

                if (value.CallingConvention == MethodCallingConvention.VariableArguments)
                {
                    if (value.Parameters.Count > 0)
                    {
                        writer.Write(", ");
                    }

                    writer.Write("...");
                }

                writer.Write(")");

                if ((value.Name != ".ctor") && (value.Name != ".cctor"))
                {
                    writer.Write(" : ");
                    writer.Write(value.ReturnType.Type.ToString());
                }

                return(writer.ToString());
            }
        }
예제 #4
0
 public static string GetNameWithDeclaringType(IEventReference value)
 {
     return(Helper.GetNameWithResolutionScope(value.DeclaringType as ITypeReference) + "." + Helper.GetName(value));
 }