.net

Can't create xmlns reference to other project in XAML

I have a WPF project defined like this: MyApp.sln MyAppWPF MyApp.Domain In one of my xaml files in the MyAppWPF project I'm trying to reference a class defined in MyApp.Domain project. I have a project reference in MyAppWPF to MyApp.Domain. I am trying to create the reference like this: <Window x:Class="MyAppWPF.Window1" ...

What different ways can you write this

There are some cool and exciting features in .NET 3.5/C# 3.0, and with those features comes some darn interesting ways to write the exact same line of code. Using the above stated tool set (and by extension .NET 2.0 stuff), what are the different ways the below code snippet could reasonably be rewritten? string uploadDirectory...

Force .NET webservice to use local object class, not proxy class

I have a webservice that I'm calling from a windows forms application (both .NET, both in the same solution), and I'd like my webservice to return a custom object from elsewhere in the project - it's a common object that they both share a reference to, as it's in the third project in my solution. When I call the webservice, it returns a ...

Is there a way in .Net to programatically generate a DTD from an existing XML file?

I've been looking around the System.Xml namespace, but don't see anything that would support this. Does anyone know if it's built into .Net, or would I have to obtain a third party library to do it? NOTE: I wish it were as simple as generating an xsd, but that won't do for my specific situation. ...

ASP.NET MVC and WCF

I'm working my way into MVC at the moment, but on my "To learn at some point" list, I also have WCF. I just wonder if WCF is something that should/could be used in an MVC Application or not? The Background is that I want a Desktop Application (.NET 3.5, WPF) interact with my MVC Web Site, and I wonder what the best way to transfer data ...

uxtheme equivalent for opengl (or directx)?

When you use WPF (which uses DirectX) you quickly notice one fact that WPF themes are independent from windows themes and styles. I'm playing with GUI using opengl on windows and right now I have one problem: I want to use windows themes and styles. I don't want to go WPF route and make it independent. I know that all information about i...

What are the options for generating user friendly alpha numeric IDs (like business id, SKU)

Here are the requirements: Must be alphanumeric, 8-10 characters so that it is user friendly. These will be stored as unique keys in database. I am using Guids as primary keys so an option to use GUids to generate these unique Ids would be preferable. I am thinking on the lines of a base-n converter that takes a Guid and converts to an...

Exception when creating new DispatcherTimer()

I'm creating a new DispatcherTimer() in Silverlight 2.0, and the constructor call throws an exception: DispatcherTimer timer = new DispatcherTimer(); This line throws before I can set Interval, Tick, or Start the timer. System.Exception was unhandled by user code Message="Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_U...

Is there a good graph (not charting) visualization API for .Net?

I've looked at Microsoft GLEE (non-commerical use) and other libraries for drawing graphs, but I need a good commercial use graph API to show complex routes through the Internet. I need to be able to show a large number of nodes and vertexes. Any Ideas? ...

Trying to get DXperience under Linux: I get "Windows Installer 3" required when installing .NET 2.0 under wine in SLED

I want to try out DXperience component suite on Linux (Suse Linux enterprise desktop). Since it relies heavily on the PInvoke calls, Mono would not work out here. Some people were able to get this running by installing .NET 2.0 under wine on Linux. I've tried to do this with the winetricks and manually. Every time .NET 2.0 install on S...

Single WCF Service to multiple client connections

I have developed a VB.NET WCF service that recives and sends back data. When the first client connects it starts the data output that continues also if the client is closed. If a new client connects then a new object is created and the data output starts at the begninning and continues in parallel with the old instance. Is there a way to...

Using Entity Framework entities as business objects?

I'm using Entity Framework O/R mapper from Microsoft and using entity classes (generated classes that are mapped to DB objects) as a business objects. Is this OK? Please state your cons or pros. What to do in a case of WCF communication between business layer and presentation, how to send those objects as data members? ...

.NET autogenerated web-service client: How do I avoid requesting schemas from w3.org?

I have a .NET web-service client that has been autogenerated from a wsdl-file using the wsdl.exe tool. When I first instantiate the generated class, it begins to request a bunch of documents from w3.org and others. The first one being http://www.w3.org/2001/XMLSchema.dtd Besides not wanting to cause unnecessary traffic to w3.org, I nee...

How do you display Taskbar notifications?

How would one go about displaying taskbar notifications? I want to write an app that periodically displays a flash card esque notification, the intention is to see if a 5 second or so distraction every hour can help with language learning. Target language is c# ...

Using C# to display powerpoint

Is there any good way to use a windows application written in C# to display/control a powerpoint slideshow? Ultimately I would like to show thumbnails in a form and clicking these thumbnails would advance the slides shown on a second monitor (similar to using Powerpoint itself to show a slideshow on a second monitor). I would like to be...

Reading/writing INI file in C#

Is there any class in .Net framework that can read/write standard ini files: [Section] <keyname>=<value> ... Delphi have TIniFile component and I am looking if there is anything similar for C#. ...

Data-bound TextBox: can't exit

Hi, I've got a text box bound to an object's property (in fact several text boxes) on a form. This for is an editor for an object. When i'm editing some objects and modify values in the one of the text boxes i can't exit from the text box (neither by tab nor clicking on another text box). However that's not always the case - when editin...

What's the difference in these ways of creating the static instance for a singleton?

I have had a bug recently that only manifested itself when the library was built as a release build rather than a debug build. The library is a .NET dll with a COM wrapper and I am using CoCreateInstance to create a class from the dll in an unmanaged c++ app. When I finally tracked the bug down it was caused by accessing a singleton ob...

Get the current working directory for cmd.exe

How can I retrieve the current working directory of cmd.exe? This seems possible. For example using ProcessExplorer, select CMD.exe, right click, properties, Image tab, "Current Directory" relects the directory set using the CD or CHDIR commands. I've looked at the .NET Process and ProcessStartInfo classes (ProcessStartInfo.WorkingD...

How do I get the contents of an XML element using a XmlSerializer?

I have an XML reader on this XML string: <?xml version="1.0" encoding="UTF-8" ?> <story id="1224488641nL21535800" date="20 Oct 2008" time="07:44"> <title>PRESS DIGEST - PORTUGAL - Oct 20</title> <text> <p> LISBON, Oct 20 (Reuters) - Following are some of the main stories in Portuguese newspapers on Monday. Reuters has not verified t...