• MohamedG's Log

    How to: Label items in a changeset using tf label?

    • 0 Comments
    We can specify the versionspec to tf label either by supplying the /v or /version argument (for example, /v:C1256), or by appending it to the itemspec (for example, foo.cs;C1256). Here's an example that attaches the "goodbuild" label to version 1256 of...
  • MohamedG's Log

    Exclude file from source control

    • 2 Comments
    When you need to exclude a file in a project from source control, you can select that file in the Solution Explorer window, then go to File > Source Control > Exclude [filename] from Source Control. A red icon should appear to the left of that file...
  • MohamedG's Log

    How to: Find the latest changeset you have on a workspace?

    • 0 Comments
    To know the answer to this question, you can run the following command: tf history . /stopafter:1 /v:1~W /r That's it :)
  • MohamedG's Log

    How To: Unlock files locked by others?

    • 0 Comments
    It happens so many times that a developer forgets to unlock files in his workspace before leaving the team for a vacation or for good. To solve this problem, there are several options: remove the lock (this won't work if exclusive checkout is enabled...
  • MohamedG's Log

    How to: Sync to a specific time and date?

    • 0 Comments
    Using tf.exe, you can get a specific version using its time and date: tf get /version:"D:02/08/2008 1:00:00 AM" The DateTime format that you use should be one of the formats supported by the .Net framework. So, D2008-02-08T01:00 works, while D2008...
  • MohamedG's Log

    Fiddler

    • 0 Comments
    Don't worry, this post isn't about music or violins, it's about a web debugging proxy. Fiddler is an excellent tool to trace the HTTP/HTTPS traffic and debug it too. It's extensible, it's free, and it's awesome. Try it yourself: http://www.fiddler2.com...
  • MohamedG's Log

    Impersonation

    • 0 Comments
    Impersonation lets you execute code using another user identity. In the WindowsIdentity class, there's a method called Impersonate, it allows you to impersonate the user specified by the WindowsIdentity instance. Just remember to call Undo to get back...
  • MohamedG's Log

    Code Snippet: switch

    • 0 Comments
    Type sw to select switch: Double tab to expand: Choose the switch_on parameter, in this case I have a parameter of type DayOfWeek (enum): Voilà:
  • MohamedG's Log

    ?? Operator

    • 0 Comments
    The ?? operator is used to return the left operand if it's not null, otherwise, it returns the right operand. It's equivalent to (left != null ? left : right). string a = null ; object b = a ?? new object (); object c = b ?? "b is null!" ; int ? x...
  • MohamedG's Log

    Nullable Value Types

    • 0 Comments
    Can you assign null to int?? Read carefully before you answer, this is a trick question! You can do that by using nullable value types: int? x = null ; To check if the nullable value has a value, you can use the .HasValue property. If the value...
  • MohamedG's Log

    Declare and set properties all at once

    • 2 Comments
    I used to use this technique in ActionScript, and I really like to use it C#: TextBox textBox = new TextBox () { Text = "Hello!" , Enabled = false }; TextBox textBox = new TextBox { Text = "Hello!" , Enabled = false }; // Thanks, kfarmer Point point...
  • MohamedG's Log

    File System Limits

    • 0 Comments
    When you create a file or a folder, do you check that the full path is not too long?! Make sure that you handle the PathTooLongException : Try to exceed the maximim lenght on Windows, and you'll get this error: Here are some limits...
  • MohamedG's Log

    Shelving

    • 0 Comments
    As the feature’s name suggests, you can have shelves of your code set aside the same way you use real shelves. In a library, when you shelve a book to read another or to write a paper, others now can read it. The difference in source control is that it...
  • MohamedG's Log

    Pseudo-localization

    • 0 Comments
    It's an economic need to develop international software as you need to reach as many customers as possible all over the world. Let's tackle a simple scenario, imagine that you will develop an application that has a bilingual UI: English and Arabic. It...
  • MohamedG's Log

    Code Churn

    • 0 Comments
    Lines of code that are added, removed, or changed from a build to another are referred to as churned. Code churn is a good measure to quantify the amount of change in your project. When you use team foundation to build your project, code coverage will...
  • MohamedG's Log

    Source Control Workspaces

    • 1 Comments
    Do you usually need to keep multiple copies of your sources, for instance, different versions, copies to test, your mates' code, or what have you? You'll need to use workspaces. A workspace is self-explanatory; it's a space that contains your work. A...
  • MohamedG's Log

    First step

    • 1 Comments
    This is my first post, and these days are my first days at Microsoft . So, let's start together to learn more about the product I'm working on: Visual Studio Team Foundation Server (VSTFS) . We have a lot of great features and I was lucky enough to use...
Page 5 of 5 (117 items) 12345