Click here to Skip to main content
15,921,530 members
Home / Discussions / C#
   

C#

 
AnswerRecursion = BAD to find an XML element Pin
Steven D. Foster31-Dec-08 4:45
Steven D. Foster31-Dec-08 4:45 
QuestionHow do i go about this... do i create a DataBind / DataSet ??? [modified] Pin
cobalt-rose30-Dec-08 12:02
cobalt-rose30-Dec-08 12:02 
AnswerRe: How do i go about this... do i create a DataBind / DataSet ??? Pin
Not Active30-Dec-08 13:23
mentorNot Active30-Dec-08 13:23 
AnswerRe: How do i go about this... do i create a DataBind / DataSet ??? Pin
Mycroft Holmes30-Dec-08 14:45
professionalMycroft Holmes30-Dec-08 14:45 
GeneralRe: How do i go about this... do i create a DataBind / DataSet ??? Pin
cobalt-rose1-Jan-09 13:25
cobalt-rose1-Jan-09 13:25 
QuestionApp.config Pin
s196675m30-Dec-08 11:34
s196675m30-Dec-08 11:34 
AnswerRe: App.config Pin
vaghelabhavesh30-Dec-08 13:08
vaghelabhavesh30-Dec-08 13:08 
QuestionDesign time collection problem Pin
kanchoette30-Dec-08 10:16
kanchoette30-Dec-08 10:16 
I am attempting to write my first custom component which requires a custom collection.

So far I have:

using System;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.ComponentModel.Design;
using System.Drawing.Design;

namespace MultiColumnComboBox
{
    public partial class MultiColumnComboBox : ComboBox
    {
        
        
        public MultiColumnComboBox()
        {
            InitializeComponent();
        }

             
    }

    [Editor(typeof(ColumnCollectionEditor),UITypeEditor)]
        public ColumnCollection Columns
        {
            get { return Columns; }
            set { Columns = value; }
        }

    
    
    public class Column
    {
        #region private variables
        
        private bool _autoColumnWidth = false;
        
        #endregion

        #region public properties
        
        public bool AutoColumnWidth
        {
            get { return _autoColumnWidth; }
            set { _autoColumnWidth = value; }
        }
        
        #endregion
        
        
    }

    public class ColumnCollection : CollectionBase
    {
        public Column this[int index]
        {
            get { return (Column)List[index]; }
        }

        public void Add(Column column)
        {
            List.Add(column);
        }

        public void Remove(Column column)
        {
            List.Remove(column);
        }
    }

    public class ColumnCollectionEditor : CollectionEditor
    {
        public ColumnCollectionEditor(Type type)
            : base(type)
        {
        }

        protected override string GetDisplayText(object value)
        {
            Column item = new Column();
            item = (Column)value;
            return base.GetDisplayText(string.Format("{0}", item.AutoColumnWidth));
        }
    }
}


The compiler does not like the section:

[Editor(typeof(ColumnCollectionEditor),UITypeEditor)]
        public ColumnCollection Columns
        {
            get { return Columns; }
            set { Columns = value; }
        }


it highlights the ColumnCollection reference, but I don't understand why. Can an experienced C# coder please point me in the right direction of where I am failing?

It's hard being a simpleton Sniff | :^)
AnswerRe: Design time collection problem Pin
Wendelius30-Dec-08 10:44
mentorWendelius30-Dec-08 10:44 
GeneralRe: Design time collection problem Pin
kanchoette30-Dec-08 11:28
kanchoette30-Dec-08 11:28 
GeneralRe: Design time collection problem Pin
Wendelius30-Dec-08 11:41
mentorWendelius30-Dec-08 11:41 
GeneralRe: Design time collection problem Pin
kanchoette30-Dec-08 11:51
kanchoette30-Dec-08 11:51 
GeneralRe: Design time collection problem Pin
Wendelius30-Dec-08 11:56
mentorWendelius30-Dec-08 11:56 
QuestionReceiving Email prob using c# Pin
Abdul Rahman Hamidy30-Dec-08 9:20
Abdul Rahman Hamidy30-Dec-08 9:20 
AnswerRe: Receiving Email prob using c# Pin
EliottA30-Dec-08 14:27
EliottA30-Dec-08 14:27 
GeneralRe: Receiving Email prob using c# Pin
Abdul Rahman Hamidy30-Dec-08 15:05
Abdul Rahman Hamidy30-Dec-08 15:05 
GeneralRe: Receiving Email prob using c# Pin
Christian Graus30-Dec-08 18:02
protectorChristian Graus30-Dec-08 18:02 
GeneralRe: Receiving Email prob using c# Pin
Abdul Rahman Hamidy30-Dec-08 18:44
Abdul Rahman Hamidy30-Dec-08 18:44 
QuestionHow to find/replace a hard coded connection string in a binary file? Pin
Ryan Neil Shaw30-Dec-08 7:43
Ryan Neil Shaw30-Dec-08 7:43 
GeneralRe: How to find/replace a hard coded connection string in a binary file? Pin
Luc Pattyn30-Dec-08 7:48
sitebuilderLuc Pattyn30-Dec-08 7:48 
GeneralWow... any File I/O experts around Pin
Ryan Neil Shaw30-Dec-08 8:05
Ryan Neil Shaw30-Dec-08 8:05 
GeneralRe: Wow... any File I/O experts around Pin
Luc Pattyn30-Dec-08 9:49
sitebuilderLuc Pattyn30-Dec-08 9:49 
GeneralRe: Wow... any File I/O experts around Pin
Ryan Neil Shaw30-Dec-08 10:17
Ryan Neil Shaw30-Dec-08 10:17 
GeneralRe: Wow... any File I/O experts around Pin
Luc Pattyn30-Dec-08 10:27
sitebuilderLuc Pattyn30-Dec-08 10:27 
AnswerRe: How to find/replace a hard coded connection string in a binary file? Pin
Dave Kreskowiak30-Dec-08 7:59
mveDave Kreskowiak30-Dec-08 7:59 

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.