Click here to Skip to main content
15,890,438 members
Home / Discussions / C#
   

C#

 
AnswerRe: Searching drives and directories Pin
fly90424-May-09 20:23
fly90424-May-09 20:23 
GeneralRe: Searching drives and directories Pin
Rajdeep.NET is BACK24-May-09 20:35
Rajdeep.NET is BACK24-May-09 20:35 
GeneralRe: Searching drives and directories Pin
fly90425-May-09 1:34
fly90425-May-09 1:34 
AnswerRe: Searching drives and directories Pin
stancrm24-May-09 20:53
stancrm24-May-09 20:53 
GeneralRe: Searching drives and directories Pin
fly90425-May-09 1:54
fly90425-May-09 1:54 
GeneralRe: Searching drives and directories Pin
Rajdeep.NET is BACK25-May-09 2:09
Rajdeep.NET is BACK25-May-09 2:09 
AnswerRe: Searching drives and directories Pin
MumbleB24-May-09 22:47
MumbleB24-May-09 22:47 
GeneralRe: Searching drives and directories Pin
Rajdeep.NET is BACK25-May-09 6:59
Rajdeep.NET is BACK25-May-09 6:59 
QuestionHttpWebRequest question Pin
Ehsan Baghaki24-May-09 19:57
Ehsan Baghaki24-May-09 19:57 
AnswerRe: HttpWebRequest question Pin
Manas Bhardwaj24-May-09 23:19
professionalManas Bhardwaj24-May-09 23:19 
Questionchenge plot in the zedgrapg control Pin
hamidhakimi24-May-09 19:22
hamidhakimi24-May-09 19:22 
AnswerRe: chenge plot in the zedgrapg control Pin
_Maxxx_24-May-09 19:38
professional_Maxxx_24-May-09 19:38 
QuestionWant to validate a function and execute it Pin
Anindya Chatterjee24-May-09 18:54
Anindya Chatterjee24-May-09 18:54 
AnswerRe: Want to validate a function and execute it Pin
Tuwing.Sabado24-May-09 21:14
Tuwing.Sabado24-May-09 21:14 
GeneralRe: Want to validate a function and execute it Pin
Anindya Chatterjee24-May-09 22:12
Anindya Chatterjee24-May-09 22:12 
AnswerRe: Want to validate a function and execute it Pin
S. Senthil Kumar24-May-09 22:56
S. Senthil Kumar24-May-09 22:56 
GeneralRe: Want to validate a function and execute it Pin
Anindya Chatterjee24-May-09 23:32
Anindya Chatterjee24-May-09 23:32 
QuestionThe type initializer threw an exception? Pin
dec8224-May-09 16:57
dec8224-May-09 16:57 
AnswerRe: The type initializer threw an exception? Pin
_Maxxx_24-May-09 19:32
professional_Maxxx_24-May-09 19:32 
The code you have presented (except of a coouple of typos) works -
public class Class1
	{
		public enum Protocol
		{
			Digital,
			Analog
		}
		public enum Model
		{
			Digital1,
			Digital2,
			Analog1,
			Analog2
		}

		public static Protocol m_selectedProtocol;
		public static Model m_ModelSelected;

		public static Protocol SelectedProtocol
		{
			get { return Class1.m_selectedProtocol; }
			set { Class1.m_selectedProtocol = value; }
		}
		public static Model ModelSelected
		{
			get { return Class1.m_ModelSelected ; }
			set { Class1.m_ModelSelected= value; }
		}

	}




private void button1_Click(object sender, EventArgs e)
{
    Class1.SelectedProtocol = Class1.Protocol.Analog;
}


so there is something in the code you have not posted causing the problem - are you able to post some complete code that shows the problem?

___________________________________________
.\\axxx
(That's an 'M')

GeneralRe: The type initializer threw an exception? Pin
dec8224-May-09 19:50
dec8224-May-09 19:50 
GeneralRe: The type initializer threw an exception? Pin
_Maxxx_25-May-09 12:10
professional_Maxxx_25-May-09 12:10 
AnswerRe: The type initializer threw an exception? Pin
Ramesh Swaminathan24-May-09 19:56
Ramesh Swaminathan24-May-09 19:56 
AnswerRe: The type initializer threw an exception? Pin
S. Senthil Kumar24-May-09 22:36
S. Senthil Kumar24-May-09 22:36 
Questionhow to access CSP? Pin
devvvy24-May-09 16:32
devvvy24-May-09 16:32 
Questionthis as parameter Pin
mark_me24-May-09 16:03
mark_me24-May-09 16:03 

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.