260 likes | 385 Views
Let’s get it out of the browser!. Silverlight 4 Unpackaged. Daron Yöndem | Chief Architect @ DEVELOAD Microsoft Regional Director | Silverlight MVP. System.Bio.Current.ToString(). Founder @ DEVELOAD Writer –ASP.NET/AJAX Speaker –INETA MEA Speaker Bureau Lead Old ASP.NET MVP
E N D
Let’s get it out of the browser! Silverlight 4 Unpackaged Daron Yöndem | Chief Architect @ DEVELOAD Microsoft Regional Director | Silverlight MVP
System.Bio.Current.ToString() • Founder @ DEVELOAD • Writer –ASP.NET/AJAX • Speaker –INETA MEA Speaker Bureau Lead • Old ASP.NET MVP • Current Silverlight MVP • Microsoft Regional Director
Frequent players • App.Current.Install(); • System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable(); • System.Net.NetworkInformation.NetworkChange.NetworkAddressChanged • App.Current.IsRunningOutOfBrowser; • App.Current.HasElevatedPermissions;
IsolatedStorage (Read) • using (System.IO.IsolatedStorage.IsolatedStorageFile Storage = • System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication()) { • if (Storage.FileExists("sample.txt")) { • System.IO.IsolatedStorage.IsolatedStorageFileStream MyFile = • Storage.OpenFile("sample.txt", System.IO.FileMode.Open, System.IO.FileAccess.Read); • System.IO.StreamReader MyReader = new System.IO.StreamReader(MyFile); • txtBox.Text = MyReader.ReadToEnd(); • MyReader.Close(); • } • else { • txtBox.Text = "File Not Found"; • } • }
IsolatedStorage (Write) • using (System.IO.IsolatedStorage.IsolatedStorageFile Storage = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication()) • { • using (System.IO.IsolatedStorage.IsolatedStorageFileStream MyFile = Storage.CreateFile("sample.txt")) • { • System.IO.StreamWriter MyWriter = new System.IO.StreamWriter(MyFile); • MyWriter.Write(txtBox.Text); • MyWriter.Close(); • } • }
Full Trust • Change Window Chrome. • Get Access to the Disk • Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) • COM Interop • Unrestricted Socket / Web Cross Domain Request
Notification API • NotificationWindow Warning = new NotificationWindow(); • Warning.Content= new TextBlock { Text = "Sample Warning Text" }; • Warning.Show(2000);
HTML Application = HTA! • Microsoft HTML Application Host Process • Full Trust HTML App • Just like a browser! • Create desktop experience!
LocalMessaging • LocalMessageReceiver MSGReceiver; • LocalMessageSender MSGSender; • void MainPage_Loaded(object sender, RoutedEventArgs e) • { • MSGReceiver = new LocalMessageReceiver("MyChannelName", ReceiverNameScope.Global,LocalMessageReceiver.AnyDomain ); • MSGReceiver.MessageReceived+=new EventHandler<MessageReceivedEventArgs>(MSGReceiver_MessageReceived); • } • void MSGReceiver_MessageReceived(object sender, MessageReceivedEventArgs e) • { • MessageBox.Show(e.Message); • } • private void button1_Click(object sender, RoutedEventArgs e) • { • MSGSender = new LocalMessageSender("MyChannelName", System.Windows.Messaging.LocalMessageSender.Global); • MSGSender.SendAsync("Message is here!"); • }
Silent Install • "%ProgramFiles%\Microsoft Silverlight\sllauncher.exe" • /install:"D:\deploy\demoapp.xap" • /origin:"http://foocompany.com/apps/ClientBin/demoapp.xap" • /shortcut:desktop+startmenu • /overwrite
Windows Phone Series 7 • Silverlight and XNA ONLY! • Not inside the browser! It’s the APP MODEL! • Free Tools! For everyone! Including Blend and Visual Studio!!
Summary • Out Of Browser Online / Offline Scenarios • IsolatedStorage or Disk Access • Customizing Full Trust Apps Interface • COM Interop Power • Notification API • HTA! • Local Messaging • Silent Installation • Desktop Drag&Drop • Windows Phone Support
Q&A Questions and Answers (where possible :))
Community Booth • Become part of our technological communities • Network with colleagues and experts • Ask the Experts sessions Exhibition AreaLevel -1 Photo (cc-by-sa) Chris Radcliff @ Flickr
THANKS Daron Yöndem http://daron.yondem.com