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

C#

 
QuestionHelp Pin
Amaan2313-Apr-12 2:43
Amaan2313-Apr-12 2:43 
AnswerRe: Help Pin
TenmanS1413-Apr-12 4:02
TenmanS1413-Apr-12 4:02 
GeneralRe: Help Pin
Amaan2313-Apr-12 4:59
Amaan2313-Apr-12 4:59 
Questionnew learner Pin
lawal olanrewaju Daniel13-Apr-12 2:19
lawal olanrewaju Daniel13-Apr-12 2:19 
AnswerRe: new learner Pin
Not Active13-Apr-12 2:28
mentorNot Active13-Apr-12 2:28 
AnswerRe: new learner Pin
V.13-Apr-12 2:32
professionalV.13-Apr-12 2:32 
AnswerRe: new learner Pin
BobJanova13-Apr-12 2:39
BobJanova13-Apr-12 2:39 
QuestionHow can we delegate an array Pin
Fred 3413-Apr-12 2:06
Fred 3413-Apr-12 2:06 
AnswerRe: How can we delegate an array Pin
V.13-Apr-12 2:31
professionalV.13-Apr-12 2:31 
GeneralRe: How can we delegate an array Pin
Fred 3413-Apr-12 3:44
Fred 3413-Apr-12 3:44 
GeneralRe: How can we delegate an array Pin
V.13-Apr-12 3:46
professionalV.13-Apr-12 3:46 
QuestionCorrectly Disposing of MDI Child Forms. Pin
cjb11013-Apr-12 0:29
cjb11013-Apr-12 0:29 
AnswerRe: Correctly Disposing of MDI Child Forms. Pin
BobJanova13-Apr-12 2:37
BobJanova13-Apr-12 2:37 
GeneralRe: Correctly Disposing of MDI Child Forms. Pin
cjb11015-Apr-12 21:51
cjb11015-Apr-12 21:51 
QuestionPaging in SQL Pin
Billa212-Apr-12 20:41
Billa212-Apr-12 20:41 
AnswerCross posted from Database forum Pin
Pete O'Hanlon12-Apr-12 22:18
mvePete O'Hanlon12-Apr-12 22:18 
QuestionProjectProblem Pin
Madhavsingh12-Apr-12 19:26
Madhavsingh12-Apr-12 19:26 
AnswerRe: ProjectProblem Pin
egenis12-Apr-12 20:01
egenis12-Apr-12 20:01 
QuestionAlwaysOnTop behavior - Windows Forms vs. Win32? Pin
Ravi Bhavnani12-Apr-12 18:59
professionalRavi Bhavnani12-Apr-12 18:59 
AnswerRe: AlwaysOnTop behavior - Windows Forms vs. Win32? Pin
Alan N12-Apr-12 23:21
Alan N12-Apr-12 23:21 
GeneralRe: AlwaysOnTop behavior - Windows Forms vs. Win32? Pin
Ravi Bhavnani13-Apr-12 5:19
professionalRavi Bhavnani13-Apr-12 5:19 
QuestionXml Serilization / Deserilization Array quesiton Pin
Jason McBurney12-Apr-12 14:09
Jason McBurney12-Apr-12 14:09 
I have an interface with a client that is been in production for many years, and I would like to alter the xml parsing system that handles this message.

Since I may have 4 different StatusTypes I desire to have an array of the these items, however, they are not in a nice collection element that will make deserlization simple, like all of the examples on the internet that I could find.

In the code below, I was hoping to get all of these items in MysticalList. Obviously, my example does not work ... How can I get my entity to work with a simple list?

XML
<xsd:complexType name="requestRailStatus">
    <xsd:sequence>
        <xsd:element name="TrainID" type="xsd:string" minOccurs="0" maxOccurs="1" />
        <xsd:element name="BeginTimePeriod" type="xsd:dateTime" minOccurs="0" maxOccurs="1" />
        <xsd:element name="EndTimePeriod" type="xsd:dateTime" minOccurs="0" maxOccurs="1" />
        <xsd:element name="StatusType" type="railStatusOptions" minOccurs="0" maxOccurs="4" />
    </xsd:sequence>
    <xsd:attribute name="timestamp" type="xsd:dateTime" use="required" />
    <xsd:attribute name="messageId" type="xsd:unsignedInt" use="required" />
</xsd:complexType>

<xsd:simpleType name="railStatusOptions">
    <xsd:restriction base="xsd:string">
        <xsd:enumeration value="ActualTimeOfArrival" />
        <xsd:enumeration value="ActualTimeOfWorking" />
        <xsd:enumeration value="ActualTimeOfCompletion" />
        <xsd:enumeration value="ActualTimeOfDeparture" />
    </xsd:restriction>
</xsd:simpleType>


C#
public partial class requestRailStatus : EntityBase
    {
        public string TrainID { get; set; }
        public System.DateTime BeginTimePeriod { get; set; }
        public System.DateTime EndTimePeriod { get; set; }

        [XmlElement("timestamp")]
        public System.DateTime TimeStamp { get; set; }

        [XmlElement("messageId")]
        public uint MessageId { get; set; }

        [XmlArray]
        public List<railStatusOptions> MysticalList { get; set; }

        public requestRailStatus() { }
    }

You can only be young once. But you can always be immature.
- Dave Barry

GeneralRe: Xml Serilization / Deserilization Array quesiton Pin
BobJanova13-Apr-12 2:34
BobJanova13-Apr-12 2:34 
GeneralRe: Xml Serilization / Deserilization Array quesiton Pin
Jason McBurney13-Apr-12 5:36
Jason McBurney13-Apr-12 5:36 
QuestionDrawing to Picturebox problem. Help needed badly Pin
aquahoya12-Apr-12 13:53
aquahoya12-Apr-12 13:53 

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.