Click here to Skip to main content
15,913,361 members
Home / Discussions / C#
   

C#

 
QuestionHelp with PictureBox.image updating from Webcam capture Pin
shutupsquare16-Jan-10 9:49
shutupsquare16-Jan-10 9:49 
AnswerRe: Help with PictureBox.image updating from Webcam capture Pin
Luc Pattyn16-Jan-10 10:03
sitebuilderLuc Pattyn16-Jan-10 10:03 
GeneralRe: Help with PictureBox.image updating from Webcam capture Pin
shutupsquare16-Jan-10 10:17
shutupsquare16-Jan-10 10:17 
AnswerRe: Help with PictureBox.image updating from Webcam capture Pin
shutupsquare16-Jan-10 10:08
shutupsquare16-Jan-10 10:08 
GeneralRe: Help with PictureBox.image updating from Webcam capture Pin
Luc Pattyn16-Jan-10 11:05
sitebuilderLuc Pattyn16-Jan-10 11:05 
GeneralRe: Help with PictureBox.image updating from Webcam capture Pin
shutupsquare16-Jan-10 12:56
shutupsquare16-Jan-10 12:56 
GeneralRe: Help with PictureBox.image updating from Webcam capture Pin
Luc Pattyn16-Jan-10 13:03
sitebuilderLuc Pattyn16-Jan-10 13:03 
Questionencapsulation understanding problems Pin
binn01916-Jan-10 6:41
binn01916-Jan-10 6:41 
hi, im newbie in c# encapsulation,recently i just study an article on the encapsulation for hiding its field in class so that it protect the data by outside world...but im confuse...i did try some example.. .Below is my code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EncapsulationExample
{
class Program
{
static void Main(string[] args)
{
School d = new School();
d.SetSchool("Alan");
Console.WriteLine("The School is :" + d.GetSchool());
d.SetSchool("Sing");//changing parameter will also change private //variable name as well

Console.WriteLine("The School is :" + d.GetSchool());

d.testing = "month";
Console.WriteLine("The testing is :" + d.testing);


}
}
public class School
{
private string name;

public string testing;
// Accessor.
public string GetSchool()
{
return name;
}
// Mutator.
public void SetSchool(string a)
{
name=a;
}
}
}

...here is my confusion..even the private variable name has been declared as private, but the variable can also be changed by assigning different parameter in SetSchool method...which is same as public string testing where we can change the variable of testing as well.What is the difference with using method and without method(access variable directly from public variable) ??....What does "protect the data by outside world" actually means? any explanation with coding would be much appreciated..Thanks in advance
AnswerRe: encapsulation understanding problems Pin
Jimmanuel16-Jan-10 7:11
Jimmanuel16-Jan-10 7:11 
GeneralRe: encapsulation understanding problems Pin
binn01924-Jan-10 0:02
binn01924-Jan-10 0:02 
QuestionNeed help with drawing circles on mouse click event in pictureBox Pin
Midex16-Jan-10 5:49
Midex16-Jan-10 5:49 
AnswerRe: Need help with drawing circles on mouse click event in pictureBox Pin
Luc Pattyn16-Jan-10 6:13
sitebuilderLuc Pattyn16-Jan-10 6:13 
AnswerRe: Need help with drawing circles on mouse click event in pictureBox Pin
Dan Mos16-Jan-10 7:53
Dan Mos16-Jan-10 7:53 
QuestionBackgroundWorker with anonymous methods ? Pin
Mohammad Dayyan16-Jan-10 4:06
Mohammad Dayyan16-Jan-10 4:06 
AnswerRe: BackgroundWorker with anonymous methods ? Pin
Nicholas Butler16-Jan-10 4:59
sitebuilderNicholas Butler16-Jan-10 4:59 
GeneralRe: BackgroundWorker with anonymous methods ? Pin
Mohammad Dayyan16-Jan-10 6:58
Mohammad Dayyan16-Jan-10 6:58 
QuestionHolding data in memory Pin
Bardy8516-Jan-10 0:22
Bardy8516-Jan-10 0:22 
AnswerRe: Holding data in memory Pin
OriginalGriff16-Jan-10 1:01
mveOriginalGriff16-Jan-10 1:01 
GeneralRe: Holding data in memory Pin
Bardy8516-Jan-10 1:16
Bardy8516-Jan-10 1:16 
GeneralRe: Holding data in memory Pin
N a v a n e e t h16-Jan-10 6:05
N a v a n e e t h16-Jan-10 6:05 
GeneralRe: Holding data in memory Pin
Dan Mos16-Jan-10 7:21
Dan Mos16-Jan-10 7:21 
GeneralRe: Holding data in memory Pin
Bardy8516-Jan-10 9:21
Bardy8516-Jan-10 9:21 
GeneralRe: Holding data in memory Pin
Luc Pattyn16-Jan-10 10:05
sitebuilderLuc Pattyn16-Jan-10 10:05 
GeneralRe: Holding data in memory Pin
Bardy8516-Jan-10 10:56
Bardy8516-Jan-10 10:56 
GeneralRe: Holding data in memory [modified] Pin
Dan Mos16-Jan-10 11:01
Dan Mos16-Jan-10 11:01 

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.