Click here to Skip to main content
15,899,475 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralNon discriptive subject lines... Pin
Paul Conrad1-Dec-08 7:12
professionalPaul Conrad1-Dec-08 7:12 
Questiondatagridview Problem [modified] Pin
swapnil_bhanagle29-Nov-08 2:52
swapnil_bhanagle29-Nov-08 2:52 
AnswerRe: datagridview Problem Pin
Brij30-Nov-08 3:00
mentorBrij30-Nov-08 3:00 
GeneralRe: datagridview Problem Pin
swapnil_bhanagle30-Nov-08 5:04
swapnil_bhanagle30-Nov-08 5:04 
GeneralRe: datagridview Problem Pin
Jon_Boy1-Dec-08 7:12
Jon_Boy1-Dec-08 7:12 
GeneralRe: datagridview Problem Pin
swapnil_bhanagle1-Dec-08 8:41
swapnil_bhanagle1-Dec-08 8:41 
GeneralRe: datagridview Problem Pin
Jon_Boy2-Dec-08 2:08
Jon_Boy2-Dec-08 2:08 
QuestionXML serializition. Pin
Member 375281628-Nov-08 3:10
Member 375281628-Nov-08 3:10 
Hello all,

i'm making a dynamic light system, that contains scene's. A scene has a lamp (philips livingColor), min 1 max 8, and each lamp has its own platform. The save/edit a scene i am saving all data in the class Lamp (and motor) in a list <color_point>.
The struct: Color_point has string, int and a Color.
However, if i want to serialise the class, i wont get a color in the xml. I know this is an private attribute, so i wont get something back. And I already read some more about making a different struc tfor the color. But.. how?
See Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Collections;
using System.Collections.Specialized;
using System.Xml.Serialization;



namespace Light
{
    [Serializable()]
    public struct Color_Point
    {
        public string Name;
        public int Time;
        public Color Rgb;

        public Color_Point(string name, int time, Color rgb)
        {
            Name = name;
            Time = time; //in ms
            Rgb = rgb;
        }

    }
    [Serializable()]
    public class Lamp
    {
        public int address;
        public Color current_Color;
        public Color previous_Color;
        public List<Color_Point> list = new List<Color_Point>();

        public Lamp()
        {
            address = 0;
        }

          

        public void setColor(Int32 time, Color rgb, string name)
        {
            int correct_time = 0;
            if (name != "Fade")
            {
                if (list.Count == 0)
                    list.Add(new Color_Point(name, 0, rgb));
                else
                {
                    correct_time = getTime("btnColor" + LastNumber()) + time;
                    
                    list.Add(new Color_Point(name, correct_time, rgb));
                    
                }
                }
            else 
                list.Add(new Color_Point(name, time, rgb));
            
        }


How can i make sure that i also save the Colors??

Thank you!
AnswerRe: XML serializition. Pin
Dave Kreskowiak28-Nov-08 5:49
mveDave Kreskowiak28-Nov-08 5:49 
QuestionFile HashCheck Problem Pin
fqn27-Nov-08 23:11
fqn27-Nov-08 23:11 
AnswerRe: File HashCheck Problem Pin
Simon P Stevens27-Nov-08 23:51
Simon P Stevens27-Nov-08 23:51 
AnswerRe: File HashCheck Problem Pin
Dave Kreskowiak28-Nov-08 5:45
mveDave Kreskowiak28-Nov-08 5:45 
AnswerRe: File HashCheck Problem Pin
Mark Churchill30-Nov-08 15:23
Mark Churchill30-Nov-08 15:23 
QuestionForm Size Problem Pin
swapnil_bhanagle27-Nov-08 8:35
swapnil_bhanagle27-Nov-08 8:35 
AnswerRe: Form Size Problem Pin
EliottA27-Nov-08 9:48
EliottA27-Nov-08 9:48 
AnswerRe: Form Size Problem Pin
EliottA27-Nov-08 10:18
EliottA27-Nov-08 10:18 
Questionform maximize Pin
swapnil_bhanagle27-Nov-08 6:00
swapnil_bhanagle27-Nov-08 6:00 
AnswerRe: form maximize Pin
EliottA27-Nov-08 6:38
EliottA27-Nov-08 6:38 
GeneralRe: form maximize Pin
Luc Pattyn27-Nov-08 10:21
sitebuilderLuc Pattyn27-Nov-08 10:21 
GeneralRe: form maximize Pin
EliottA28-Nov-08 2:25
EliottA28-Nov-08 2:25 
Question.NET Framework Remoting Pin
MW195627-Nov-08 1:14
MW195627-Nov-08 1:14 
QuestionHosting control in details view in a DataGridView Pin
kensai26-Nov-08 8:40
kensai26-Nov-08 8:40 
AnswerRe: Hosting control in details view in a DataGridView Pin
kensai29-Nov-08 3:33
kensai29-Nov-08 3:33 
QuestionRead Encrypted email with vb.net and outlook automation Pin
mandrake_226-Nov-08 1:58
mandrake_226-Nov-08 1:58 
AnswerRe: Read Encrypted email with vb.net and outlook automation Pin
led mike26-Nov-08 7:15
led mike26-Nov-08 7:15 

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.