Write to XML with C#
So we can read XML in a variety of ways (one example here, and another here). So can we write it in C#? Of course we can! So lets jump right into shall we?
Click Here To Continue Reading …
Solution Folders in Visual Studio 2010 Explained
If you are new to Visual Studio, you may not be familiar with how “Solution Folders” work. Visual Studio allows you to group together any number of sub-projects that your root solution may contain. However, what is strange about Solution Folders in Visual Studio is that they do not create the same logical structure on your disk. Solution Folders will not create a mirror on your hard drive. They just create a logical grouping inside your Visual Studio Project. They will not move files around, or create directories for your projects when you create Solution Folders and place your projects inside them. It is a good practice to have your logical project structure to have a one-to-one relationship with your physical directory structure, and the behavior of the Solution Folders do not follow this. But there is a way for Visual Studio to create the physical structure on the disk when adding projects to the solution.
Click Here To Continue Reading …
Using LINQ to Extract Information from XML in C#
Yesterday I talked about using C# to extract information from a simple XML file. Well today we can take it one step further. Instead of using the regular XML library and commands, we can use LINQ to build a query to extract the information we desire, and place it into our object list.
Click Here To Continue Reading …
Extracting Information From XML With C#
XML is a wonderful way to store information that needs to be read in by a machine or piece of software. It is simple to follow, and you can use it to store and transmit your custom data structures and information across an internet connection or in between bits of software on a local machine. C# has methods built in that can read and write XML files. So today I have put together a little program that will extract a few objects from an XML file in C# for you to see.
Click Here To Continue Reading …
Lambda Expressions and Delegates in C#
In a previous post I discussed chaining C# delegates together. In the source code example, I created a generic DelegateMath class to house a few basic math operations. This time we will replace those functions with simpler and shorter lambda expressions.
Click Here To Continue Reading …
Delegate Chain of Command
Another cool thing about delegates is the ability to chain them together. Say for example you have an object modification process, and you need a given object to be manipulated in a very specific order. Well you could use a delegate chain to accomplish that. For a simple example I have written up a C# delegate chain program that evaluates a mathematical expression following the order of operations by using a delegate chain.
Click Here To Continue Reading …
Quickly Print ANYTHING to a PDF!
Have you ever needed to send a file to a friend or a colleague only to find that they cannot open it? Or have you ever had to print a file on a public computer such as in a college library, then only to find that the computer does not have the program you need to read the file? With very specific software (AutoCAD for example) that only a handful of people use you might find it difficult to print your document from somewhere else. What if you could print the document to a universal format? Say like a Portable Document Format or better known as a PDF file? This article will show you how to quickly, and easily print ANYTHING you want to a PDF file!
Click Here To Continue Reading …