Working with own libaries
-
Hi all, I'm not a all day programmer, but C#/.Net is nice to get little administration processes. But nothing is good without good coding style... I will create a class which gives solutions to use if someone is calling this method. I.e. like (ImpLink, Internetwork). Sample Pic In my method I will give a way to select different switches by choise with this options. I know only this possiblity via "summary, and params" to give options for Intellisense
-
Hi all, I'm not a all day programmer, but C#/.Net is nice to get little administration processes. But nothing is good without good coding style... I will create a class which gives solutions to use if someone is calling this method. I.e. like (ImpLink, Internetwork). Sample Pic In my method I will give a way to select different switches by choise with this options. I know only this possiblity via "summary, and params" to give options for Intellisense
-
Hi all, I'm not a all day programmer, but C#/.Net is nice to get little administration processes. But nothing is good without good coding style... I will create a class which gives solutions to use if someone is calling this method. I.e. like (ImpLink, Internetwork). Sample Pic In my method I will give a way to select different switches by choise with this options. I know only this possiblity via "summary, and params" to give options for Intellisense
What is your question
I know the language. I've read a book. - _Madmatt
-
Hi all, I'm not a all day programmer, but C#/.Net is nice to get little administration processes. But nothing is good without good coding style... I will create a class which gives solutions to use if someone is calling this method. I.e. like (ImpLink, Internetwork). Sample Pic In my method I will give a way to select different switches by choise with this options. I know only this possiblity via "summary, and params" to give options for Intellisense
-
yes I think I'm walking a step forward. I was creating an enum and read out the integer. But how can I transfer enum values to a method ? At the moment i use "int MessageType" I will call the Method Loggerschema i.e: LoggerScheme(ex.ToString(),MessageType.Error); public enum MessageType1{Information=1,Error,Warning}; public void LoggerScheme(string ex, int MessageType) { if(MessageType==1) { // This is a Information Message // But I prefer to give Type "Information" instead 1 } if(MessageType==2) { // This is a Error Message // But I prefer to give Type "Error" instead 2 } if(MessageType==3) { // This is a Warning Message // But I prefer to give Type "Warning" instead 2 } }
modified on Friday, November 5, 2010 10:53 AM
-
yes I think I'm walking a step forward. I was creating an enum and read out the integer. But how can I transfer enum values to a method ? At the moment i use "int MessageType" I will call the Method Loggerschema i.e: LoggerScheme(ex.ToString(),MessageType.Error); public enum MessageType1{Information=1,Error,Warning}; public void LoggerScheme(string ex, int MessageType) { if(MessageType==1) { // This is a Information Message // But I prefer to give Type "Information" instead 1 } if(MessageType==2) { // This is a Error Message // But I prefer to give Type "Error" instead 2 } if(MessageType==3) { // This is a Warning Message // But I prefer to give Type "Warning" instead 2 } }
modified on Friday, November 5, 2010 10:53 AM
-
Use the name of the enum type, instead of int:
public void LoggerScheme(string ex, MessageType1 MessageType)
Edit And don't cast it to int, it is not necessary:
if (MessageType == MessageType1.Information)
... -
yes I think I'm walking a step forward. I was creating an enum and read out the integer. But how can I transfer enum values to a method ? At the moment i use "int MessageType" I will call the Method Loggerschema i.e: LoggerScheme(ex.ToString(),MessageType.Error); public enum MessageType1{Information=1,Error,Warning}; public void LoggerScheme(string ex, int MessageType) { if(MessageType==1) { // This is a Information Message // But I prefer to give Type "Information" instead 1 } if(MessageType==2) { // This is a Error Message // But I prefer to give Type "Error" instead 2 } if(MessageType==3) { // This is a Warning Message // But I prefer to give Type "Warning" instead 2 } }
modified on Friday, November 5, 2010 10:53 AM