private void LoadItemCost(object sender, RoutedEventArgs args) { OpenFileDialog dialog = new OpenFileDialog(); #if !SILVERLIGHT dialog.DefaultExt = ".cost.xml"; #endif dialog.Filter = "Rawr Xml Item Cost Files | *.cost.xml"; dialog.Multiselect = false; if (dialog.ShowDialog().GetValueOrDefault(false)) { #if SILVERLIGHT using (StreamReader reader = dialog.File.OpenText()) #else using (StreamReader reader = new StreamReader(dialog.OpenFile())) #endif { ItemCache.LoadItemCost(reader); } } }