Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > .NET
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #3  
Antiguo 18-09-2007
Avatar de Crandel
[Crandel] Crandel is offline
Miembro Premium
 
Registrado: may 2003
Ubicación: Parana, Argentina
Posts: 1.475
Poder: 25
Crandel Va por buen camino
Hola Hector,

no consegui mucha info, pero en la pagina de MS sobre la clase System.ComponentModel.Design.Serialization.InstanceDescriptor daba un poco de info:

escribi el ejemplo que daban con pequeñas modificaciones y funciono. Aca dejo el código por si alguien tiene el mismo problema:
Código PHP:
 [TypeConverter(typeof(PlotLabConverter))]
    public class 
MyScopeClass Scope
    
{

        
internal class PlotLabConverter TypeConverter
        
{
            
// This method overrides CanConvertTo from TypeConverter. This is called when someone
            //  wants to convert an instance of Triangle to another type.  Here,
            //  only conversion to an InstanceDescriptor is supported.
            
public override bool CanConvertTo(ITypeDescriptorContext contextType destinationType)
            {
                if (
destinationType == typeof(InstanceDescriptor))
                {
                    return 
true;
                }

                
// Always call the base to see if it can perform the conversion.
                
return base.CanConvertTo(contextdestinationType);
            }

            
// This code performs the actual conversion from a Triangle to an InstanceDescriptor.
            
public override object ConvertTo(ITypeDescriptorContext contextCultureInfo cultureobject valueType destinationType)
            {
                if (
destinationType == typeof(InstanceDescriptor))
                {
                    
ConstructorInfo ci typeof(MyScopeClass).GetConstructor(new Type[]{});
                    return new 
InstanceDescriptor(ci, new object[]{});
                }

                
// Always call base, even if you can't convert.
                
return base.ConvertTo(contextculturevaluedestinationType);
            }
        }
    } 
__________________
[Crandel]
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Error Abstract Error y Access violation zvf OOP 33 08-09-2010 18:50:33
'DBX Error: No Mapping for Error Code Found' CHECHE81 Conexión con bases de datos 1 09-06-2010 02:11:35
Error 10093 al ver un informe - Que error es este? URBANO Impresión 1 03-02-2006 18:44:39
¿Por qué me da este error?Error creating cursor manejador nuri SQL 2 01-08-2005 17:30:28
Error: RichEdit line insertation error DarkByte Varios 3 19-07-2004 12:28:09


La franja horaria es GMT +2. Ahora son las 22:40:44.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi