Click here to Skip to main content
15,911,141 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Eventing and Memory leaks Pin
Nitin Singh India26-Mar-11 10:11
Nitin Singh India26-Mar-11 10:11 
QuestionListview groups Pin
Herboren1-Feb-11 6:23
Herboren1-Feb-11 6:23 
AnswerRe: Listview groups Pin
Eddy Vluggen1-Feb-11 7:08
professionalEddy Vluggen1-Feb-11 7:08 
Question[Solved] DropDown doesn't drop down [modified] Pin
lukeer1-Feb-11 4:51
lukeer1-Feb-11 4:51 
AnswerRe: DropDown doesn't drop down Pin
Eddy Vluggen1-Feb-11 7:10
professionalEddy Vluggen1-Feb-11 7:10 
GeneralRe: DropDown doesn't drop down Pin
lukeer1-Feb-11 20:47
lukeer1-Feb-11 20:47 
GeneralRe: DropDown doesn't drop down Pin
Eddy Vluggen2-Feb-11 7:03
professionalEddy Vluggen2-Feb-11 7:03 
GeneralRe: DropDown doesn't drop down Pin
lukeer2-Feb-11 20:04
lukeer2-Feb-11 20:04 
Here is my TypeConverter code. As you will see neither GetStandardValuesSupported nor GetStandardValues are overridden yet. Would that be necessary?

public class TranslationTypeConverter : System.ComponentModel.TypeConverter
{
    public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
    {
        if (destinationType.Equals(typeof(string)))
            return (true);

        return base.CanConvertTo(context, destinationType);
    }


    public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
    {
        if (destinationType.Equals(typeof(string)))
        {
            // Get translation talbe name
            //if(_typeToConvert.IsNested)
            Type typeToConvert = context.PropertyDescriptor.PropertyType;
            string tableName = typeToConvert.DeclaringType.FullName;

            // Create resource manager
            System.Resources.ResourceManager rm = new System.Resources.ResourceManager(tableName, typeToConvert.Assembly);

            // Find string
            string key = typeToConvert.Name + "_" + value.ToString();
            string convertedString = rm.GetString(key);

            if (
                convertedString == null
                || convertedString.Length <= 0
            )
                convertedString = value.ToString();

            return (convertedString);
        }

        return base.ConvertTo(context, culture, value, destinationType);
    }


    public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType)
    {
        if (sourceType.Equals(typeof(string)))
            return (true);

        return base.CanConvertFrom(context, sourceType);
    }


    public override object ConvertFrom(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
    {
        // Not implemented yet.
        //  Just use standard values.
        return (base.ConvertFrom(context, culture, value));
    }
}


Ciao,


luker

GeneralRe: DropDown doesn't drop down Pin
Eddy Vluggen3-Feb-11 1:00
professionalEddy Vluggen3-Feb-11 1:00 
GeneralRe: DropDown doesn't drop down Pin
lukeer3-Feb-11 1:39
lukeer3-Feb-11 1:39 
GeneralRe: DropDown doesn't drop down Pin
Eddy Vluggen3-Feb-11 9:26
professionalEddy Vluggen3-Feb-11 9:26 
GeneralRe: DropDown doesn't drop down Pin
lukeer4-Feb-11 0:11
lukeer4-Feb-11 0:11 
QuestionHelp me in VB.NET Recording using DirectSound Pin
Mahdi Mansouri29-Jan-11 19:28
Mahdi Mansouri29-Jan-11 19:28 
AnswerRe: Help me in VB.NET Recording using DirectSound Pin
Henry Minute30-Jan-11 2:45
Henry Minute30-Jan-11 2:45 
QuestionStored procedures using Entity Framework Pin
jonatan_55628-Jan-11 7:45
jonatan_55628-Jan-11 7:45 
AnswerRe: Stored procedures using Entity Framework Pin
Henry Minute28-Jan-11 12:31
Henry Minute28-Jan-11 12:31 
AnswerRe: Stored procedures using Entity Framework Pin
Not Active28-Jan-11 15:44
mentorNot Active28-Jan-11 15:44 
QuestionInstaller: CustomActionData Pin
Archdeacon27-Jan-11 17:03
Archdeacon27-Jan-11 17:03 
QuestionBasic tier object design questions Pin
Jon_Boy27-Jan-11 1:53
Jon_Boy27-Jan-11 1:53 
AnswerRe: Basic tier object design questions Pin
dan!sh 27-Jan-11 6:30
professional dan!sh 27-Jan-11 6:30 
AnswerRe: Basic tier object design questions Pin
Ian Shlasko27-Jan-11 7:29
Ian Shlasko27-Jan-11 7:29 
GeneralRe: Basic tier object design questions Pin
Jon_Boy27-Jan-11 7:48
Jon_Boy27-Jan-11 7:48 
AnswerRe: Basic tier object design questions Pin
TheGreatAndPowerfulOz27-Jan-11 11:54
TheGreatAndPowerfulOz27-Jan-11 11:54 
QuestionGDI+ scene graph, retrieve absolute transform from local transform Pin
norrisMiou26-Jan-11 16:49
norrisMiou26-Jan-11 16:49 
AnswerRe: GDI+ scene graph, retrieve absolute transform from local transform Pin
Luc Pattyn26-Jan-11 17:04
sitebuilderLuc Pattyn26-Jan-11 17:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.