You are here: PSPad forum > English discussion forum > C# Code Explorer regression

C# Code Explorer regression

#1 C# Code Explorer regression

Posted by: MrData | Date: 02/05/2017 13:42 | IP: IP Logged

Hello,

it seems the Code Explorer for C# at some point lost the ability to "see" Methods / Properties. Right now (tested in 4.6.0 and the newest dev build 4.6.2 (2743)) all ftCSharp is able to see are using directives, namespaces & classes, and regions.

The reason I said "regression" in the subject is that I could've sworn that the Code Explorer found methods in classes too (not sure about properties) in one of the older (4.5.x) builds.

Can somone confirm?

Edited 1 time(s). Last edit at 02/05/2017 13:43 by MrData.

Options: Reply | Quote | Up ^


#2 Re: C# Code Explorer regression

Posted by: pspad | Date: 02/05/2017 16:09 | IP: IP Logged

Plese send me some source sample where the Code explorer works wrong with some description what's wrong.

Options: Reply | Quote | Up ^


#3 Re: C# Code Explorer regression

Posted by: MrData | Date: 02/08/2017 16:55 | IP: IP Logged

image

Does the image sufficiently explain what's missing? Usually the Code Explorer lists methods / functions here, that can be double-clicked to quickly navigate to them (compare for example with "function Main(){ }" in a javascript file...)

Options: Reply | Quote | Up ^


#4 Re: C# Code Explorer regression

Posted by: pspad | Date: 02/08/2017 22:37 | IP: IP Logged

Hello. I asked you about source code, not for picture sad smiley
Spare my time please.

Options: Reply | Quote | Up ^


#5 Re: C# Code Explorer regression

Posted by: MrData | Date: 02/09/2017 16:02 | IP: IP Logged

No problem, here you go (i think your forum software destroys indentation though):


using System;
using System.ComponentModel;
using System.Collections.Generic;

namespace ConsoleApplication1
{
public class Helpers
{
public static IEnumerable<PropertyValue> GetProperties(object o)
{
if (o != null) {
PropertyDescriptorCollection props = TypeDescriptor.GetProperties(o);
foreach (PropertyDescriptor prop in props) {
object val = prop.GetValue(o);
if (val != null) {
yield return new PropertyValue { Name = prop.Name, Value = val };
}
}
}
}

public sealed class PropertyValue
{
public string Name { get; set; }
public object Value { get; set; }
}
}
class Program
{
static void Main(string[] args)
{
var anon=new { Key1="Val1", Key2="Val2", Key3="Val3", Key4="Val4"};

foreach (Helpers.PropertyValue nameValue in Helpers.GetProperties(anon))
{
Console.WriteLine("{0}={1}", nameValue.Name, nameValue.Value);
}

Console.ReadKey();
}
}
}

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2017 Jan Fiala
Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák