Click here to Skip to main content
15,916,846 members
Home / Discussions / C#
   

C#

 
GeneralRe: how to parse the file into xml Pin
DON3452-May-07 21:44
DON3452-May-07 21:44 
GeneralRe: how to parse the file into xml Pin
Sandeep Akhare2-May-07 21:51
Sandeep Akhare2-May-07 21:51 
GeneralRe: how to parse the file into xml Pin
Sandeep Akhare2-May-07 21:55
Sandeep Akhare2-May-07 21:55 
GeneralRe: how to parse the file into xml Pin
DON3452-May-07 22:29
DON3452-May-07 22:29 
AnswerRe: how to parse the file into xml Pin
Stefan Troschuetz2-May-07 21:41
Stefan Troschuetz2-May-07 21:41 
QuestionUrgent Role Based Menu Pin
coolestCoder2-May-07 20:49
coolestCoder2-May-07 20:49 
AnswerRe: Urgent Role Based Menu Pin
Pete O'Hanlon2-May-07 22:29
mvePete O'Hanlon2-May-07 22:29 
QuestionICloneable Collection Property Pin
Kenneth.Cheng2-May-07 20:24
Kenneth.Cheng2-May-07 20:24 
I have a question regarding the collection designer.

I have written a class "MyCollection" with ICloneable interface.

public class MyCollection: ICloneable
{
    int a1 = 1;
    string a2 = "abc";

    MyCollection() {}
    MyCollection( int _a1 )
    {
        a1 = _a1;
    }
    MyCollection( int _a1, string _a2 )
    {
        a1 = _a1;
        a2 = _a2;
    }

    public object Clone()
    {
        return new MyCollection(a1, a2);
    }
}

and use it in a component "Component1". Inside the Component1, I designed 2 properties, P1 and P2, P1 type is SqlParameter[] and another one P2 type is MyCollection[].

private SqlParameter[] p1;
public SqlParameter[] P1
{
    get { return p1; }
    set { p1 = value; }
}

private MyCollection[] p2;
public MyCollection[] P2
{
    get { return p2; }
    set { p2 = value; }
}

When I added the component into my form, I can see P1 and P2 in the property grid. For the P1, I can add the new SqlParameter object without problem. But for the P2, I can add but nothing can be saved. After I reopen the designer, P2 is still null. When I can view the design code directly:

    this.component11.P1 = new System.Data.SqlClient.SqlParameter[] {
new System.Data.SqlClient.SqlParameter("", System.Data.SqlDbType.NVarChar),
new System.Data.SqlClient.SqlParameter("", System.Data.SqlDbType.NVarChar, 45)};

The designer only create SqlParameter object for P1. But no code for P2.

I have coded the ICloneable interface. However, is there any I still missed in coding the MyCollection class? Any information are appreciate.


Kenneth.Cheng
AnswerRe: ICloneable Collection Property Pin
Kenneth.Cheng3-May-07 17:25
Kenneth.Cheng3-May-07 17:25 
AnswerRe: ICloneable Collection Property Pin
AFSEKI7-May-07 5:45
AFSEKI7-May-07 5:45 
QuestionOLEDB vs SQLClient Pin
Sujit Mandal2-May-07 20:08
Sujit Mandal2-May-07 20:08 
AnswerRe: OLEDB vs SQLClient Pin
PIEBALDconsult2-May-07 20:16
mvePIEBALDconsult2-May-07 20:16 
GeneralRe: OLEDB vs SQLClient Pin
Sujit Mandal2-May-07 23:36
Sujit Mandal2-May-07 23:36 
QuestionSelect checkbox from checkbox list through code. Pin
Sushant Duggal2-May-07 20:05
Sushant Duggal2-May-07 20:05 
AnswerRe: Select checkbox from checkbox list through code. [modified] Pin
PIEBALDconsult2-May-07 20:20
mvePIEBALDconsult2-May-07 20:20 
AnswerRe: Select checkbox from checkbox list through code. [modified] Pin
PIEBALDconsult2-May-07 20:27
mvePIEBALDconsult2-May-07 20:27 
GeneralRe: Select checkbox from checkbox list through code. Pin
Sushant Duggal2-May-07 23:15
Sushant Duggal2-May-07 23:15 
GeneralRe: Select checkbox from checkbox list through code. Pin
PIEBALDconsult3-May-07 5:47
mvePIEBALDconsult3-May-07 5:47 
AnswerRe: Select checkbox from checkbox list through code. Pin
Arun.Immanuel2-May-07 20:27
Arun.Immanuel2-May-07 20:27 
AnswerRe: Select checkbox from checkbox list through code. Pin
PIEBALDconsult2-May-07 20:39
mvePIEBALDconsult2-May-07 20:39 
AnswerRe: Select checkbox from checkbox list through code. Pin
AFSEKI7-May-07 5:50
AFSEKI7-May-07 5:50 
QuestionHow to set permission(Full control) to the folder.. Pin
Dotnetkanna2-May-07 19:28
Dotnetkanna2-May-07 19:28 
AnswerRe: How to set permission(Full control) to the folder.. Pin
Pranav Soral2-May-07 20:21
Pranav Soral2-May-07 20:21 
GeneralRe: How to set permission(Full control) to the folder.. [modified] Pin
Dotnetkanna2-May-07 20:40
Dotnetkanna2-May-07 20:40 
GeneralRe: How to set permission(Full control) to the folder.. Pin
Pranav Soral2-May-07 21:13
Pranav Soral2-May-07 21:13 

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.