Possible Duplicate:
iif equivalent in c#
I have several lines of code using IIF in VB.
I am trying to convert this code to C#.
HEre's an example where I need help.
intCurrency = IIf(or.Fields("Currency").Value = "USD", 100, 0)
How do I change the above line of code to CSharp? Is there a short-circuit evaluation operator in...
I was wondering how I would use the Dispatcher in WPF to safely update my BindingList collection from another thread?
I am also open for other solutions,
Many Thanks,
Kave
...
I'm running this code which appends a timestamp to a file everytime the cache expires, but the timestamps don't seem to match up with the absolute expiration tht i've applied
public void ProcessRequest(HttpContext context)
{
System.IO.File.AppendAllText("c:/test.txt", "new");
context.Cache.Add("test", DateTime.Now.ToString(), n...
Hi there,
I have the following HTML code:
<P>Notes: Mails: <BR> 1. <A href="mailto:[email protected]">[email protected]</A></P>
and of course when I try to pass it to string it gives me error:
string s = "<P>Notes: Mails: <BR> 1. <A href="mailto:[email protected]">[email protected]</A></P>";
Is ...
In the context of the Microsoft .Net Framework, I'm really curious about how mocking frameworks (Rhino Mocks, Moq, NMock, etc.) actually create the mock objects from a given type.
I'm interested in either the specific mechanics of one method or, if they use different methods perhaps some overview of the different ways. Alternatively, i...
i want to ask how to open specific file (the file out of the server, i have a relative path to it stored in config file) with its application when click on specific link button or hyper link...
like ::
open .docx with word.
or .pdf with acrobat reader
i tried several methods but , i get different errors like
"Cannot use a leading .....
Scala is a peculiar programming language in that it targets both JVM and the CLR. But what are the benefits? Is it worth considering it as a viable alternative to the F# language?
...
What I mean is, say I have a struct to represent some data and it looks like this:
struct LilStruct
{
public readonly short A;
public readonly byte B;
public readonly byte C;
public LilStruct(short a, byte b, byte c)
{
A = a;
B = b;
C = c;
}
}
A short and two byte values could all fit i...
I've come up with several manual ways of doing this, but i keep wondering if there is something built-in .NET that does this.
Basically, i want to reverse the bit order in a byte, so that the least significant bit becomes the most significant bit.
For example:
1001 1101 = 9D
would become
1011 1001 = B9
On of the ways to do this is to...
Hi all,
Community Wiki Question:
Pursuant to this question: What are the benefits of using Scala in .Net? another question comes to mind. Can anyone lay out the comparative advantages (and disadvantages) of Nemerle and F# for functional development on the .Net platform? I've just looked at Nemerle in passing. It sounds like it kind ...
Which method of returning a bool from a switch statement is preferable? I understand this may be subjective, however I feel it is important to our profession to get input on best practices :).
public bool foo(param)
{
switch (param)
{
case 1:
if (something)
{
return true;
...
I have a doubt regarding .net messaging & its compatibility with other open protocols out there. I would like to know if .net messaging API capable of working with STOMP protocol? How do i make use of this protocol? is there any specific library out there I need to use?
thanks for sharing your experience and ideas.
...
Hi everyone,
I have a .Net 3.5 application written mostly in C# that uses .resx files to store internationalization data for several different languages, consisting of strings, control sizes and positions, etc. What I'm trying to figure out is this: it is possible to compile my application in such a way that the default culture data...
I am looking for information on exchanging data with colleague. Use cases include pulling data from an applicant/student record, and notifying colleague of certain events. Information on uniObjects, ELF, and EDX preferably with a .Net flavor would all be appreciated. Looking for the most efficient way to get this done.
Thanks.
...
E.g:
isValidCppIdentifier("_foo") // returns true
isValidCppIdentifier("9bar") // returns false
isValidCppIdentifier("var'") // returns false
I wrote some quick code but it fails:
my regex is "[a-zA-Z_$][a-zA-Z0-9_$]*"
and I simply do regex.IsMatch(inputString).
Thanks..
...
So what I want is simple - control over processes that are ran on different connected (at least via ethernet) group\grid\cluster of PCs... something like "Parallel C#" but in form of array of .net libs and programs.
Is there any programmable parallel programming environment\framework for C# developers?
...
Page has a header and an iFrame. The iFrame has content from a 3rd party app. The 3rd party app is leaded from a different server than the page. The user will spend most of their time in the iFrame.
If the user spends most of their time in the iFrame the top page session will timeout.
What possible ways are there to prevent that? Is t...
I am looking for some kind of licensing solution for a .net application such that we can gen a license key during e-commerce checkout, or something a support person can generate and email to a customer. I'd like to have admin type capabilities, tracking key generations, adding products, features etc...
I did a quick Google search and a...
Currently, I do this:
Names -> "name1|name2|name3"
Resource.Names.Split('|');
Is it possible to define those names as an array in the resource file so that I don't have to parse by splitting every time?
Something like the following perhaps?
Names[] -> "name1"
Names[] -> "name2"
Names[] -> "name3"
Resource.Names; // is of type strin...
If you have a assembly identity/namespace of Library.Testing.
Then you created another assembly with identity/namespace of Library.Testing.One
Library.Testing.One project references Library.Testing.
Why is it you have to use using Library.Testing; in your classes in Library.Testing.One to access anything in Library.Testing?
Example1:
...