2011年9月7日 星期三

Windows Phone 7 Live Tile

原來WP7可以用戶API去Create, Update, Delete App Icon,
而且可以用一個人App有2個Icon係數Start Page,
真係幾得意見.......XD

Using dll
//Import the ShellTile namespace
using Microsoft.Phone.Shell;

create second icon
// Look to see whether the Tile already exists and if so, don't try to create it
again.
ShellTile TileToFind = ShellTile.ActiveTiles.FirstOrDefault(x =>
x.NavigationUri.ToString().Contains("DefaultTitle=FromTile"));
// Create the Tile if we didn't find that it already exists.
if (TileToFind == null)
{
    // Create the Tile object and set some initial properties for the Tile.
    // The Count value of 12 shows the number 12 on the front of the Tile. Valid values are 1-99.
    // A Count value of 0 indicates that the Count should not be displayed.
    StandardTileData NewTileData = new StandardTileData
    {
        BackgroundImage = new Uri("Red.jpg", UriKind.Relative),
        Title = "Secondary Tile",
        Count = 12,
        BackTitle = "Back of Tile",
        BackContent = "Welcome to the back of the Tile",
        BackBackgroundImage = new Uri("Blue.jpg", UriKind.Relative)
    };
    // Create the Tile and pin it to Start. This will cause a navigation to Start and a deactivation of our application.
    ShellTile.Create(new Uri("/SecondaryTile.xaml?DefaultTitle=FromTile", UriKind.Relative), NewTileData);
}

2011年9月6日 星期二

C# Lambda Expression () =>

今天上了一個Windows Phone 7 course,
入面見到一個我沒見過的話syntax:

void accelerometer_ReadingChanged(object sender, AccelerometerReadingEventArgs e)
{
      Deployment.Current.Dispatcher.BeginInvoke(() => MyReadingChanged(e));
}

點來上網一看,它叫作Lambda Expression(Lambda 表達式),
"=>" 可以解作為 "goes to"


PS. 參考http://msdn.microsoft.com/en-us/library/bb397687.aspx

清除了Project目錄下SVN檔案Command

之前上司教的幾個SVN Command
很有用,共享吧!!

ignore certain pattern
svn propset svn:ignore -F ignore.txt .

Delete all the .svn folder
find . -name ".svn" -type d -exec rm -rf {} \;