.net

telerik radgrid GridView1_ItemInserted - can I get a return value

I have a telerik radgrid that is doing an insert using an objectdatasource. The insert method the objectdatasource calls has a boolean return value that I want to check in the radgrid's ItemInserted event. Is this possible and what is the code to do it. I checked the GridInsertedEventArgs e and there is no way I can see to get the ret...

Check signature for x509 certificate

I have: x509 certificate (Base64); String data; Signature of string data (Base64). Is it possible to check signature? My code: bool valid = false; var signature = Convert.FromBase64String(base64Signature); var data = Encoding.UTF8.GetBytes(stringData); var x509 = new X509Certificate2(Convert.FromBase64String(certificate))...

Performance overhead for properties in .NET

I read somewhere that having public properties is preferable to having public members in a class. Is this only because of abstaraction and modularity? Are there any other over-riding reasons? The property accesses are conerted into function calls by the compiler. For properties without a backup store (e.g. public string UserName { get...

How to determine method parameter types during runtime in C/C++ under .NET ?

Hi all, in C# it is possible by using reflection to determine parameter types of some method as well as class members (method, properies..). I suppose that this is possible because of IL and .NET technology, right ? If so is it possible to use reflection or some similar technique for C/C++ writen under Visual studio 2005/2008/2010 .NET...

Convert byte array into any base

I have an array of bytes (any length), and I want to encode this array into string using my own base encoder. In .NET is standard Base64 encoder, but what if I want to encode the array in Base62, Base53 or Base13? Is it even possible to create such universal base encoder? I know I could do it the simple way, that is, for each byte rese...

Planning to make an application need help

Hi Guys, I am planning on making an application which automates some taks for me, these tasks are getting same file from two folder, setting folder name to current date + some text, making a .zip of the folder, opening outlook and attaching that .zip file to new mail. So can you guys advice should i make this application on windows wo...

Wrapping an API to support dependency injection

Hi, I am interacting with an API that just has static functions, and cannot be opened up and changed. public class WindowsNativeGraphAPI { public static IEnumerable<IGraphData> GetGraphData(); public static bool DeleteGraphData(IGraphData data); } I would like to be able to pass the API into a function or ...

VS2008 - CrystalDecisions.Shared.XmlSerializers

Hi, I upgraded web project from VS2005 to VS2008 and CR from 10.2 to 10.5. After that when i run the report i get this error: BindingFailure was detected Message: The assembly with display name 'CrystalDecisions.Shared.XmlSerializers' failed to load in the 'LoadFrom' binding context of the AppDomain with ID 2. The cause of...

Show an animation during a longer process on a windows form

I have a windows forms dialog, which does something for longer time after clicking a button. Because this takes while, I want to show an animation on the dialog (an anmiated gif, avi or whatever). How can I achive this. Do i need an own thread for this (I have no experiences with threads)? Can you provide me a code snippet how to achieve...

beautifying multiple XSD files

I have about 50 XSD files that are really badly formatted. I know if I open them all in Visual Studio, I can beautify them one by one. My question is: Is there a way to command line beautify them or some way I can do this in bulk? ...

Matrix TransformPoints vs TransformVectors

What is, in a "for dummies" interpretation, the difference between System.Drawing.Drawing2D.Matrix TransformPoints(pointsArray) <==> TransformVectors(pointsArray) ? Edit: there is also a VectorTransformPoints(...) method, by the way... :) ...

How do I make an custom drawn resizable container?

I have a WinForms gui application which has a number of areas to it which I'd like to custom-draw some graphics. These areas would contain controls and be resizeable. I'm currently thinking of inheriting from a TableLayoutPanel and handling onpaint messages. Does this sound like a good way to go or are there other/better options? ...

How to send an XDocument via MSMQ (using WCF)?

I have an order as an XDocument and I simply want to stick it in the body of a message and send it to an MSMQ queue. I've effectively serialized the order object already and now I just want to send it. Is this possible? I'm using WCF here but I'd happy with a plain old msmq solution. I'm getting an error here indicating that an XDocumen...

FNT font file in C#

Hi all, I would like to know if I can use FNT font file in c# .net. FNTs are not windows font file. If such fonts are available, can you please tell me how to load it and change windows form font to FNT? I use .Net GDI+ technology, but please let me know if WPF is better for this. Thanks, ...

Gradually refactoring pieces of a giant, monolithic VB6 winforms app to .Net

In a nutshell, the app looks up an instruction for something to do from a database, performs the action, and saves information about the success or failure of that action back to the database. It performs about 40 different actions, things like automating Office applications, copying files, running searches, etc. The application is a s...

How to easily log a dictionary of arguments and serialize to JSON using Trace in C#

I need a flexible way to log keyvalue pairs of arguments using System.Diagnostics.Trace. Basically, when I need to log something in code I would like to make a method call which passes a message and a dictionary of values. Its obviously not hard but I want to make it clean and if possible enforce the key names which are allowed. This is...

WCF Serialization Problem For XmlElement

Hi,everyone. I am trying to create an operation contract in WCF which is like the folllowing: [OperationContract] [WebGet] XmlElement GetXML(string id); I have same method in one of the ASMX service [WebMethod] XmlElement GetXML(string id); The issue here is that if I call the method on WCF and method on ASMX using http g...

Fuzzy data matching for personal demographic information

Lets say I have a database filled with people with the following data elements: PersonID (meaningless surrogate autonumber) FirstName MiddleInitial LastName NameSuffix DateOfBirth AlternateID (like an SSN, Militarty ID, etc) I get lots of data feeds in from all kinds of formats with every reasonable variation on these pieces of infor...

How can I control the URI of a service method?

I'm trying to create a WCF client to send XML messages to a CGI script. The script functions in a request-response pattern, where the contents of the XML message will determine the action to invoke. I've starting by creating a service contract to represent the defined set of documents the CGI script will accept: [ServiceContract] publi...

Asp Datapager - Javascript for postback -> Possible to generate normal html?

<asp:datapager id="pagerTop" runat="server" pagesize="5" pagedcontrolid="ListView1"> <fields> <asp:nextpreviouspagerfield buttoncssclass="paging-previous" previouspagetext="&lt;" buttontype="Link" showpreviouspagebutton="True" shownextpagebutton="False" ShowFirstPageButton="true" /> <asp:numeri...