.net

How can I change the xml:base published by a WCF Data Service?

Hi, I have a WCF Data Service for which I have a custom URL Rewriter so the real url is not visible and I can add special elements in the path for customizing it. For example: http://localhost/Data/ABCD.odata/ Maps to: http://localhost/Data/OneData.svc/ This almost works except that the service is publishing back in the response XML ...

Is it possible to call unmanaged code using C# reflection from managed code ?

Hi all, Is it possible using reflection and C# .NET to call dynamicly different function (with arguments) written in C or C++ before .NET came(unmanaged code) ? And smole C# example if possible would be appreciated! Thanks! Br, Milan. ...

Webservice description - xsd schema and xml generation

Hello I want to design a WebService for communication between Win Mobile 6.5 based Palm device and a PHP web server. The Palm device software will be developed on .NET compact framework. The communication between web server and device I envision as XML over HTTP. I want a tool that will let me design the Webservice (interfaces, methods)...

Linq: read node innertext

i have a xml document like this: <ns:a xmlns:ns="http://NS1"&gt; <ns:b> <c xmlns="http://differentNS"&gt; c_text </c> <x xmlns="http://differentNS"&gt; Wanted </x> <d xmlns="http://differentNS"&gt; d_text </d> </ns:b> </ns:a> Now i want to use linq to read the element's "x" inner text. ...

Why .Net Vs Java

Looking for good supporting documents/articles which would give some good reasons to our management why .Net is better than Java, especially with the latest technologies such as WCF, WPF, WWF, and asp.Net/Silverlight why .Net is a better choice. Please let me know if you have any good references/articles which may be helpful. Thanks N ...

Calling a generic function in VB.NET / C#

Question: I want to call a generic function, defined as: Public Shared Function DeserializeFromXML(Of T)(Optional ByRef strFileNameAndPath As String = Nothing) As T Now when I call it, I wanted to do it with any of the variants below: Dim x As New XMLserialization.cConfiguration x = XMLserialization.XMLserializeLDAPconfig.Dese...

WPF Graph Layout Component

Does anyone know of or even better.. can wholeheartedly recommend a WPF graph layout component (Microsoft Research had GLEE a while back but it hasn't been updated after 1.0 since 2007 and isn't WPF etc) as seen e.g. in the screenshot below? I've seen yFiles WPF and Lasalle's AddFlow for WPF, but are there any alternatives? (c) Scree...

Weird switch behavior in .NET 4

I have a problem understanding what's causes the compilation error in the code below: static class Program { static void Main() { dynamic x = ""; var test = foo(x); if (test == "test") { Console.WriteLine(test); } switch (test) { case "test": ...

Can any of the .NET Parse methods handle a hex string prefixed with "0x"?

I tried parsing a number with .NET Int64.Parse method, and it won't accept a string like "0x3039", even though that's how you write the constant in C#. The documentation specifically disallows the string to have a "0x" prefix, and a trailing "h" doesn't seem to work either. To parse a hexadecimal number, I must have to use the System.G...

What is the best way to call a method right AFTER a form loads?

I have a C# windows forms application. The way I currently have it set up, when Form1_Load() runs it checks for recovered unsaved data and if it finds some it prompts the user if they want to open that data. When the program runs it works alright but the message box is shown right away and the main program form (Form1) does not show unti...

What does Silverlight offer?

I'm working with C# and WPF and I would like to study something related to web programming. I already know HTML and CSS, and since I'm working with WPF, I am wondering if going into Silverlight is a good choice to start web developing. Can it be a substitute of server-side programming languages, like PHP or ASP .NET? What do you suggest?...

Built in background-scheduling system in .NET?

I ask though I doubt there is any such system. Basically I need to schedule tasks to execute at some point in the future (usually no more than a few seconds or possibly minutes from now), and have some way of cancelling that request unless too late. Ie. code that would look like this: var x = Scheduler.Schedule(() => SomethingSomethin...

How to take all types from PE file after parsing it in Managed C++(CLI)?

Hello, I need to extract the types from PE files. e.g if whole class exported , I should have all exported methods(whole signature including return type) and their types(i.e class as Type) OR IF whole class not exported but just functions exported, I should be able to get class as Type of those methods and all exported methods of that c...

How do I stop and empty tag in XML serializer?

I have an object like this, public class UserObj { public string First {get; set;} public string Last {get; set;} public addr Address {get; set;} } public class addr { public street {get; set;} public town {get; set;} } Now when I use XmlSerializer on it and street and town are empty I get this in the XML outp...

[.NET] Which NotifyCollectionChangedAction is used to indicate that an item changed?

When implementing INotifyCollectionChanged and raising the CollectionChanged event, you must provide a NotifyCollectionChangedAction argument. Which NotifyCollectionChangedAction is used to indicate that an item in the collection has changed, such as in the case where an item's value changes? ...

Switch statement in compiled query possible?

Is it at all possible to use something like a switch statement in a compiled query for linq to entities/sql? For example when returning sorted records from the database, I would like to use a switch-like statement within one compiled query to sort on different properties, instead of having to write 2 compiled queries (ascending & descend...

CultureInfo.DisplayName going Sami on me

Why is CultureInfo.DisplayName in Sami all of a sudden? I use it to display a list of country names. Not a good idea perhaps but it worked until recently and I'm quite sure it was in Swedish (I guess it could have been English.) MSDN says This property represents the localized name from the .NET Framework version. For example, if t...

How to access a value in another control

I have two controls on one page and need to access another control's values. I believe doing something like me.page .... something is along the correct lines but much help would be appricated! Thanks ...

Get information from a higher class?

I don't know really how to word the question so please bear with me... I have 3 classes: Server, Database, and Table. Each class has a "Name" property. How I want it to work is that each server can have multiple databases and each database can have multiple tables. So in the Server class I have this property. Private _databases As List...

Remove XML comments using Visual Studio 2010 Web Config Transformation

We are using Team Build to handle our deployments to our development server, and we have a need to remove comments from our web config when it's transformed. Does anyone know how to remove the "" comment lines from the web config file using a transformation? ...