Friday, March 14, 2008

Shelving your code in TFS

 

TFS allows you to set aside pending changes in your TFS workspace if you want to work on something else for awhile, or if you want another coder to review your changes before you commit them, or if you want to pass off files you've been working on to another team member. When you create a shelveset TFS saves the items along with any associated Work Items or Check-in Notes to a separate repository, though not the source control repository itself.

Shelving a set of pending changes

  1. In the Pending Changes view, click the down arrow icon and select Shelve.

  2. In the Shelve - Source Files dialog box, type a name for your shelveset, any comments to help you remember the set, and, if necessary, deselect any file(s) you do not want to include in the shelveset. You can also associate a Work Item with your shelveset. For more information, see Associating Work Items with Changesets and Shelvesets.

Finding and Unshelving a set of pending changes

  1. In the Pending Changes view, select the down arrow icon and click Unshelve.

  2. In the Unshelve dialog type the name of any team member with a TFS workspace and click Find to retrieve a list of that team member's shelvesets. In the example below we are retrieving one of our own shelvesets, and selecting the one we created above. Click Unshelve.

     

Viewing Shelveset Details

To view details of a saved shelveset:

  1. In the Unshelve dialog, after you have completed your search (Steps 1 -2 above), right-click a shelveset from the list and select Details.

  2. In the Shelveset Details dialog, right-click a file and select from the popup menu. By selecting View, the shelved file opens in your Eclipse editor window where you can examine it before unshelving it. You also have the option to use the compare editor. For more information on this option, see Comparing versions .

Thursday, February 28, 2008

File Upload AJAX V 1.2

As you know that ASP.Net File Upload control can not be placed in multi view. If you put your file upload inside the multi view. You will lost your content when the multi view change the active view.

But the good news is there is Open source control called File Upload Ajax which in V1.2 can be placed inside Wizard, Multi View, invisible Panels, hidden divs, etc.

Download the control @ http://www.codeplex.com/fileuploadajax/Release/ProjectReleases.aspx?ReleaseId=8061

And try this.

  1. Add your FUA in your project
  2. Register in your page or in web.config
  3. <%@ Register Assembly="FUA" Namespace="Subgurim.Controles" TagPrefix="cc1" %>



  4. Add your Update panel, Multiview and file upload



  5. <asp:UpdatePanel ID="up" runat="server">
    <ContentTemplate>
    <asp:MultiView ID="multiPages" runat="server" ActiveViewIndex="0">
    <asp:View ID="v1" runat="server">
    </asp:View>
    <asp:View ID="v2" runat="server">
    upload:
    <cc1:FileUploaderAJAX ID="FileUploaderAJAX1" runat="server" MaxFiles="1" Directory_CreateIfNotExists="true" File_RenameIfAlreadyExists="true"/>
    </asp:View>
    </asp:MultiView>
    </ContentTemplate>
    </asp:UpdatePanel>



  6. Add Code behind code



  7. protected void Page_Load(object sender, EventArgs e)
    {
    if (FileUploaderAJAX1.IsPosting)
    {
    HttpPostedFileAJAX pf = FileUploaderAJAX1.PostedFile;
    FileUploaderAJAX1.SaveAs("~/upload", pf.FileName);
    }
    }


Tuesday, February 26, 2008

Put ConfigSections on the top

Today, I just find the problem why my code can not detect my custom config sections. because I put config sections after <AppSettings> -)

Use Ctrl + . to Resolve in VS2008

Use Ctrl + . when you notice red underscore to Select a Resolve solution for you

Wednesday, February 20, 2008

Live Writer for Coder

These are plugins which will help me to write better content 

  • CodeSnippetSetup.msi - Wrap your code into a container
  • vspaste.msi - Copy paste from Visual studio
public static class HelloClass
{
public static void HelloWorld()
{
//Hi I just found this plugin makes our live easier for writing a blog...
}
}

Wednesday, February 13, 2008

Improve your AJAX Performance

Just quick note what I just got this morning from RDN with Damian.

  1. Disable compilation debug mode into false compilation debug="false"
    - This will decrease the javascript code downloaded from ajax frameworks

  2. If you don't use update panel, just using control toolkit,
    disable partial rendering on Script Manager
    EnablePartialRendering="false"
    - This improve the process for common postback, without checking update panel

  3. Try to saperate update panel as small as possible and put UpdateMode="Conditional".
    this will not send back other update panel content on partial rendering.
    By Default it sets to Always means it will send the content even not rendered.

  4. For using Not friendly AJAX control such as Telerik, Reporting Services Viewer which can not use update panel to do partial postback.
    You may put it into partial postback but add an attribute in Update Panel ChildrenAsTriggers="false". This will perform partial postback but not update your panel.

    so to update another panel you can do manually __doPostback(%= ID%, ...) or just handle it in the control.

    The ChildrenAsTriggers property determines whether postbacks from a child ontrol in an UpdatePanel result in its contents being refreshed. By default, this property is set to True and can be set to False only when the UpdateMode is set to conditional. Attempting to do so without this condition results in an InvalidOperationException being thrown by the ScriptManager during the page’s PreRender event.

  5. In my experience I also turn off EnableViewState and It works fine, but I don't know if this improve the performance

And Don't forget to use Web Development Helper for IE , but before that you may need to install IE Developer tool
http://msmvps.com/blogs/paulomorgado/archive/2007/02/18/developer-tools-for-internet-explorer.aspx

Tuesday, February 12, 2008

KeyValueConfigurationElement VS NameValueConfigurationElement

After checking on the description form MSDN, http://msdn2.microsoft.com/en-us/library/system.configuration.namevalueconfigurationelement(VS.80).aspx

It is written that
"
There is a difference between the NameValueConfigurationElement class and KeyValueConfigurationElement class. The NameValueConfigurationElement class does not require the first string to be unique, whereas KeyValueConfigurationElement class requires the first string to be a key, and therefore unique in the collection.
"

However when I try to test it, it seems that
  1. NameValue also can not display duplicate Names in the collection moreover if the name is the same but the value is different , it will throw an error message which says that name has already has the value.
  2. On the other hand KeyPair, also can not have duplicate keys but if there is duplicate key but different values, it will be override with the last values. There is no error message return.
  3. KeyPair collection will be sorted , I guess it similar with Hashtable collection but NameValue is not sorted.
  4. KeyPair is case sensitive so Key1 and key1 will be consider the same key
    but Namevalue is incase sensitive Name1 and name1 will be consider different name

For solving this problem, I have build my custom collection - can be downloaded at
http://kkurni.googlepages.com/KKurni.CustomConfigurationElementCol.rar