private void btnOpen_Click(object sender, RoutedEventArgs e)
        {
            var dlg = Utils.UIHelper.GetOpenFileDialog();

            if ((bool)dlg.ShowDialog(this))
            {
                V8MetadataContainer Container = new V8MetadataContainer(dlg.FileName);

                IEditable editable = Container.RaiseObject() as IEditable;
                if (editable == null)
                {
                    MessageBox.Show("Редактирование данного объекта не поддерживается", "V8 Reader", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                    Container.Dispose();
                    return;
                }

                ICustomEditor editor = editable.GetEditor();
                editor.EditComplete += (s, evArg) =>
                {
                    Container.Dispose();
                };

                editor.Edit();
            }
        }
Esempio n. 2
0
        private static void OpenFile(String FileName)
        {
            SafeMessageLoop(() =>
            {
                using (V8MetadataContainer Container = new V8MetadataContainer(FileName))
                {
                    IEditable editable = Container.RaiseObject() as IEditable;

                    if (editable == null)
                    {
                        MessageBox.Show("Редактирование данного объекта не поддерживается", "V8 Reader", MessageBoxButton.OK, MessageBoxImage.Exclamation);
                        return;
                    }

                    App WPFApp = new App();

                    ICustomEditor editor = editable.GetEditor();
                    editor.EditComplete += (s, e) =>
                    {
                        WPFApp.Shutdown();
                    };

                    editor.Edit();
                    WPFApp.Run();
                }
            });
        }
Esempio n. 3
0
 public static void RegisterEditor(string propertyName, ICustomEditor editor)
 {
     if (editors.ContainsKey(propertyName))
     {
         return;
     }
     editors.Add(propertyName, editor);
 }
 public static void RegisterEditor(string propertyName, ICustomEditor editor)
 {
     editors.Add(propertyName, editor);
 }