Articles tagged with: c#
Microsoft Excel is beloved tool to work with tables. Therefore it is really valuable for end user if an application can export its data into Excel. However today a lot of business application are web application which cause a problem with Excel because the Excel is not installed on web server. Export data to Excel with COM Remote Control of Excel Object Model does not always work fast and reliable.
Since Excel 2003 there is a …
When I was trying to extract the first frame of SWF file into image I discovered that there is a small problem when we try to host a SWF file in WPF application because WPF does not allow us to integrate ActiveX control directly in its application. To enable interaction through ActiveX control, we must do a walkthrough with WindowsFormsHost. In this small example below I would like to guide you step by step to …
When we create interactive 2D drawing applications in WPF, we can deal directly with the user’s
interaction with the graphics objects using mouse event handlers. However, WPF provides powerful hit-
testing for graphics objects through the static VisualTreeHelper.HitTest method.
In order to use this advanced hit-testing feature, we need to create a callback. The VisualTreeHelper
will then walk through your visuals from top to bottom. Whenever it finds a match, it calls the callback
with the details. We can then …
When I wrote a small application with Client-Server model which sends data over TCP socket, I would like to build an intelligent way which serialize all of my data into stream, send this stream over socket and deserialize it back at server/client site. Using serialization all of data will be stored in stream or byte array and it is completely suitable for communicating over socket. To convert our object into stream using serialization is …
Today I read a blog on http://weblogs.asp.net/bleroy/archive/2009/12/10/resizing-images-from-the-server-using-wpf-wic-instead-of-gdi.aspx which introduces a new way to resize image with WPF. This new method does not use GDI+ (Microsoft Windows GDI+ is the portion of the Windows XP operating system or Windows Server 2003 operating system that provides two-dimensional vector graphics, imaging, and typography.) but it uses WPF library for resizing images very fast. You can read more details about this method in that blog. In the code below, …
During my development I must find a way to notify about changes in properties of class during threads are running. To invoke event relevant to properties, we can use available EventHandler delegate or create our own one (you know that if we use our own, we always have flexible way to handle event). In this small example below I would like to demonstrate how we can create our own delegate.
This example creates a class PCProducer …
When I read a thread on mycsharp.de, I discovered a library which allow us to use LINQ in any application written on .Net Framework 2.0. It’s really great if we have this feature without installing mega framework 3.0. The library can be downloaded from google code http://code.google.com/p/linqbridge/downloads/list . You can download online .cs file or a .dll file as you link but I prefer using a .cs because I don’t have to merge .dll file …
During my development a tool to download music file through MMS protocol I had to convert a packet to a byte array and send it through socket to the server. Each packet has its own format and therefore the simple way is to implement each class for each packet and insert a function GetBytes() to each class to convert all fields in packet into byte array. The problem is that the fields have various format …
