struct SomeStruct
{
public int Num { get; set; }
}
class Program
{
static Action action;
static void Foo()
{
SomeStruct someStruct = new SomeStruct { Num = 5 };
action = () => Console.WriteLine(someStruct.Num);
}
static void Main()
{
Foo();
action.Invoke();
}
}
Is a co...
Hi.
I am just now learning about certificates and how to install them.
I am currntly following instructions as to how to design a profiling system
that allows me to access profile information via SOAP envelopes. Accordingly,
the instructions are asking me to install the aspnet_db and then the following
certificates:
1) IPkey.pfx...
For example, I would like to count how many numbers are in a string using a regex like: [0-9]
...
I want to have a save button that is only enabled when the view isdirty. How should I approach this?
My particular situation is a WinForms application using .Net 2.0. I have a service layer that the presenter calls. The service layer returns a screen bound DTO.
Is it ok to bind the view to this DTO and have the DTO implement an isDirt...
When referencing class properties from a function within the class do you use the value from the actual property or the private variable value?
Which way is best? Why?
public class
private m_Foo as double
public property Foo() as double
get
return m_Foo
end get
set(byval value as double)
m_Foo = value
...
I'm new to NHibernate, so this is a basic question..
When fetching data from the database through an NHibernate session I've only done it using the Id this far, e.g. like this:
var customer = Session.Get<Customer>(customerId);
But how do I fetch an object based on a property that isn't the Id? E.g. fetch a customer by search on th...
I have a textbox.Leave event handler and now I can't tab out of the textbox (I can still click out).
This is how the event is added:
[...from the form...]
EKFG_Sig.Config.AutocompleteManager am = new EKFG_Sig.Config.AutocompleteManager(this.GetType().FullName);
foreach (Control c in this.Controls) {
if (c...
I am new to C# and have a VB sub routine for sending emails.
I am not sure how to convert to C#, can someone please help me?
here is the sub:
Sub SendAdditionalEmails()
Dim strDelimeter As String = ","
Dim strEmailResult As String = ""
'make sure they dont put a comma on the end (To)
If InStr(Len(txtTo.Text) - 1, txtTo...
Hi,
I've an enterprise database store used by some rich applications and a website with it own database store.
Enterprise application work with local data and some of these data (like orders,prices ...) have to be "synchronized" to the web site datastore.
On the other side, internet customers are able to edit their profile which have ...
I have a list of items that have a partial order relation, i. e, the list can be considered a partially ordered set. I want to sort this list in the same way as in this question. As correctly answered there, this is known as topological sorting.
There's a reasonably simple known algorithm to solve the problem. I want a LINQ-like impleme...
I'm working on a new toy language that will be statically compiled to .NET's IL code.
Off hand I can think of the following to actually generate the IL, but I'm open to alternatives:
Cecil
ILASM
...
I have a view that shows a list of items and when you click on one of them it will take you to the items page. I also store a "Viewed" flag in the database for that item.
Now, when the user clicks back, the item should be styled differently because of the change in the "Viewed" flag. However, every time I click back, it is as it was b...
Firefox is for some reason not properly handling content sent through my .NET HTTP handler; it appears to be not honoring the content type header. Rather, it sees the content as being HTML. The URL mapped to the request even has a .csv extension. Internet Explorer and Chrome are doing the right thing. The problem is happening for bot...
I'm splitting up an N-tier stack to allow independent scaling of the tiers, better deployment independence, and I'd like to know what people are currently choosing for service-boundary communication technologies.
The service itself and all of the "clients" to the service will have access to one another over an internal network and are c...
I'm currently using something like
c#
var myvar = directcast(myarrayofstruct.clone(), mystruc());
vb.net
dim myvar = directcast(myarrayofstruct.clone, mystruc())
is there a better way?
...
I'm writing code that is part of an automation system. I wanted to add a keyboard hook to end the test prematurely, and I did this by using SetWindowHookEx.
My code looks pretty much like this: http://support.microsoft.com/kb/318804
Here's my SetWindowsHookEx call:
hHook = SetWindowsHookEx(WH_KEYBOARD_LL, KeyboardHookProcedure, GetMo...
I have a Windows Forms application in .NET 2.0 with a PictureBox on a form and I load it with an animated GIF by setting the PictureBox's ImageLocation property. When it is time for the animation to render the next frame, I get the following exception and stack trace:
A generic error occurred in GDI+.
at System.Drawing.Image.SelectAc...
Why would I want to use java portlets above tomcat and gwt?
Would portlets make it less- or un- necessary for me to use jsp and jsf?
Has Jboss been part of the portlet evolution culture? Does Jboss satisfy the portlet jsrs?
What portlet implementation/brand would run on gae java and gae python?
Are portlet specs due to peer pressure fro...
Hi All,
With over a week off of work I wanted to try out a bunch of new stuff at home. What I've done is written a simple TicTacToe game that I want to incorporate things into that I've never worked with before. I have three main ideas first.
TCP/IP ability so that the app can be played over the internet.
Learn how to integrate tests ...