private void ЗагрузитьИконку_Click(object sender, RoutedEventArgs e) { if (SelectedItem == null) { return; } var openFileDialog1 = new OpenFileDialog(); if (openFileDialog1.ShowDialog().Value) { using (RosService.Client client = new RosService.Client()) { var Name = SelectedItem.Name; //(Дерево.SelectedValue as RosService.Configuration.Type).Name; var window = new RosControl.Forms.аботаСФайлами(); window.Complite += delegate { if (RosControl.UI.FilePreview.cache.ContainsKey(Name)) { RosControl.UI.FilePreview.CacheBitmap remove; RosControl.UI.FilePreview.cache.TryRemove(Name, out remove); } }; window.СохранитьИконку(openFileDialog1.FileName, Name, "ИконкаПоУмолчанию"); window.Show(); } } }
private void едакторСвойств_ЗагрузитьФайл(object sender, RoutedEventArgs e) { var attr = Convert.ToString(Диаграмма.SelectedValue); if (!string.IsNullOrEmpty(attr)) { var openFileDialog1 = new OpenFileDialog(); if (openFileDialog1.ShowDialog().Value) { using (RosService.Client client = new RosService.Client()) { var _Name = (Дерево.SelectedValue as RosService.Configuration.Type).Name; var window = new RosControl.Forms.аботаСФайлами(); window.Complite += delegate { if (RosControl.UI.FilePreview.cache.ContainsKey(_Name)) { RosControl.UI.FilePreview.CacheBitmap remove; RosControl.UI.FilePreview.cache.TryRemove(_Name, out remove); } }; window.СохранитьИконку(openFileDialog1.FileName, _Name, attr); window.Show(); } } } }