Пример #1
0
        public static object GetFieldInfoDescription(this FieldInfo fieldInfo)
        {
            var resBuilder = new CompletionTextBuilderWidget();

            resBuilder.AddTextWithColor(fieldInfo.Name, Colors.DarkMagenta);
            resBuilder.AddText(": ");
            resBuilder.AddTextWithColor(fieldInfo.FieldType.Name, Colors.MediumVioletRed);

            resBuilder.AddText("(field)");

            return resBuilder.ResultWidget;
        }
Пример #2
0
        public static object GetMethodInfoParams(this MethodInfo methodInfo)
        {
            var resBuilder = new CompletionTextBuilderWidget();
            var parameters = methodInfo.GetParameters();

            resBuilder.AddTextWithColor(methodInfo.Name, Colors.DarkMagenta);

            resBuilder.AddText("(");
            bool isFirst = true;
            foreach (var parameter in parameters)
            {
                if (!isFirst)
                    resBuilder.AddText(", ");
                else
                    isFirst = false;
                resBuilder.AddTextWithColor(parameter.Name, Colors.DarkSlateGray);
                resBuilder.AddText(": ");
                resBuilder.AddTextWithColor(parameter.ParameterType.Name,
                    Colors.SaddleBrown);
            }
            resBuilder.AddText(")");
            return resBuilder.ResultWidget;
        }