Feeds:
Posts
Comments

Archive for the ‘software’ Category

Normally, @(Item) is translated as a concatenation of the identity metadata of the elements in the item list Item – these values are delimitated by comma ‘,’  . We can customize this by using:

@(item->’…%(metaData)…’, ‘delim’ )

E.g., I often use the delimiter is %0A stands for a newline.

Read Full Post »

XmlPeek:
Read inner text.
Built-in support by MSBuild in dotNet Framework.

XmlRead:
Do not read inner text.
Need MSBuild Community Task.

Example:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="MAIN" ToolsVersion="4.0">
  <!--<Import Project="$(MSBuildExtensionsPath)\MSBuildContrib\MSBuildContrib.Tasks"/>-->
  <!--<Import Project="$(MSBuildExtensionsPath)\ExtensionPack\MSBuild.ExtensionPack.tasks"/>-->
  <Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />

  <Target Name="MAIN">
    <XmlPeek Namespaces="&lt;Namespace Prefix='msb' Uri='http://schemas.microsoft.com/developer/msbuild/2003'/&gt;"
             XmlInputPath="$(MSBuildProjectFile)"
             Query="/msb:Project/msb:Import">
      <Output TaskParameter="Result" ItemName="Peeked" />
    </XmlPeek>
    <Message Text="111: @(Peeked)"/>

    <XmlRead Prefix='msb' Namespace='http://schemas.microsoft.com/developer/msbuild/2003'
             XmlFileName="$(MSBuildProjectFile)"
             XPath="/msb:Project/msb:Import" >
      <Output TaskParameter="Value" ItemName="Peeked2" />
    </XmlRead>
    <Message Text="222: @(Peeked2)"/>
  </Target>
</Project>

Read Full Post »

Referred from: Locate File in Solution Explorer – Visual Studio Macro

Toogle “Track Active Items” (Tools –> Options –> Projects and Solutions).
This feature, when enabled, syncs the selected item in your solution explorer to the file being viewed.The below Macro will assist you finding the current file while leaving the feature turned off.
Go to Tool-Options-Environment-Keyboard and bind it to a shortcut key and you are all set – mine is bound to (ALT+L, ALT+L) or (Ctrl-`). To see your macro, type its name in the search box.
Public Sub LocateFileInSolutionExplorer()
  DTE.ExecuteCommand("View.TrackActivityinSolutionExplorer")
  DTE.ExecuteCommand("View.TrackActivityinSolutionExplorer")
  DTE.ExecuteCommand("View.SolutionExplorer")
End Sub

To add a macro (in Visual Studio 2008), browse to Tool – Macro – Macro Explorer, then select/create a module and open it, then paste the script above and save. That’s it.

Enjoy!

Read Full Post »

« Newer Posts - Older Posts »