c
There are 5 entries for the tag
c
After my previous spinning wait symbol, I decided to see how difficult it would be to create a Silverlight version of the Mac OSX wait cursor that I referenced in the previous post. The Mac OSX cursor is commonly referred to as the "Spinning Pizza of Death" or the "Marble of Doom" and in fact there is a Marble of Doom web site dedicated to the amount of time spent waiting while watching the spinning cursor. The Marble of Doom web site has a very nice and large version of the cursor using Flash although it doesn't have any vector...
I was working through a Communications sample of connecting SilverLight to POX, then Web Services, and finally WCF and I came across the following instructions: (Part 1: POX) The Generic handler will process an incoming request using the code declared in the ProcessRequest function. This function should create some new instances of CityData and add them to the myCities list. Here are some examples of cities with longitude and latitude { (London, 51.5, 0), (Stratford-upon-Avon, 52.3, -1.71), (Edinburgh, 55.95, -3.16) }. See if you can write the code to do this. (And later in the lab...) In this example...
The wsdl.exe tool with Visual Studio can be used to manually generate a code file to use with a project. If you use the nillable or minOccurs attributes in the XSD though, the wsdl.exe tool generates a boolean 'Specified' field that must be set to true in order to transmit the data through the web service. For example: WSDL File (myfile.wsdl)<xs:element name="duedate" type="xs:dateTime" nillable="1" minOccurs="0" maxOccurs="1" />
Generated CS File (wsdl.exe myfile.wsdl)// ...
private System.Nullable<System.DateTime> duedateField;
private bool duedateFieldSpecified;
// ...
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
public System.Nullable<System.DateTime> duedate {
get {
return this.duedateField;
}
...
I was browsing various blogs today and I came across a good example for using a verbatim string instead of a StringBuilder object. The code I came across looked like this (I mean absolutely no disrespect to the author, so I won't include the original link):private void ClientScript()
{
StringBuilder sb_Script = new StringBuilder();
sb_Script.Append("<script language=\"javascript\">");
sb_Script.Append("\r");
sb_Script.Append("\r");
sb_Script.Append("function cb_verify(sender) {");
sb_Script.Append("\r");
sb_Script.Append("var val = document.getElementById(document.getElementById"
+"(sender.id).controltovalidate);");
sb_Script.Append("\r");
sb_Script.Append("var col = val.getElementsByTagName(\"*\");");
sb_Script.Append("\r");
sb_Script.Append("if ( col != null ) {");
...
One of the things that bothers me a lot is using a lot of string concatenation when you can just use the verbatim string literal (@"") to define a large block of text. For example, I saw some code on a blog the other day that looked something like this:string strValue = "<div id='test'>";
strValue += "<input type='text' id='name' value='" + strName + "/>";
strValue += "<input type='submit' />";
strValue += "</div>";
// Many more lines before it finally
// finished building the string
There are many things wrong with the code sample above including not using StringBuilder. I have seen the same type of code...