LiquidSilver switches to Mercurial on CodePlex
As you may have noticed, CodePlex now supports Mercurial as the source control. Mercurial is a free and distributed version control system. It’s currently gaining a high momentum that big projects like Mozilla, OpenSolaris, OpenOffice.org, Symbian OS, and many others are now using it. Aside from CodePlex, other project hosting sites like Google Code, bitbucket, and SourceForge also offer Mercurial support.
Because DVCS has many advantages over traditional centralized VCS such as Subversion or CVS, I also decided to switch to Mercurial for managing the source code of LiquidSilver.
Setting Up Mercurial on CodePlex
If you’re starting a new project, CodePlex will give you the option to use Mercurial as your version control system. For existing projects, unfortunately, you cannot switch to Mercurial by yourself. Instead, if you are a project owner, you can contact CodePlex using the contact form and tell your intention to switch to Mercurial. Ensure that you’re logged in when doing this and mention your project name, user name, and the email address associated to your user name.
For me, it took less than 24 hours before CodePlex responded to my request and LiquidSilver had been migrated to Mercurial. All the versions and labels were intact and I could clone the repository successfully. Thanks, CodePlex.
Using Mercurial
If you are just starting and not familiar with Mercurial or any DVCS in general, it can be confusing at first since the concept is different. Fortunately, Joel Spolsky has composed a wonderful tutorial site called Hg Init that can very quickly and greatly help you understand DVCS or Mercurial in particular. I highly recommend you to visit it. You can also learn Mercurial from its official learning site or the book.
Although you can use Mercurial entirely from the command line interface, you may find it easier or more comfortable to use TortoiseHg that provides a friendly and familiar (if you have used TortoiseCVS or TortoiseSVN before) interface for Windows users.
Visual Studio users can benefit from VisualHG, a Visual Studio extension that can give you real-time visual status updates on your files from within the Visual Studio Solution Explorer window. VisualHG depends on TortoiseHg to execute the Mercurial commands.
Now, have fun with Mercurial.
LiquidSilver 0.1.0.0 Released
LiquidSilver 0.1.0.0 has been released on Codeplex. This is still a beta version but the functionalities are quite complete and I have used many parts of it in production environment.
If you want to try it, you can download the code and binary from Codeplex. Kindly submit bug reports to the issue tracker.
If you haven’t done so, you may read the introduction to LiquidSilver or visit the resource page.
Introducing LiquidSilver SharePoint Framework
This is an introductory post to LiquidSilver SharePoint Framework that I’ve been developing with my friend, Riwut Libinuko.
LiquidSilver is a SharePoint Framework that provides various classes and functions to deal with common tasks in any SharePoint development to help you work much easier, faster, more object-oriented, and more productive. LiquidSilver is compatible with WSS 3.0 and MOSS 2007.
The project is hosted in CodePlex where you can download the source code as well as report issues.
We have put a lot of our experience — in Riwut’s case, years of experience that got him an MVP award — in SharePoint development into this framework and been using it in our projects. We love it and benefit greatly from it. So, we hope you will too.
Enough with the introduction, let’s get started with LiquidSilver or visit the LiquidSilver page to look for more resources.
SharePoint Custom List Definition Recipes
If you want a tutorial on how to create a custom ist definition in SharePoint, check MSDN or Andrew Connell’s post. Here, I’ll just provide several short recipes for some scenarios.
1. How to rename the Title column in the list definition?
Often, you want to rename the Title column in your list definition. Don’t do it, because many internal SharePoint functions requires it. Instead, just change the display name of the column.
You need to do this in the list definition’s schema.xml, not in the content type definition file. In fact, don’t mention the Title column in the content type. If you do, the Title column will appear twice in your list.
Here is what you should modify in your schema.xml:
<Fields>
<Field ID="{82642EC8-EF9B-478F-ACF9-31F7D45FBC31}"
Type="Computed"
Name="LinkTitle"
DisplayName="My Own Title" />
<Field ID="{BC91A437-52E7-49E1-8C4E-4698904B2B6D}"
Type="Computed"
Name="LinkTitleNoMenu"
DisplayName="My Own Title" />
<Field ID="{FA564E0F-0C70-4AB9-B863-0177E6DDD247}"
Type="Text"
Name="Title"
DisplayName="My Own Title"
Required="TRUE" />
<!-- Other fields declaration -->
</Fields>
Keep in mind that you will need those three columns declaration, one for the plain Title data, the others for the Title with link and menu which are displayed in the standard form. You can put your own text inside the DisplayName attribute.
2. What are the required attributes in the List and ListTemplate elements?
The List element in schema.xml is similar to the ListTemplate element in the feature manifest in the sense that they both have a similar set of attributes. A lot of attributes are duplicated and it often cause confusion. Usually, I would put every attributes I needed in both elements. But this is not a good practice, since if you need to change some attributes, you have to do it for both elements. So it’s better to put only the required attributes in each element. What are they?
MSDN actually has listed the required attributes for the List and ListTemplate elements. But, at least in my case, it’s not so accurate. So here is what I found:
Required on the List element:
- BaseType
- Direction
- Name
- Url
The MSDN article suggested that this attribute is optional. But if you don’t include this, you might get the following error when creating an instance of the list:
Exception occurred. (Exception from HRESULT: 0×80020009 (DISP_E_EXCEPTION)) at Microsoft.SharePoint.Library.SPRequestInternalClass.CreateListFromFormPost(String bstrUrl, String& pbstrGuid, String& pbstrNextUrl)
at Microsoft.SharePoint.Library.SPRequest.CreateListFromFormPost(String bstrUrl, String& pbstrGuid, String& pbstrNextUrl)
Required on the ListTemplate element:
- BaseType
- DisplayName
- Name
- Type
C# 4.0 and Dynamic Programming
In Microsoft PDC2008, Anders Hejlsberg — C# lead designer and Microsoft Technical Fellow — introduces the future of C#, dubbed C# 4.0. You can watch his recorded presentation at Channel 9. The following is a brief summary on dynamic programming, one of C# 4.0 new features.
C# Evolution
- C# 1.0: Managed Code
- C# 2.0: Generics
- C# 3.0: Language Integrated Query
- C# 4.0: Dynamic Programming
Nowadays, codes can reside in any kind of form, i.e., .NET objects, JavaScript, Python, Ruby, COM. In order to use the codes written in different form, currently we have some different approaches.
For example, to call a .NET object, we will write the following:
Calculator calc = GetCalculator(); int sum = calc.Add(10, 20);
Now we try to call a .NET object too, but we don’t know which class exactly having the code:
object calc = GetCalculator(); Type calcType = calc.GetType(); object res = calcType.InvokeMember("Add", BindingFlags.InvokeMethod, null, new object[] { 10, 20 }); int sum = Convert.ToInt32(res);
While this is for calling a JavaScript object:
ScriptObject calc = GetCalculator(); object res = calc.Invoke("Add", 10, 20); int sum = Convert.ToInt32(res);
Observe that there are different procedures to call different objects. With C# 4.0 dynamic keyword, we can use this instead of all those above:
dynamic calc = GetCalculator(); int sum = calc.Add(10, 20);
The compiler will not check whether there is an “Add” method in the “calc” object. Instead, the DLR will bind the method call to the responsible object on runtime as shown in the following picture:

Anders stated that he did not have any intention to ask all developers to rewrite all their codes to be dynamic. In fact, he is a strong believer of static language strong features: statement completion, refactoring, compilation type check, and performance. But he also embraces the flexibility and productivity of dynamic languages such as Python and Ruby. And there are an increasing numbers of things that your application needs to talk to, that is not statically typed. You may need to talk to a JavaScript code, or maybe a Python or Ruby codes. The question is, should we make it painful to talk to them or make it easier?
For Anders, he wants the later. As LINQ intends to provide a unified way to access all kind of data source, dynamic in C# intends to provide a unified way to talk to all kind of codes, be it statically or dynamically typed.