.net

WPF Linear Fill

Hi, I have found some example code that creates a gradient fill in a WPF rectangle control: <Rectangle Height="{Binding ElementName=txtName}" Width="{Binding ElementName=txtName}"> <Rectangle.Fill> <LinearGradientBrush> <GradientStop Color="...

Why isn't there generic variance for classes in C# 4.0?

If we have it for interfaces, why dont we have it also for classes? What would be the problem that we would incurr when using it? Thanks ...

how to add a sidebar to a .net page based on a master page that doesnt have a sidebar.

Hello, I have been told that I should add a sidebar to one page of this .net project, but the master page don't include a sidebar. How can I add a sidebar to one page only ? This is the code for the Master Template, can anyone suggest or help me out here? I'd buy a book and read more, but I have to do this for the next 12 hours. <%@ M...

ASP.NET-MVC Page: image logo is not displaying while sending the email

Hi I have a page that sends an email on ASP.NET MVC Page. All the Text is displaying but the image is not displaying. Any workaround. Appreciate your responses. Here is my code: MailMessage mailMsg = new MailMessage(); mailMsg.IsBodyHtml = true; mailMsg.From = new MailAddress(Configuratio...

Is there a logging facade for the .NET world?

I'm somewhat new to the .NET stack and I was wondering if there is an equivalent to slf4j for the .NET platform. For me, logging to a Facade and being able to swap out logging implementations as needed just makes sense. Furthermore, the wrapper APIs available in slf4j have saved me many times when I needed to use a third-party library th...

Sizing issues while adding a .Net UserControl to a TabPage

I have a complex Windows Forms GUI program that has a lot of automated control generation and manipulation. One thing that I need to be able to do is add a custom UserControl to a newly instatiated TabPage. However, when my code does this I get automatic resizing events that cause the formatting to get ugly. Without detailing all of the ...

How to connect to NetRemoting server with Qt4?

Hi everyone. Is it possible to connect to net remoting server with qt4 library? If this is possible how to do it? Where can I find any informations about it? ...

What is the best way to implement this composite GetHashCode()

I have a simple class: public class TileName { int Zoom, X, Y; public override bool Equals (object obj) { var o = obj as TileName; return (o != null) && (o.Zoom == Zoom) && (o.X == X) && (o.Y == Y); } public override int GetHashCode () { return (Zoom + X + Y).GetHashCode(); } } I w...

Should I use "User Defined Functions" in SQL server, or C#?

I have a fairly complicated mathematical function that I've been advised should be implemented as a User Defined Function in SQL Server so that it can be used efficiently from within a SQL query. The problem is that it must be very efficient as it may be executed thousands of times per second, and I subsequently heard that UDFs are ve...

passing data to javascript on page load

I want to pass data to id <script language="javascript" src="/foo.aspx?id=1"></script> I have this code in a aspx page. The data should be passed on load, before this code is being executed. how can i do that? ...

FileUpload ASP.NET control not working under Windows 7

I have a User Control that contains a System.Web.UI.WebControls.FileUpload control as well as a button to 'Submit'. When the button is clicked code similar to the following is executed: If FileUploadControl.HasFile Then 'Save the file and do some other stuff End If This code works just fine with Windows XP. However, if I run it f...

Reference platform specific System.Data.SQLite

I am using SQLite for the unit testing and might use it as a database for local development/staging. The System.Data.SQLite has basically 2 versions: x86 and x64. Correct one should be used for the specific platform. I have 64 bit Win7, other guys in the team might use 32-bit OSs. The server's platform is not known at this stage. If I...

Is gratuitous use of 'var' keyword considered harmful?

Possible Duplicate: Use of var keyword in C# I use it almost all the time unless I'm not assigning to the variable immediately, in which case it's not an option. Good or bad? ...

Is there any live video stream editing open source project with API for my needs?

I need an open source project with an API capable of reading a live video stream (stream codec can be any API can read - I can provide with practically any live streamable one) giving me last image data for some processing (like brightness\contrast or more exotic filtering) being able to receive data I've changed and starting to strea...

VB.NET function that takes other functions as a parameter, and executes them

Hello, Is there a way in vb.net to create a sub/function that will take as an argument some kind of pointer to another function, and allow this new sub/function to execute the passed function? What I have are 10-12 xml-rpc functions I am calling against a remote server. Each of these functions has different argument lists (one takes 1...

Best way to test if an object is in a set of objects?

I'm trying to avoid using a long else if statement. Lets say I have an object and I want to test if it's of type ClassA, ClassB, ClassC, etc..? What is a clean way of doing this? ...

Is there a way to set two C#.Net projects to trust one another?

I have two C#.NET projects in a single solution ModelProject and PluginProject. PlugInProject is a plug-in for another application, and consequently references its API. PlugInProject is used to extract data from the application it plugs into. ModelProject contains the data model of classes that are extracted by PlugInProject. The extr...

WPF command/click argument

So I have a background in ASP.NET where a button could have a click handler or a command handler and then a command argument. That pattern was great for when you had a bunch of buttons that basically needed to execute the same block of code with only a slightly different argument. Is there a collary in WPF? From what I've seen of t...

c# - embed activex control remote desktop

scenario: user 1 is presenting his or her desktop to user 2. user 2 can view what's happening on user 1 on his(user2)'s screen, but cannot control it. got a hint from somewhere that by embedding activex control rdp will allow me to do so but i do not know where to start? is this sort of like collaboration? any help would be greatly a...

redoing object model construction to fit with asynchronous data fetching

I have a modeled a set of objects that correspond with some real world concepts. TradeDrug, GenericDrug, TradePackage, DrugForm Underlying the simple object model I am trying to provide is a complex medical terminology that uses numeric codes to represent relationships and concepts, all accessible via a REST service - I am trying to h...