예제 #1
0
 // Create messages constructor.
 public Messages(DatingProfile Sender, string MessageTitle, string MessageData)
 {
     this.Sender       = Sender;
     this.MessageTitle = "Subject: " + MessageTitle;
     this.MessageData  = "Content: " + MessageData;
     //isRead = false;
 }
예제 #2
0
        // =========================================================================
        // Name:	Keith Krystek
        // Date:	07.26.2020
        // Class: SD1104-A - Full Stack C# Development - Sona Patel - 7 / 11 / 2020
        //
        // Assignment: Lab 7_4
        // =========================================================================


        static void Main(string[] args)
        {
            // Create dating profiles and bios.

            DatingProfile elmer = new DatingProfile("Elmer", "Fudd", 53, "Male");

            elmer.WriteBio("Likes to hunt wabbits!");

            DatingProfile ww = new DatingProfile("Wonder", "Woman", 33, "Female");

            ww.WriteBio("Saves the world every day!");


            // Send messages back and forth.

            elmer.SendMessage("Help Saving the World", "Hello Wonder Woman -- Do you need help saving the world today?", ww);

            ww.SendMessage("Saving the World", "No Elmer, I don't want you to wisk your wife saving the world!", elmer);

            elmer.SendMessage(elmer.FirstName + "'s Bio", elmer.Bio, ww);

            ww.SendMessage(ww.FirstName + "'s Bio", ww.Bio, elmer);


            // Check messages.

            ww.ReadMessages();

            elmer.ReadMessages();

            // Test if isRead variable works.

            ww.ReadMessages();

            elmer.ReadMessages();
        }
예제 #3
0
        public void SendMessage(string MessageTitle, string MessageData, DatingProfile SendTo)
        {
            Messages message = new Messages(this, MessageTitle, MessageData);

            SendTo.AddToMailBox(message);
        }