.net

Measure performance of WPF rendering

I have ListBox. ItemsSource of this control is binded to ObservableCollection. I want to measure time which starts when I changed ObservableCollection and ends when user saw updated content in the ListBox. The main problem here is how to determine this moment when control is rendered. I need to do it in the code to write measured time i...

Is it possible to consume a .Net WCF 4 Web Service by a non-.Net language?

I've been beating my head against a problem for about a week and am now resorting to just a "is it even possible question". Can other language connect to a web service that is written using .Net's WCF 4 framework? When WCF first came out years ago (under .Net v3.0/winfx), I was able to connect a Java client to it using the basicHttpBi...

Charts in .NET and WPF

Hello! I am developing an application using VS 2010 and WPF... I need to put a simple 2 line 2D line chart... However the other developer used WPF toolkit but it didnt work at clients machine... The grid of the chart was badly disorted (not straight lines!) in windows XP! but running other versions of windows was ok. I am wondering what...

Reference Class Library in Sql Server Clr Project

I am trying to reference a class library from a Visual C# SQL CLR Database Project but I get the error A reference to 'class library' could not be added. SQL Server projects can reference only other SQL Server projects. Is there a way to add the reference so I don't need to duplicate the code in that class library? EDIT - Solutio...

Panel not scrolling to focused control when input panel opens

Working on a Windows Mobile 6.5 application and having an issue that I would think would be handled automatically. I have a panel on the form and have it's AutoScroll property set to true. Have a textbox that shows an inputpanel on focus. For testing, I place the textbox outside of the visible panel to force the scrollbar. Clicking i...

different types of exceptions in .net

What is the purpose of having so many types of exceptions in .net? Why not just use Exception? Some of them are EndOfStreamException, FileLoadException, FileNotFoundException, IOException, InvalidTimeZoneException...... ...

can't shorten the interface

I have this property, which is working fine: public IEnumerable<IGrouping<MessageType, Message>> MessageGroups { get { return (from msg in _messages orderby msg.Type descending group msg by msg.Type); } } However, it's causing me to have to repeat the ugly-looking IEnumer...

Repeating content with Office Open XML

I've been checking out what is possible with the Office Open XML specification for documents. I'm particularly interested in being able to add custom XML content to a document and binding it to content controls. I was wondering if it is possible to have a repeating content control type? For example, say I have some custom XML in my .d...

ObjectDataSource filtering on date/time in SPGridView

I'm scratching my head on this one... I have date/time columns which I want to sort by date/time but when filtered, only filter by the date part of the date/time. My filter code (a lambda contained within a setup method) looks like this: this.taskGrid.AllowFiltering = true; this.odsGrid.Filtering += (sender, e) => ...

iPhone app- How to upload image to .net C# WCF?

Hello Guys, I have a WCF service that my iPhone app is connected to. Now I need to add an upload photo feature to my iPhone app. That said, I needed to have my WCF service to accept Images and save it to my server. Any idea how to achieve this? I did googling for some possible solutions but neither of them works for me. Your responses...

Using integer based enum

Is it possible to do the enum without having to do a cast? class Program { private enum Subject { History = 100, Math =200, Geography = 300 } static void Main(string[] args) { Console.WriteLine(addSubject((int) Subject.History)); //Is the int cast required. } private static int addSubject(int H) ...

.net mySQL Connector for a 64 bit machine

My local computer is 64 bit but the downloads for the .Net mySql connector found here: http://dev.mysql.com/downloads/connector/net/ are 32 bit. I installed the 32 bit file however, whenever I try to input any new connector information after the 1st keystroke the box disappears. So I'm assuming that it has more to do with my machine be...

Using Reflection to call a function in a dll is not working

Here is the code from the dll: public static bool SendCommand(string command) { KillTeraTerm(); try { SerialPort portToUse = new SerialPort("COM2"); portToUse.Open(); portToUse.WriteLine(command); portToUse.Close(); StartTeraTerm(); ...

When do I need to implement INotifyPropertyChanged?

I have seen apps implementing this interface everywhere. In many cases, we could use the new property syntax like public int Foo { get; set; } which I like very much. However, in order to implement this interface, this one has to turn into 10 lines or so. This makes the code very cluttered, and I'm not sure if it also hurts performan...

How do I make an image follow the cursor even outside an application?

In VB.Net with Winforms how do I make an image follow the cursor even when it leaves the form? I want to do this during a drag and drop operation. BCL and/or GDI is better for my usecase than P/Invokes. If you are familiar with PeaZip, it does something of this sort when dragging a file from it's interface. ...

.Net file compression libraries

I'm looking for a package to use in my project to compress some xml files. I use WinRAR usually to compress files, and I think you can do this using the 7zip project and this can be included in a .Net project. This is a similar question here: http://stackoverflow.com/questions/153678/7-zip-7za-dll-net-wrapper and the CodeProject exampl...

.NET: What is the maximum recommended size of a value type?

What is the maximum recommended size of a value type? I think I read that Microsoft suggests that they are not being larger than 16 bytes, but I can't find the reference. ...

A Better ComboBoxCheckBox?

Does anyone know of a better custom control of a ComboBoxCheckBox than this one: http://www.codeproject.com/KB/combobox/extending_combobox.aspx? Preferabbly open source, but if not, paid. I've looked around and can't seem to find even a commercial one (then again, I don't know of that many .NET control vendors). What better? A better .D...

.NET class access modifiers (friend and public)

I am developing a class library that will be used in several projects. In my class library, I have a "Shape" Class which has a number of properties. One of these properties is "Dimensions" returns a class with "Height" "Width" and "Depth" properties. How would I suppress the Dimension class from being viewable in the editor, whilst fre...

.NET including class library database (and other resources) with windows app deployment

I have a class library that attaches itself a tiny SQL Server database that resides in its Data Directory. When i'm using this class library with another windows application i see that once i compile my code, the database files get copied to the bin folder of my windows app project. However when i publish the windows app,install, and run...