Exemplo n.º 1
0
        public static string GetMethodFormatText(MethodInfo methodInfo, out bool displayAttributeUsed)
        {
            string text = "";

            LogicSystemMethodDisplayAttribute[] array = (LogicSystemMethodDisplayAttribute[])methodInfo.GetCustomAttributes(typeof(LogicSystemMethodDisplayAttribute), true);
            if (array.Length != 0)
            {
                text = array[0].FormatText;
                displayAttributeUsed = true;
            }
            else
            {
                ParameterInfo[] parameters = methodInfo.GetParameters();
                if (methodInfo.Name.Length > 3 && methodInfo.Name.Substring(0, 3) == "op_")
                {
                    string str = LogicMethodPropertyInfoUtils.A(methodInfo.Name.Substring(3));
                    if (parameters.Length == 1)
                    {
                        text = "( " + str + " {0} )";
                    }
                    else if (parameters.Length == 2)
                    {
                        text = "( {0} " + str + " {1} )";
                    }
                    else
                    {
                        Log.Fatal("LogicMethodInfoUtils: GetMethodFormatText: parameters.Length != 1 && parameters.Length != 2: not implemented");
                    }
                    displayAttributeUsed = true;
                }
                else
                {
                    text += methodInfo.Name;
                    if (parameters.Length != 0)
                    {
                        text += "( ";
                        for (int i = 0; i < parameters.Length; i++)
                        {
                            if (i != 0)
                            {
                                text += ", ";
                            }
                            text = text + "{" + i.ToString() + "} ";
                        }
                        text += " )";
                    }
                    else
                    {
                        text += "()";
                    }
                    displayAttributeUsed = false;
                }
            }
            return(text);
        }
Exemplo n.º 2
0
        public string GetPropertyFormatText(PropertyInfo propertyInfo, bool ignoreClassName)
        {
            bool   flag;
            string propertyFormatText = LogicMethodPropertyInfoUtils.GetPropertyFormatText(propertyInfo, out flag);

            if (flag)
            {
                return(propertyFormatText);
            }
            if (!ignoreClassName)
            {
                return(this.Name + "." + propertyFormatText);
            }
            return(propertyFormatText);
        }
Exemplo n.º 3
0
        public string GetMethodFormatText(MethodInfo methodInfo, bool ignoreClassName)
        {
            bool   flag;
            string methodFormatText = LogicMethodPropertyInfoUtils.GetMethodFormatText(methodInfo, out flag);

            if (flag)
            {
                return(methodFormatText);
            }
            if (!ignoreClassName)
            {
                return(this.GetDisplayName() + "." + methodFormatText);
            }
            return(methodFormatText);
        }
Exemplo n.º 4
0
        public static string GetMethodDisplayText(MethodInfo methodInfo, out bool displayAttributeUsed)
        {
            string text = "";

            LogicSystemMethodDisplayAttribute[] array = (LogicSystemMethodDisplayAttribute[])methodInfo.GetCustomAttributes(typeof(LogicSystemMethodDisplayAttribute), true);
            if (array.Length != 0)
            {
                text = array[0].DisplayText;
                displayAttributeUsed = true;
            }
            else
            {
                ParameterInfo[] parameters = methodInfo.GetParameters();
                if (methodInfo.Name.Length > 3 && methodInfo.Name.Substring(0, 3) == "op_")
                {
                    string text2 = LogicMethodPropertyInfoUtils.A(methodInfo.Name.Substring(3));
                    if (parameters.Length == 1)
                    {
                        text = text2 + " " + parameters[0].ParameterType.Name;
                    }
                    else if (parameters.Length == 2)
                    {
                        text = string.Concat(new string[]
                        {
                            parameters[0].ParameterType.Name,
                            " ",
                            text2,
                            " ",
                            parameters[1].ParameterType.Name
                        });
                    }
                    else
                    {
                        Log.Fatal("LogicMethodInfoUtils: GetMethodDisplayText: parameters.Length != 1 && parameters.Length != 2: not implemented");
                    }
                    displayAttributeUsed = false;
                }
                else
                {
                    text += methodInfo.Name;
                    if (parameters.Length != 0)
                    {
                        text += "( ";
                        for (int i = 0; i < parameters.Length; i++)
                        {
                            if (i != 0)
                            {
                                text += ", ";
                            }
                            text = text + parameters[i].ParameterType.Name + " " + parameters[i].Name;
                        }
                        text += " )";
                    }
                    else
                    {
                        text += "()";
                    }
                    displayAttributeUsed = false;
                }
            }
            return(text);
        }
Exemplo n.º 5
0
        public static string GetPropertyFormatText(PropertyInfo propertyInfo)
        {
            bool flag;

            return(LogicMethodPropertyInfoUtils.GetPropertyFormatText(propertyInfo, out flag));
        }
Exemplo n.º 6
0
        public static string GetMethodFormatText(MethodInfo methodInfo)
        {
            bool flag;

            return(LogicMethodPropertyInfoUtils.GetMethodFormatText(methodInfo, out flag));
        }