|
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)
...
|
|
|
|
|
Thanks a lot, that is the solution for all my problems
|
|
|
|
|
You're welcome. I wish all of my problems were like this one...
|
|
|
|
|
Erik's example above is a good way of making things typesafe.
|
|
|
|
|
Hi All,
I am new to .NET platform.
I have a C#.NET executable(.EXE) application. I would like to expose some interfaces for my client applications. What are the possible options for doing this?
Some of my ideas are..
1. Exposing interfaces via COM Interop
2. Using .NET remoting
Please help.
prvn
|
|
|
|
|
I think WCF[^] is better.
|
|
|
|
|
what happens if my client applications are not using .NET?
prvn
|
|
|
|
|
Then you're only interface of choice would be COM.
|
|
|
|
|
Is there any method to expose COM interface from C# executable(EXE)? All examples I have seen were to expose COM interface from C# class library.
Please help.
prvn
|
|
|
|
|
There's serveral different ways of exposing your objects through COM. None of them are what I would call ".NET easy". Which method is best for you depends on your skill level, COM knowledge, Win32 API experience, ...
Google for "C# out of process COM server" or "C# DCOM Server" and you'll get a ton of articles, opinions, pitfalls, and examples, but little in the way of documentation.
|
|
|
|
|
That depends on what your clients are using.
If, for example, your clients are using Java, you can find something about WCF-Java interoperatibility here[^].
If your clients are using COM+, here[^] is a point of start for WCF-COM+ interoperability.
You just have to search for WCF-(technology) interoperability, whichever the technology of your clients is.
|
|
|
|
|
WCF does not limit the subscribing applications to .NET. Remember that WCF is a communications technology and you can subscribe using pretty much any of the standard comms mechanisms, such as named pipes or TCP.
|
|
|
|
|
Akt_4_U wrote: Some of my ideas are.. 1. Exposing interfaces via COM Interop2. Using .NET remoting
If you are using C#, hese are both old technologies.
Web services might be a better idea.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
Hello,
I would print a PDF file on any printer X, how i can do this with c# ? thank you verry mutch.
|
|
|
|
|
There are many ways but, if you only want to print PDF files, I think this[^] is a good one.
|
|
|
|
|
|
Hi All,
I am designing brand new application using the following technologies.
C#
ASP.Net
AJAX
SQL SERVER 2005
Visual Studio 2008.
Approach's
3-Tier architecture
UI+BL+DL classical way.
UI+BL+DL with Application blocks.
N-Tier architecture<
UI+BL+Linq to SQL
UI+BL+WCF+database
Can you please help me which approach will give best performance.
Thanks & Regards
Rao
|
|
|
|
|
Please don't cross post. It's not cool.
|
|
|
|
|
Noone can answer that question. Since you haven't given any details about what the app is doing, how it's designed, the requirements, yada, yada, yada, ... It's impossible for anyone to answer this question at all.
|
|
|
|
|
Dave Kreskowiak wrote: Noone can answer that question.
Who is this guy Noone? He seems to know a lot.
|
|
|
|
|
Richard Andrew x64 wrote: Who is this guy Noone?
Him[^]?
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Dave,
Here are the details..
It is online Test Management System which includes Oral proficiency,Writing and Listening Tests(Like Prove it /Brain bench)with multi-lingual
Spanish,English,Chinese,Japaneses,Germany etc.
The application interaction as follows.
Candidate
Tester
Rater
Proctor
SalesRep
Appointment Availability
IVR System interaction
I really appreciate if you could help me
Thanks & Regards
Rao
|
|
|
|
|
dsrao wrote: It is online Test Management System which includes Oral proficiency
I would suspect that is going to be a very difficult feature.
At least presuming that the testing is supposed to be automated versus just video conferencing.
dsrao wrote: I really appreciate if you could help me
I would suggest hiring an architect and and someone with extensive experience in audio/visual programming.
Other specialities might arise depending on the first point above.
As per your first question your description doesn't really suggest anything that points to performance bottlenecks. But again that might depend on my first point.
|
|
|
|
|
Testing systems are not normally high performance systems, so your question is kind of meaningless.
Provided your backend data structure is designed properly, you shouldn't have any performance problems at all no matter how you design it.
|
|
|
|