.net

Is it possible to configure the mono default font for menus?

The winforms default font for menus in mono (Ubuntu 10.04) does not support german umlauts. While I can set the font for form content (this.Font), I could not figure out where to configure the menu font. Any suggestions? Edit: I am now using a ToolStripMenu which uses Parent.Font as Font. Works fine. ...

ASP.NET how to get Cache in KB used for this application ?

I need to know what is Cache size. I've read solution on this site for more or less similar question but it partly serves me. As i know i can get values from PerMon, here is function public static string getCacheSize() { PerformanceCounter pc = new PerformanceCounter("ASP.NET Applications", "Cache % Machine Memory Limit Used","__TO...

C# Outer Apply in LINQ

How can I achieve Outer Apply in LINQ? I'm having a bit of a problem. Here's the SQL Query I'm using. SELECT u.masterID ,u.user ,h.created FROM dbo.Users u OUTER APPLY (SELECT TOP 1 * FROM UserHistory h where h.masterID = u.masterID ORDER BY created DESC) h ...

.NET: Problems creating email attachment from MemoryStream.

Hi all I'm using the following method to create an attachment from a MemoryStream: public void AddAttachment(Stream stream, string filename, string mimeType) { byte[] buffer = ((MemoryStream) stream).GetBuffer(); Attachment attachment = new Attachment(stream, filename, mimeType); _mail.Attachments.Add(attachment); } Note that t...

Is Embed Resource a good approach for a read only xml database?

I have an open source application (here) This application get a character or a sentence and give some unicode information about it. Iuse Unicode Character Database which provided by Unicode.org this is a XML document (130MB) At first I embed this XML to my DLL but I don't know is it a good approach or no. because DLL size growth just ...

How can I make this Dictionary TryGetValue code more readable?

I'd like to test if an id was not yet known or, if it is known, if the associated value has changed. I'm currently using code similar to this, but it is hard to understand for those not familiar with the pattern. Can you think of a way to make it more readable while keeping it short in LOC? string id; string actual; string stored; if (...

what is IEnumerable in .net

what is IEnumerable in .net? ...

A Plot Graph .NET WindowsForm Component Free

Hello All, I'm searching for a plot .NET component to plot a 2D line chart, given an array of data. It will be used with WindowsForm (C#) and It will be very helpful if it could be freeware. It is for a scientific application. This is my first asked question in stackoverflow, and excuse me for my terrible English written. ...

HTTP response differences between browser's view source and netcat's output

I'm looking at a website using Internet Explorer and Firefox. In each browser I select view source and see the website's URL in the links. These links were concatenated together using HttpContext.Current.Request.Url.Host in the code behind. However, when I use netcat or Burp Suite v1.3.03, looking at the same links I see the servername i...

Zoom a Rectangle in .NET

In a WinForm I use rectangles, ovals and lines of Microsoft.VisualBasic.PowerPacks. Is it possible to make a zoom on it? How? ...

VisualStyleRenderer and themes (WinForms)

I have my own TreeView control which is completely OwnerDraw'n: myTreeView.DrawMode = TreeViewDrawMode.OwnerDrawAll; What I try to achieve is to draw the opened/closed glyph according to the current explorer theme. Especially on Vista and Win7 boxes I'd like to see the new glyphes (black triangles) instead of the plus/minus signs. I...

Dictionary.ContainsKey return False, but a want True

namespace Dic { public class Key { string name; public Key(string n) { name = n; } } class Program { static string Test() { Key a = new Key("A"); Key b = new Key("A"); System.Collections.Generic.Dictionary<Key, int> d = new System.Collections.Generic.Dictionary<Key, int>(); d.Add(a, 1); ...

Get just the hour of day from DateTime using either 12 or 24 hour format as defined by the current culture

.Net has the built in ToShortTimeString() function for DateTime that uses the CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern format. It returns something like this for en-US: "5:00 pm". For a 24 hour culture such as de-DE it would return "17:00". What I want is a way to just return just the hour (So "5 pm" and "17" in the ca...

Multiple .NET processes memory footprint

I am developing an application suite that consists of several applications which user can run as needed (they can run all at the same time, or only several..). My concern is in physical memory footprint of each process, as shown in task manager. I am aware that Framework does memory management behind the curtains in terms that it devot...

Can a single solution hold projects from multiple repositories?

I've begun setting up SVN repositories to store my code, and am wondering if a single Visual Studio solution can have projects from multiple repositories. I have a shared library with different helper functions, generic custom controls, etc, that are used by multiple projects, and hosted in its own repository. Then I have my project repo...

WSDL.exe tool - generating code for .NET Compact Framework

Hello Is the wsdl.exe tool capable of generating proxy code for .NET Compact Framework 2.0? Regards Dominik ...

Data Application based on OO Concepts

I'm looking for an application developed in C# with following qualities, which is available as source code. Based on OO Architecture Must connect to DB. Must handle atleast a "one to many master child" relationship (eg: Order and items ordered) Should display the data using Datagrid or other similar controls. Reports (either with repor...

Outlook Object Library for Visual Studio

Our office is running two different versions of MS Office (2007 and 2010). Is there a way for me to integrate Outlook into a C# project and have it work for both versions of Outlook? I have added a reference to Microsoft Outlook 14.0 Object Library, but for users of Outlook 2007, do they require version 12.0 or will the newer version wor...

i am facing some problem while passing parameter to crystal report? it is asking for the password of sql server?

protected void Page_Load(object sender, EventArgs e) { ConnectionInfo myConnectionInfo = new ConnectionInfo(); myConnectionInfo.UserID = "sa"; myConnectionInfo.Password = "********"; setDBLOGONforREPORT(myConnectionInfo); //When i don't write this code it does not ask for the passowrd //but doesn't ...

How to create a runnable setup out of bootstrapper packages?

I would like to install a .NET 4.0 application on the user's machine that does not meet certain prerequisites. I need to be able to define the installation order of these prerequisites in my installer, because they depend on each other (.NET 4.0, Windows Installer 4.5, SQL Server 2008 R2 and others). AFAIK this is doable via the follow...