....and commence downloading.
http://weblogs.asp.net/scottgu/archive/2007/11/19/visual-studio-2008-and-net-3-5-released.aspx
|
|
||||
|
This Month
Month Archive
Search
|
Monday, November 19
by
Pete
on Mon 19 Nov 2007 19:57 GMT
....and commence downloading. http://weblogs.asp.net/scottgu/archive/2007/11/19/visual-studio-2008-and-net-3-5-released.aspx
Monday, November 5
by
Pete
on Mon 05 Nov 2007 22:54 GMT
I've been using this plugin now for the past few months. You would not believe the difference it makes. This plugin puts a little search box right into Visual Studio to make it easy to find work items. It is an addin for Team Foundation Client (Team Explorer) and is accessible from the Team menu when you're connected to a Team Foundation Server and is also avalible from a VS Toolbar. You just type in some search text and it runs a work item query for you showing you results across the work item store. ![]() Thursday, September 13
by
Pete
on Thu 13 Sep 2007 10:14 BST
Check out this useful macro for visual studio 2005 dependent (nested) items. Useful for breaking up large classes into partials when refactoring doesn't make sense. I found it useful when you want, for example one integration test class per implementation class and the test class is getting a bit large.
![]() Source: http://www.delarou.net/weblog/PermaLink,guid,a81a2d9d-02de-4fe1-ad8d-ee2fee97cf20.aspx
by
Pete
on Thu 13 Sep 2007 09:45 BST
During a recent project we found a recurring problem where the test view of the unit (& integration) test projects would not load and we could not run tests. This was typically seen by the Test View load progress bar sitting at around 99%. This just adds to the list of "features" of VSTS Unit Test that make life oh so irritating Thursday, April 19
by
Pete
on Thu 19 Apr 2007 23:11 BST
Lately I decided to see how easy was to create AJAX custom controls specifically using the included javascript libraries. I thought it might be useful to try to use the included javascript libraries to enable client side access to the selected value from a custom control. The example I will use is a date time picker which uses the calendar extender from the ajax control toolkit for the date and a simple drop down for the time. Much like outlook, the date is pickable from a textbox and the time in a list of 15 minute intervals. The goal is to allow the client and server side code to have access to the same DateTime type without having to do any work parsing the strings in the HTML elements on the page. Usage Pattern The control on the client page looks like the following. <pgc:DateTimePicker ID="dtpMyDate" runat="server" TimeInterval="15" Format="dd/MM/yyyy"/> The client script needed to get the value from the control is as follows function displayClientDate()
{ alert( $find( "dtpMyDate" ).get_selectedDateTime().format("dddd dd MMMM yyyy HH:mm") ); } ....and that's it! The screenshot below shows the output.
The Implementation To implement the custom control described above we have to implement the IScriptControl interface from the AJAX Extensions as well as the standard CompositeControl. This requires that we implement a few methods on our control above and beyond the standard control methods, these are the GetScriptReferences and the GetScriptDescriptors methods. GetScriptReferences allows us to add in the client script files to the output sent to the user. This tells the ScriptManager on the page to send down our client script file. protected virtual IEnumerable<ScriptReference> GetScriptReferences()
{ ScriptReference ProtoReference = newScriptReference(); ProtoReference.Path = Page.ClientScript.GetWebResourceUrl(this.GetType(), "PGCodeWorks.AjaxControls.DateTimePicker.DateTimePicker.js"); return newScriptReference[] { ProtoReference }; } GetScriptDescriptors allows us to tell the control which variables to pass through to the client script. These variables are set on the client when the page is sent down and allow us to use the same javascript object to represent multiple controls on one page with different instances and properties. protectedvirtualIEnumerable<ScriptDescriptor> GetScriptDescriptors()
{ ScriptBehaviorDescriptor descriptor = newScriptBehaviorDescriptor("PGCodeWorks.DateTimePicker", this.ClientID); descriptor.AddProperty("textBoxClientID", this.txtDate.ClientID); return newScriptDescriptor[] { descriptor }; } Then, after implementing the rest of our control we need to add the client script .js file to the solution and mark it as an embedded resource. To make the file embed itself within the DLL select the file in solution explorer and change the "Build Action" in the properties window. Also you must add a reference to it in the AssemblyInfo.cs file. The actual file follows the object-oriented javascript approach to allow properties etc on the prototype model. Below is the structure of the .js file (some code has been cut-out to save space). // Register the namespace for the control Type.registerNamespace('PGCodeWorks'); // // Define the control properties // PGCodeWorks.DateTimePicker = function(element) { PGCodeWorks.DateTimePicker.initializeBase(this, [element]);
// Set properties to null this._textBoxClientID = null; this._dropDownClientID = null; // *** Code Truncated *** } // // PGCodeWorks.DateTimePicker.prototype = { initialize : function() { PGCodeWorks.DateTimePicker.callBaseMethod(this, 'initialize'); this._onDateTimeChangeHandler = Function.createDelegate(this, this._onDateTimeChange); this._onDateChangeHandler = Function.createDelegate(this, this._onDateChange); this._onTimeChangeHandler = Function.createDelegate(this, this._onTimeChange); $addHandler($get(this._textBoxClientID), 'change' , this._onDateChangeHandler );
$addHandler($get(this._dropDownClientID), 'change', this._onTimeChangeHandler);
},
dispose : function() { $removeHandler($get(this._textBoxClientID), 'change' , this._onDateChangeHandler ); $removeHandler($get(this._dropDownClientID), 'change', this._onTimeChangeHandler);
PGCodeWorks.DateTimePicker.callBaseMethod(this, 'dispose'); },
// // Custom Methods // setDateTimeValues : function() { // Get Values var strDate = $get(this._textBoxClientID).value; var strTime = $get(this._dropDownClientID).value; var strTimeFormat = this._timeFormat; if( strDate != null && strDate != "" ) { if( strTime == null || strTime == "" ) { strTime = "00:00"; strTimeFormat = "HH:mm"; } var totalDateTimeFormat = this._dateFormat + ' ' + strTimeFormat; var newDate = Date.parseInvariant( strDate + ' ' + strTime, totalDateTimeFormat ); this.set_selectedDateTime( newDate ); //alert( this._selectedDateTime ); } },
// // Event delegates // _onDateTimeChange : function(e) { this.setDateTimeValues(); },
_onDateChange : function(e) { this.setDateTimeValues(); }, _onTimeChange : function(e) { this.setDateTimeValues(); }, // // Control properties // get_textBoxClientID : function() { return this._textBoxClientID; }, set_textBoxClientID : function(value) { if (this._textBoxClientID !== value) { this._textBoxClientID = value; this.raisePropertyChanged('textBoxClientID'); } },
get_timeInterval : function() { return this._timeInterval; },
set_timeInterval : function(value) { if(this._timeInterval != value) { this._timeInterval = value; this.raisePropertyChanged('timeInterval'); } }
} // end of prototype declaration // Optional descriptor for JSON serialization. PGCodeWorks.DateTimePicker.descriptor = { properties: [ {name: 'textBoxClientID', type: String}, {name: 'dropDownClientID', type: String}, {name: 'selectedDateTime', type: Date}, {name: 'dateFormat', type: String}, {name: 'timeFormat', type: String}, {name: 'timeInterval', type: Number} ] } // Register the class as a type that inherits from Sys.UI.Control. PGCodeWorks.DateTimePicker.registerClass('PGCodeWorks.DateTimePicker', Sys.UI.Control); if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded(); The above code has allowed the client to be able to call the javascript object representing the overall control and retrieve it's selectedDateTime property. How Does it Work? The libraries provided with the ASP.Net AJAX Extensions allow us to create composite controls which we can deal with as a single object on the client using object-oriented javascript. Using the patterns and examples given on the AJAX web site we can recreate the types of functionality in the AjaxControlToolkit and start building rich client side experiences. In this example we have simply provided a public method on our object which grabs the values from the controls on the page and uses the type extensions in AJAX to provide a similar experience in client side development as we experience on the server side. To extend this example I have created a RequiredFieldValidator and a CompareValidator which will work with the above control and I hope to post this when it has been cleaned up. The full code and solution for this example is available here Tuesday, April 10
by
Pete
on Tue 10 Apr 2007 09:43 BST
The Microsoft Patterns and Practices team have just released Enterprise Library 3.0 - April 2007. This is the full RTM version of EntLib with some really neat new features:
I had a play with the Visual Studio integration and Environmental Overrides functionality over the weekend (yeh, I know) - I'm glad they eventually added this stuff in. Olaf Conijn was building these as add ons before he was assimilated. Source: Tom Hollanders Blog Visual Studio Integration Screenshots![]()
Friday, April 6
by
Pete
on Fri 06 Apr 2007 17:21 BST
Microsoft have finally listened to all the developers (who are also designers) rightfully throwing our toys out of our prams and included Expression Web Designer and possibly some other Expression badged products in the MSDN subscription downloads.
This is really good news. The presumption that developers never need to use the latest CSS and HTML tools as they don't do design is ridiculous. Those of us building functional internal web solutions rarely get the option of enlisting the services of a dedicated designer, leaving the lonely developer to struggle with whatever tools are available to accomplish design. Source: Somasegar's blog |
Recent Blog Entries
Recent Comments
Blogs I read
Useful Links
|
||