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
        void link_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            var editor = _editableObject.GetEditor();

            App.Current.Dispatcher.BeginInvoke(new Action(() =>
            {
                editor.Edit();
            }));
        }
Esempio n. 4
0
        private void mnuOpen_Click(object sender, RoutedEventArgs e)
        {
            ContextMenu Menu = ((MenuItem)sender).Parent as ContextMenu;

            if (Menu == null)
            {
                return;
            }

            IEditable editable = Menu.Tag as IEditable;

            if (editable == null)
            {
                return;
            }

            var editor = editable.GetEditor();

            editor.Edit();

            e.Handled = true;
        }