I'm little confused, I know that delegates are like function pointers, and they are used to pass a function as a parameter into a method.
How does that fit into the event model?
Calling:
myButton.OnClick += new .....();
Is that internally just passing the method/function as a parameter when the event occurs and all the subscribers a...
I have the following Loaded event on my Window:
void Window_Loaded(object sender, RoutedEventArgs e) {
this.DataContext = new MyObject() {
MyDateTime = DateTime.Now,
MyNotEmptyString = "Not Empty",
MyNotUpperCaseString = "not upper case",
MyInteger = 20,
MyIntegerInRange = 1,
MyDouble ...
I want to allow the user to define a query which will be used to fetch some information. The database the user connects to is also user definable. Basically the steps that the user needs to perform are:
1/ Select the data provider (this is one of the providers returned by DbProviderFactories.GetFactoryClasses ())
2/ Configure the sel...
An abstract function must be implemented by all concrete classes.
Sometimes you want to force all derivative classes to implement the abstract function, even derivatives of concrete classes.
class Base { protected abstract Base Clone(); }
class Concrete : Base { protected override Base Clone(){...}; }
class Custom : Concrete {}
I wou...
I need to know where and how application settings (connections string) could be stored so that they can be changed at run time and saved.
I know in VS you can configure settings under Project>Properties and these get stored in the appname.exe.config file under apps install directory.But the "application scope" ones are not read/write at...
I recently started a new job where the office environment is Mac-based, but I will be developing in .NET and SQL Server.
I'm already pretty sold on installing VMWare Fusion to set up a virtual XP box, but I'm wondering if anyone would be able to recommend a solution for code version control. Specifically, should I be installing somethi...
Sample console program.
class Program
{
static void Main(string[] args)
{
// ... code to build dll ... not written yet ...
Assembly assembly = Assembly.LoadFile(@"C:\dyn.dll");
// don't know what or how to cast here
// looking for a better way to do next 3 lines
IRunnable r = assembly.Crea...
.NET has HttpWebRequest and WebClient for simulating a browser's requests.
I'd google it, but I'm not sure what keyword to use.
I want to write code that does does HTTP GETs and POSTs, along with cookies, in an applet or local jar and gives me back the response in a text string or some other parseable structure.
...
Is it possible to get button id that triggered postback in Page_Load void?
Tanks
...
How can I do a select in linq to entities to select rows with keys from a list? Something like this:
var orderKeys = new int[] { 1, 12, 306, 284, 50047};
var orders = (from order in context.Orders
where (order.Key in orderKeys)
select order).ToList();
Assert.AreEqual(orderKeys.Count, orders.Count);
I tri...
I am new to the Reporting Services provided within Visual Studio 2008.
I have created a matrix report with the data I want but would like to create Pie charts based on each row of the matrix. Is this possible?
...
hi There,
We have an application for which UI is built on Flex, and its consuming webservieces built on Dotnet hosted on IIS. we are trying to upload files which are around 100/200 megs , this works like a charm on LAN , if we try to do the same with web service hosted on public ip machines , then this would fail very often(obviously bc...
I'm writing a library and I want to put documentation in my functions so that it will show up in intellisense, kind of like how the intellisense for the built in functions shows descriptions for each of the parameters and for the function itself. How do you put the documentation in? Is it through comments in the function or is it in some...
A quick expression anyone please?
...
Yesterday I asked this general question about decimals and their internal precisions. Here is a specific question about the scenario I'm trying to address.
I have column in SqlServer that is typed - decimal(18,6).
When I fetch these values, the .net decimals that are created match the precision in the database. They look like this:
1...
Let's say I wanted to display a Button and a few RadioButtons. Based on which RadioButton is selected, I want to apply a different style to my Button. Is this possible in WPF?
...
I don't know if it's a strange question but how could I run a game made with XNA on the iPhone/iTouch ? Which steps/tools (existing ones or imaginary...) should be used ?
note: The goal is to avoid modifying existing C# code
UPDATE :
If I understand correctly, I must be able to:
1) Run my XNA code on Mono (monoxna or SilverSprit...
I once found a web site that had some 'Requires .net 1.0', 'Requires .net 2.0' logos for use on web sites etc, does anyone know the name of the site or where I can get something similar?
Thanks
...
I hava a jQuery UI datepicker which I intend to use with a textbox in ASP.NET MVC. The date-display in the textbox is localized via CultureInfo and of course should be recognized by jquery to select the correct date in the datepicker:
<%= Html.TextBox("Date", Model.Date.ToString("d", currentCultureInfo),
new { @class = "datepicker" ...
Duplicate: This is one of the earliest question on StackOverflow posted by Jeff.
http://stackoverflow.com/questions/11/how-do-i-calculate-relative-time
Does anyone know of a good library (or code snippet) for converting a TimeSpan object to a "friendly" string such as:
Two years, three months and four days
One week and two days
(...