.net

Can you get conditional control over serialization with DataContractSerializer?

I'm converting some of my classes to use DataContractSerialization so that I can include Linq Entities in the output. A sort of theoretical question popped into my head while I was in the process, and while I'm betting the answer is "No" I figured I'd pose the question anyway. Is there a way to conditionally serialize an object? For i...

.Net include page - like php require

Hi, Is there a c# command to include another web page - the equivelant of the php require? I know how to do server side includes but was looking for something code based. Thanks Thanks for the answers all. I think I might need to explain further. I have several sub-pages that I will be loading during the use of the site using an...

LINQ to SQL partial class OnValidate Changeaction.Delete

OK here's my problem... I have a LINQ partial class: public partial class resp { public IEnumerable<RuleViolation> GetRuleViolations() { if (String.IsNullOrEmpty(respName)) yield return new RuleViolation("Responsibility name required", "respName"); yield break; } public bool IsValid { ...

Reflector for Java?

Is there a Java equivalent to .NET Reflector? Edit: more specifically, decompiling is what I'm after. ...

C#: What is the ideal method of adding a splash screen to a project?

I'm going to input a splash screen to an application I'm currently working on that only consists of one form which we will call frmMain for now. I want to implement a splash screen (frmSplash) but need advice as to what would be the best way to implement it. The purpose of the splash screen will be to load necessary settings into textbox...

Generify-ing The .NET Background Worker

We're working on a Windows App that periodically has to launch operations which may take some time. We've gotten into a pattern of having these operations run on a BackgroundWorker, and writing up a quick WinForm for each operation, where you pass in to the form the necessary parameters, the form wires up the BackgroundWorker and makes ...

How to pull PostBack data into a dynamically added UserControl (.NET)?

I have a Panel on my Page: <asp:Panel ID="pnlTest" runat="server" /> Then I dynamically add a TextBox to it on Page_Load: TextBox simpleTextBox = new TextBox(); pnlTest.Controls.Add(simpleTextBox); simpleTextBox.ID = "SimpleTextBox-1"; Is there a way to pull in the information typed in this TextBox without pulling it di...

XSL Stylesheet won't parse XML generated by DataContractSerializer

I had some classes I was serializing out using XMLSerializer, then transforming using XSLT into various formatted emails or web service calls. All was well. We started using Linq in some parts of the data layer, and I needed to serialize out some of the Linq objects to be consumed by the XSL Stylesheets. I decided it was probably bes...

Implementing a Message Bus architecture

I'm currently doing analysis and design for a new message bus architecture in my company. I have tried MSMQ to do something like this in the past and it works well and was thinking of doing the same thing again for this project but using WCF as the API instead of using the System.Messaging API. Has anyone had experience with MSMQ in WC...

Can I read stored SMS entries on my Windows Mobile phone from a .NET CF application?

Looking at writing an application using the .NET Compact framework to extract SMS messages on my Windows Mobile phone. I basically want to be able to export the stored message in the inbox so that they could be imported to Excel or some other program for formatting and storage. In my personal case, I have a Treo 700w. I've written som...

How do I work with dial-up (RAS) connections in Windows using C#/.NET?

I need to be able to connect, disconnect, and re-connect a dial-up networking connection in a C# .NET Framework application. Creating the connection in the phone-book might also be useful/necessary. Are there any classes or libraries written for C# or .NET out there that wrap all this functionality nicely for me? Anyone have some code ...

masterpage module override

I have a masterpage which is set via a HTTPModule on PreInit(). HAPPY TIME! Problem is I need to override the masterpagefile value on a few pages due to a layout issue. Anyone know the best way? I tried adding a Page_Preinit on my page, but it is executed before the PreInit() in my module, so it ends up being reset there. I'm thinki...

Exposing Objects (DataContracts) that may not be directly used by a WCF service?

I have some object classes that use inheritance. It seems that I can only get access to the objects that are directly used by a service. Let me show you what I am trying to accomplish: [DataContract] public class Object1 { [DataMember] int Id {get; set;} } [DataContract] public class object2: Object1 { [DataMember] string N...

Running 32bit .NET application in 64bit OS, is it really bad?

I understand that we can compile a .NET Application by targeting AnyCPU which will cause to run 32bit in a 32bit OS and 64bit in a 64bit OS. However there was a reported bug* on a 64bit OS that my app was giving an error and the solutions for that, I need to target x86. Now my question: Is it really bad to target x86 even though when y...

Accessing an XML embeded resource file throws error in Release mode but not Debug mode.

.NET 3.5 Visual Studio 2008 Team Edition I have an XML file that I've added to an assembly via the Resources tab of the project's properties; and have marked the Access Modifier as public. While running in debug mode, there are no problems referencing the assembly and the embedded resource in another project, i.e., XElement errorMap =...

Do .NET GUI components support HTML (like Java swing does)?

HTML can be used in Java swing GUI components, like JTextBox, JButton, ... etc. Is there an equivalent to that in .NET (C#) WinForms? or at least some simple way of making a single word bold inside a textbox without using another GUI component? ...

Is Generating Debug Info (pdb) making my application slower in runtime?

In .NET applications is generating debug info (pdb) making my application slower in runtime? or do they only comes into the play when the application crashes? ...

C#: Can someone explain the practicalities of reflection?

So I tried searching SO hoping someone had a good explanation of this, with no luck. I asked another friend of mine a different question (which I've now forgotten) and his answer was simply "reflection" before he signed off. I am still very new to the C# world, having been an amateur VB.net programmer (also JavaScript, ActionScript, an...

Using Chunks in a PNG

I'm looking for a way to get and set those oddball chunks in a PNG file, namely in my case, the 'zTXt' chunk. Is there anything built into the .Net framework, or any other known assembly, that provides access this data? I'd like to avoid having to write an entire PNG reader/writer for this purpose if it has already been done. Thank yo...

GUI update when starting event handler class on separate thread?

We have a DLL that monitors changes in status and looks for events from a separate, purchased product. Actually, it is a ScreenPop API from Siemens, for those of you who may know what that is. I am using C#.NET 3.5 as the platform. This API takes a looong time to initialize, so we want to use a separate thread to initialize it. Curre...