XNA Game Studio Express (Beta) Now Available
I am just downloading it. Download it too. You also need to download Visual Studio C# Express as the documentation says. Also for audio you might need Directx SDK, So downloading all of them.
Adventures in Computing - Can Erten’s Blog
Archive for August 2006
I am just downloading it. Download it too. You also need to download Visual Studio C# Express as the documentation says. Also for audio you might need Directx SDK, So downloading all of them.
DDD4 is going to be on Saturday 2nd December 2006 at Microsoft UK Campus in Reading.
The process is 3 stages like the previous events . We are now at the 1st stage that potential speakers submit a session. I submitted a session about “Next Generation Data Access”, I might submit some more to increase my chance
Also if you have any suggestions, you are welcome to tell me.
Second stage will be the voting session, where the community users will choose the event that they want to see.
Third stage will be the actual program of the day.
Nullable types are instances of Nullable structure. This Nullable structure is a generic struct type in base class library. It behaves like value type when it has a value which means that boxing or unboxing occurs. However when it does not have a value, it is null instead of the value types default value, and boxind or unboxing does not occur.
There is a short notation for the generic Nullable structure. The ? operator is used for that purpose.
Nullable<int> i1; int? i1;
These expressions evaluates the same CLR code.
Sometimes it is definitely needed to have the null value for the value types because sometimes the default value of the value types might be important, in case of database operations for example.
Also a new operator comes to the language. It’s named as coalescing operator, it is just a shorter form of some statements. The operator is ??. Here is the usage, and what it means for.
I think it makes code simpler but difficult to read. It is like using ? operator,instead of using if statements.
string name = "test2"; string guessWhat = name ?? "NoName";
string guessWhat ; if (name != null) guessWhat = name; else guessWhat = "NoName";
This code snippet is exactly the same as the previous code snippet.
using System; using System.Collections.Generic; using System.Text; namespace Nullables { class Program { static void Main(string[] args) { int? i1 = null; Nullable<int> i2 = null; int i3; if (i1 == null) Console.WriteLine("i1 is null"); if (i2.HasValue) Console.WriteLine("i2 is not null"); if (i3 == null) Console.WriteLine("i2 is null"); string name = "test2"; string guessWhat = name ?? "NoName"; Console.WriteLine("name is test2 and value of guessWhat is " +guessWhat); name = null; guessWhat = name ?? "NoName"; Console.WriteLine("name is null and value of guessWhat is "+ guessWhat); Console.ReadLine(); } } }
Here is the output of the code.
i1 is null
i2 is null
name is test2 and value of guessWhat is test2
name is null and value of guessWhat is NoName
_
Ilmerge is a great utility for any .net developer. What it does is basically merge the assemblies. Let’s say you have three dll and one exe file, you can just merge those 4 files to 1 file using ilmerge.
As a matter of fact, it is easy to use, you don’t need any recompilation or any other modification. You don’t need to provide installers since there is only one file.
Ilmerge exists in two versions one for .Net 1.1 and the other is .Net 2.0
Usage: ilmerge [/lib:directory]* [/log[:filename]] [/keyfile:filename [/delaysig
n]] [/internalize[:filename]] [/t[arget]:(library|exe|winexe)] [/closed] [/ndebu
g] [/ver:version] [/copyattrs [/allowMultiple]] [/xmldocs] [/attr:filename] [/pu
blickeytokens] [/wildcards] [/zeroPeKind] [/allowDup:type]* /out:filename <prima
ry assembly> [<other assemblies>...]
Although the help explains very well, here is the usage.
C:\Program Files\Default Company Name\ILMergeBinaryDistribution7>Ilmerge /t:exe
/out:outputfile.exe file1.exe file2.dll
/t us used for the output of the file, exe is for a console application, winexe is for windows forms application and library is for the dlls.
/out is for the name of the output file.
the last parameters are the assemblies to be compined. Attention here is that the first one should be the exe one instead of the class library, becuase it merges the following files to the first file.
ILmerge is also usable as a class library for your project. What you need to do is to add the ilmerge executable as a reference and use the namespace of it to do some tasks. The class library is very similar to the console commands.
Blog it from Windows Live Writer.
Windows Live Writer is a new desktop application for composing blog posts to your blog service.
Currently the addon posts a page link or selected text to Windows Live Writer. You can access it from the context (right click) menu or the main menu.
To use it you need to have Windows Live Writer installed on your machine.
From Mozilla Add-ons Site - Live Writerfox
It is now available on firefox site as well.
Currently it is pending for aproval on firefox site, you can download from the link below.
From my Site
v0.4 (2008-06-21)
Firefox 3.0 Support
v0.3 (2006-10-25)
Added Firefox 2.0 Support
v0.2 (2006-08-27)
Added toolbar button Blog It
URL issue has been fixed
Removed extra double-quotes
v0.1 (2006-08-19) - Initial Stable Version.
Blog a page.
Blog selected text.
By using reflection we can call any function including the private and protected ones. This includes private static methods, constructor methods, normal methods. What we need to do is to get the method by the BindingFlags.Nonpublic flag and then we just use it like a reflected type.
using System; using System.Collections.Generic; using System.Text; using System.Reflection; namespace ReflectPrivateMembers { class Program { static void Main(string[] args) { ConstructorInfo ci = typeof(Hello).GetConstructor(BindingFlags.NonPublic| BindingFlags.Instance ,null,System.Type.EmptyTypes,null); object helloObject = ci.Invoke(System.Type.EmptyTypes); MethodInfo[] helloObjectMethods = helloObject.GetType().GetMethods(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly| BindingFlags.Instance ); foreach (MethodInfo mi in helloObjectMethods) { mi.Invoke(helloObject, System.Type.EmptyTypes); } Console.ReadLine(); } } public class Hello { private Hello() { Console.WriteLine("Private Constructor"); } public void HelloPub() { Console.WriteLine("Public Hello"); } private void HelloPriv() { Console.WriteLine("Private Hello"); } } }