Click here to Skip to main content
15,885,366 members
Home / Discussions / C#
   

C#

 
GeneralRe: Updating changings back to DB from DataGridView Pin
I Believe In GOD31-May-09 1:49
I Believe In GOD31-May-09 1:49 
QuestionGet the absolute pix of Html Element Using mshtml Pin
Member 437807730-May-09 3:00
Member 437807730-May-09 3:00 
QuestionPlease help Pin
Etienne_12330-May-09 1:57
Etienne_12330-May-09 1:57 
AnswerRe: Please help Pin
Henry Minute30-May-09 4:02
Henry Minute30-May-09 4:02 
AnswerRe: Please help Pin
I Believe In GOD30-May-09 10:11
I Believe In GOD30-May-09 10:11 
GeneralRe: Please help Pin
Etienne_12330-May-09 23:31
Etienne_12330-May-09 23:31 
GeneralRe: Please help Pin
I Believe In GOD31-May-09 1:54
I Believe In GOD31-May-09 1:54 
Questionservice of Events in C# [modified] Pin
arturw8230-May-09 1:40
arturw8230-May-09 1:40 
I have class like Project, and UseCase AddProject.
Like below. How should I implement the service of event, message: "Project was added corectly", or "Project was not added (Project exist)" and send message to user.
Events in C#, or what?:/
Maby application class should have implement event?
public event myEventHandler ProjectAdded;

What is the best practice?
public MyMessage AddProject(params string[] ProjectData){

            Project tempProject = new Project();
            tempProject.Id = Guid.NewGuid();
            tempProject.Name = ProjectData[0];
            tempProject.Number = ProjectData[1];


            if (!m_Project.Contains(tempProject))
            {
                m_Project.Add(tempProject);
                return new MyMessage(true,string.Format("Project: {0} ADDED",tempProject.Number));
            }
            else
            {
                return new MyMessage(false,string.Format("Project: {0} NOT ADDED (Project exist).", tempProject.Number));
            }
		}

 public struct MyMessage
    {
        private bool _executed;
        private string _message;
        public MyMessage(bool executed, string message)
        {
            _executed = executed;
            _message = message;
        }
        public bool IsExecuted
        {
            get
            {
                return _executed;
            }
        }
        public string Message
        {
            get
            {
                return _message;
            }
        }

    }

In program....
Console.WriteLine(ap.AddProject("Name" , "0000000001","Description", DateTime.Now.ToString(), DateTime.Now.ToString()).Message);


modified on Saturday, May 30, 2009 7:59 AM

AnswerRe: service of Events in C# Pin
Moreno Airoldi30-May-09 7:15
Moreno Airoldi30-May-09 7:15 
Questionwrong behaviour of Text Reader Pin
vishal moharikar30-May-09 1:03
vishal moharikar30-May-09 1:03 
AnswerRe: wrong behaviour of Text Reader Pin
Apocwhen30-May-09 1:49
Apocwhen30-May-09 1:49 
GeneralRe: wrong behaviour of Text Reader Pin
vishal moharikar31-May-09 18:16
vishal moharikar31-May-09 18:16 
AnswerRe: wrong behaviour of Text Reader Pin
Moreno Airoldi30-May-09 7:21
Moreno Airoldi30-May-09 7:21 
GeneralRe: wrong behaviour of Text Reader Pin
Luc Pattyn30-May-09 7:32
sitebuilderLuc Pattyn30-May-09 7:32 
AnswerRe: wrong behaviour of Text Reader Pin
Luc Pattyn30-May-09 7:38
sitebuilderLuc Pattyn30-May-09 7:38 
AnswerRe: wrong behaviour of Text Reader Pin
Joe Woodbury31-May-09 16:25
professionalJoe Woodbury31-May-09 16:25 
QuestionTabControl "vertical" AutoScroll Pin
netogg30-May-09 0:38
netogg30-May-09 0:38 
AnswerRe: TabControl "vertical" AutoScroll Pin
Satish Pai30-May-09 1:13
Satish Pai30-May-09 1:13 
GeneralRe: TabControl "vertical" AutoScroll Pin
netogg30-May-09 1:27
netogg30-May-09 1:27 
GeneralRe: TabControl "vertical" AutoScroll Pin
Satish Pai30-May-09 2:27
Satish Pai30-May-09 2:27 
GeneralRe: TabControl "vertical" AutoScroll Pin
Satish Pai30-May-09 2:50
Satish Pai30-May-09 2:50 
GeneralRe: TabControl "vertical" AutoScroll Pin
netogg30-May-09 13:58
netogg30-May-09 13:58 
Questiondownloading pdf on a desktop folder Pin
tauras8129-May-09 23:59
tauras8129-May-09 23:59 
AnswerRe: downloading pdf on a desktop folder Pin
Rajesh R Subramanian30-May-09 0:11
professionalRajesh R Subramanian30-May-09 0:11 
AnswerRe: downloading pdf on a desktop folder Pin
Henry Minute30-May-09 0:12
Henry Minute30-May-09 0:12 

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.