Click here to Skip to main content
15,912,493 members
Home / Discussions / C#
   

C#

 
GeneralRe: Populating a Datalist only when if Statement is True Pin
CWIZO16-Mar-06 2:42
CWIZO16-Mar-06 2:42 
Questionusb drivers Pin
JacquesDP16-Mar-06 0:49
JacquesDP16-Mar-06 0:49 
AnswerRe: usb drivers Pin
roboter@begemotik.ee16-Mar-06 3:12
roboter@begemotik.ee16-Mar-06 3:12 
QuestionWeb Method order Pin
si_6916-Mar-06 0:42
si_6916-Mar-06 0:42 
AnswerRe: Web Method order Pin
CWIZO16-Mar-06 2:12
CWIZO16-Mar-06 2:12 
QuestionPassing an array of ints to an unmanaged function (as an int pointer) Pin
paul_ainsworth16-Mar-06 0:34
paul_ainsworth16-Mar-06 0:34 
AnswerRe: Passing an array of ints to an unmanaged function (as an int pointer) Pin
Divyang Mithaiwala16-Mar-06 3:27
Divyang Mithaiwala16-Mar-06 3:27 
QuestionSerializing object problem Pin
hpetriffer16-Mar-06 0:24
hpetriffer16-Mar-06 0:24 
Hello I have a strange problem. I have implemented the ISerializable interface for 2 classes.
the GetObjectData implementation of the first class is:

<br />
        public void GetObjectData(SerializationInfo info, StreamingContext context)<br />
        {<br />
            List<Register> lstRegister = new List<Register>();<br />
            info.AddValue("Text", this.Text);<br />
            foreach (Control c in this.Controls)<br />
            {<br />
                Register reg = c as Register;<br />
                if (reg != null)<br />
                {<br />
                    lstRegister.Add(reg);<br />
                }<br />
            }<br />
            Register[] registers = lstRegister.ToArray();<br />
            info.AddValue("Registers", registers);<br />
        }<br />


the serialization constructor is the following:
<br />
protected VisualTabPage(SerializationInfo info, StreamingContext ctxt)<br />
            : this()<br />
        {<br />
            this.Text = info.GetString("Text");<br />
            Register[] registers = (Register[])info.GetValue("Registers", typeof(Register[]));<br />
            this.Controls.AddRange(registers);<br />
            <br />
        }<br />


for the Register class I have implemented also this interface and it was working well:
I have tested it with the following helper class:
<br />
    [Serializable]<br />
    internal class SerializeTab<br />
    {<br />
        private string name;<br />
<br />
        public List<Register> visObjects = new List<Register>();<br />
<br />
        public string Name<br />
        {<br />
            get { return name; }<br />
            set { name = value; }<br />
        }<br />
<br />
    }<br />


Now if I Deserialize the object, there is a Register[] array with one item, but this item is null.
Has anyone an idea what can cause this?

Regards
Hansjörg
AnswerRe: Serializing object problem Pin
Nicholas Butler16-Mar-06 5:26
sitebuilderNicholas Butler16-Mar-06 5:26 
GeneralRe: Serializing object problem Pin
hpetriffer16-Mar-06 18:58
hpetriffer16-Mar-06 18:58 
Questionplease help me... Pin
Ruzimi15-Mar-06 23:49
Ruzimi15-Mar-06 23:49 
AnswerRe: please help me... Pin
J4amieC15-Mar-06 23:52
J4amieC15-Mar-06 23:52 
AnswerRe: please help me... Pin
akyriako7816-Mar-06 0:15
akyriako7816-Mar-06 0:15 
AnswerRe: please help me... Pin
hpetriffer16-Mar-06 0:27
hpetriffer16-Mar-06 0:27 
AnswerRe: please help me... Pin
fregolo5216-Mar-06 0:29
fregolo5216-Mar-06 0:29 
GeneralRe: please help me... Pin
akyriako7816-Mar-06 1:27
akyriako7816-Mar-06 1:27 
GeneralRe: please help me... Pin
albCode16-Mar-06 1:34
albCode16-Mar-06 1:34 
GeneralRe: please help me... Pin
J4amieC16-Mar-06 2:59
J4amieC16-Mar-06 2:59 
GeneralRe: please help me... Pin
akyriako7816-Mar-06 5:59
akyriako7816-Mar-06 5:59 
QuestionVS2005 - vshost threads Pin
V.15-Mar-06 23:48
professionalV.15-Mar-06 23:48 
Questionwindows service c# Pin
fady_sayegh15-Mar-06 23:46
fady_sayegh15-Mar-06 23:46 
QuestionListview and SetScrollPos function Pin
fregolo5215-Mar-06 23:33
fregolo5215-Mar-06 23:33 
QuestionmbabuCustom Controls Pin
mattiram15-Mar-06 23:29
mattiram15-Mar-06 23:29 
QuestionCustom Controls Pin
mattiram15-Mar-06 23:28
mattiram15-Mar-06 23:28 
Questionaspx's page_load firing multiple times Pin
livez15-Mar-06 23:18
livez15-Mar-06 23:18 

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.