Click here to Skip to main content
15,905,322 members
Home / Discussions / C#
   

C#

 
GeneralRe: Operator Precedence Pin
Luc Pattyn15-Dec-08 6:57
sitebuilderLuc Pattyn15-Dec-08 6:57 
GeneralRe: Operator Precedence Pin
Wendelius15-Dec-08 7:05
mentorWendelius15-Dec-08 7:05 
GeneralRe: Operator Precedence Pin
User 665815-Dec-08 7:08
User 665815-Dec-08 7:08 
GeneralRe: Operator Precedence Pin
Wendelius15-Dec-08 7:24
mentorWendelius15-Dec-08 7:24 
GeneralPerpetuum mobile? Pin
Luc Pattyn15-Dec-08 7:09
sitebuilderLuc Pattyn15-Dec-08 7:09 
GeneralRe: Perpetuum mobile? Pin
Wendelius15-Dec-08 7:24
mentorWendelius15-Dec-08 7:24 
GeneralRe: OP? [modified] Pin
hotthoughtguy15-Dec-08 20:03
hotthoughtguy15-Dec-08 20:03 
GeneralRe: OP? Pin
Wendelius16-Dec-08 6:10
mentorWendelius16-Dec-08 6:10 
QuestionBackground worker thread Pin
Saamir15-Dec-08 4:28
Saamir15-Dec-08 4:28 
GeneralRe: Background worker thread Pin
Luc Pattyn15-Dec-08 4:35
sitebuilderLuc Pattyn15-Dec-08 4:35 
GeneralRe: Background worker thread Pin
Saamir15-Dec-08 4:49
Saamir15-Dec-08 4:49 
GeneralRe: Background worker thread Pin
Luc Pattyn15-Dec-08 5:33
sitebuilderLuc Pattyn15-Dec-08 5:33 
GeneralRe: Background worker thread Pin
Saamir15-Dec-08 6:19
Saamir15-Dec-08 6:19 
GeneralRe: Background worker thread Pin
Luc Pattyn15-Dec-08 6:40
sitebuilderLuc Pattyn15-Dec-08 6:40 
GeneralRe: Background worker thread Pin
#realJSOP15-Dec-08 6:06
professional#realJSOP15-Dec-08 6:06 
GeneralRe: Background worker thread Pin
Saamir15-Dec-08 6:17
Saamir15-Dec-08 6:17 
GeneralRe: Background worker thread Pin
#realJSOP15-Dec-08 6:18
professional#realJSOP15-Dec-08 6:18 
GeneralRe: Background worker thread Pin
Saamir15-Dec-08 6:20
Saamir15-Dec-08 6:20 
AnswerRe: Background worker thread Pin
Lev Danielyan15-Dec-08 4:37
Lev Danielyan15-Dec-08 4:37 
QuestionMultiple "dot". How to? Not sure what is it called. Pin
xav9915-Dec-08 3:45
xav9915-Dec-08 3:45 
AnswerRe: Multiple "dot". How to? Not sure what is it called. Pin
J4amieC15-Dec-08 4:06
J4amieC15-Dec-08 4:06 
GeneralRe: Multiple "dot". How to? Not sure what is it called. Pin
xav9915-Dec-08 14:28
xav9915-Dec-08 14:28 
AnswerRe: Multiple "dot". How to? Not sure what is it called. Pin
carbon_golem15-Dec-08 4:18
carbon_golem15-Dec-08 4:18 
Not sure what you're asking here, but it is just called the "dot operator". But the dot operator is a mechanism that is used by classes to link their properties, members, and methods together. Here's an example.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DotOperator {
    class Program {
        static void Main(string[] args) {
            Report report = new Report();
            report.TheHeader = new Header("This is the News Today");
            report.TheArticle = new Article(@"Third suspect indicted in 27-year-old murder
                                By Bill Hankins 
                                Published December 14, 2008
A third suspect in the 27-year-old murder of Jean Wagnon has been indicted by a Lamar County grand...");

            Console.WriteLine(report.GetReport());

            Console.WriteLine(report.TheArticle.TheContent.Body); // gets the string for 
            Console.WriteLine(report.TheHeader.TheContent.Body.Length); // prints the length of the header
            Console.ReadLine();
        }
    }

    public class Report {
        public Header TheHeader { get; set; }
        public Article TheArticle { get; set; }
        public String GetReport() {
            return TheHeader.TheContent.Body + Environment.NewLine + TheArticle.TheContent.Body;
        }
    }

    public class Header {
        public Header(String header) {
            TheContent = new Content(header);
        }
        public Content TheContent { get; set; }
    }

    public class Article {
        public Article(String main) {
            TheContent = new Content(main);
        }
        public Content TheContent { get; set; }
    }

    public class Content {
        public Content(String theNews) {
            Body = theNews;
        }
        public String Body { get; set; }
    }
}


hope that helps.

EDIT: Yea, what J4amieC said.

Scott P.

"Simplicity carried to the extreme becomes elegance."
-Jon Franklin

AnswerRe: Multiple "dot". How to? Not sure what is it called. Pin
Paddy Boyd15-Dec-08 4:46
Paddy Boyd15-Dec-08 4:46 
Questionknowing the frame work is installed or not Pin
shavil15-Dec-08 3:32
shavil15-Dec-08 3:32 

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.