GenericDataPropertyDescriptor.cs :  » Persistence-Frameworks » Data-Holder » DataHolder » Containers » Property » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Persistence Frameworks » Data Holder 
Data Holder » DataHolder » Containers » Property » GenericDataPropertyDescriptor.cs
/*
 * Namespace Summary
 * Copyright (C) 2005+ Bogdan Damian Constantin
 * E-Mail: damianbcpetro@gmail.com
 * WEB: http://www.sourceforge.net/projects/dataholder
 *
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License 2.1 or later, as
 * published by the Free Software Foundation. See the included License.txt
 * or http://www.gnu.org/copyleft/lesser.html for details.
 *
 */


using System;
using System.ComponentModel;
using System.Collections;
using System.Reflection;


namespace DataHolder.Containers.Property{
  /// <summary>
  /// Summary description for GenericDataPropertyDescriptor.
  /// </summary>
  public class GenericDataPropertyDescriptor : PropertyDescriptor
  {
    private PropertyCollection l_propertyCollection;
    private int l_propertyIndex;

    internal GenericDataPropertyDescriptor(PropertyCollection l_propertyCollection, string name, Attribute[] attrs) :base(name, attrs)
    {
      this.l_propertyCollection = l_propertyCollection;
      this.l_propertyIndex = l_propertyCollection.IndexOf(name);
    }

    public override void AddValueChanged(object component, EventHandler handler)
    {
      // TODO:  Add GenericDataPropertyDescriptor.AddValueChanged implementation
      base.AddValueChanged (component, handler);
    }
  
    public override bool CanResetValue(object component)
    {
      // TODO:  Add GenericDataPropertyDescriptor.CanResetValue implementation
      return false;
    }
  
    public override bool Equals(object obj)
    {
      // TODO:  Add GenericDataPropertyDescriptor.Equals implementation
      return base.Equals (obj);
    }
  
    public override PropertyDescriptorCollection GetChildProperties(object instance, Attribute[] filter)
    {
      // TODO:  Add GenericDataPropertyDescriptor.GetChildProperties implementation
      return base.GetChildProperties (instance, filter);
    }
  
    public override object GetEditor(Type editorBaseType)
    {
      // TODO:  Add GenericDataPropertyDescriptor.GetEditor implementation
      return base.GetEditor (editorBaseType);
    }
  
    public override int GetHashCode()
    {
      // TODO:  Add GenericDataPropertyDescriptor.GetHashCode implementation
      return base.GetHashCode ();
    }
  

    public override object GetValue(object component)
    {
      return ((GenericData)component)[l_propertyIndex];
    }
  
    public override void ResetValue(object component)
    {
      throw new NotSupportedException();
    }

    public override void SetValue(object component, object value)
    {
      ((GenericData)component)[l_propertyIndex] = value;
    }

    protected override void OnValueChanged(object component, EventArgs e)
    {
      // TODO:  Add GenericDataPropertyDescriptor.OnValueChanged implementation
      base.OnValueChanged (component, e);
    }
  
    public override void RemoveValueChanged(object component, EventHandler handler)
    {
      // TODO:  Add GenericDataPropertyDescriptor.RemoveValueChanged implementation
      base.RemoveValueChanged (component, handler);
    }
  
    public override bool ShouldSerializeValue(object component)
    {
      return true;
    }
  
    public override Type ComponentType
    {
      get 
      {
        return l_propertyCollection[l_propertyIndex].PropertyType;
      }
    }

    public int PropertyIndex
    {
      get{return l_propertyIndex;}
    }

    public PropertyCollection PropertyCollection
    {
      get{return l_propertyCollection;}
    }
//  
//    public override TypeConverter Converter
//    {
//      get
//      {
//        // TODO:  Add GenericDataPropertyDescriptor.Converter getter implementation
//        return base.Converter;
//      }
//    }
  
    public override bool IsLocalizable
    {
      get
      {
        return false;
      }
    }
  
    public override bool IsReadOnly
    {
      get
      {
        return false;
      }
    }
  
    public override Type PropertyType
    {
      get 
      {
        return l_propertyCollection[l_propertyIndex].PropertyType;
      }
    }
  }
}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.