Ejemplo n.º 1
0
        private void DoCancel(object sender, RoutedEventArgs e)
        {
            Snippet.Name     = _name;
            Snippet.Shortcut = _shortcut;
            Snippet.Text     = _text;

            this.Hide();
            instance = null;
        }
Ejemplo n.º 2
0
        private void DoDone(object sender, RoutedEventArgs e)
        {
            FocusManager.SetFocusedElement(this, null);
            this.Hide();

            RaiseCommitValuesEvent(this);

            instance = null;
        }
Ejemplo n.º 3
0
        public static SnippetEditor Show(Snippet s, Window owner)
        {
            if (instance == null)
            {
                instance = new SnippetEditor();
            }

            instance.Owner   = owner;
            instance.Snippet = s;
            instance.Show();

            return(instance);
        }
Ejemplo n.º 4
0
        public static SnippetEditor Show(Snippet s, Window owner)
        {
            if (instance == null)
            {
                instance = new SnippetEditor();
            }

            instance.Owner = owner;
            instance.Snippet = s;
            instance.Show();

            return instance;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// PropertyChangedCallback for Snippet
        /// </summary>
        private static void SnippetChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            if (obj is SnippetEditor)
            {
                SnippetEditor owner = (SnippetEditor)obj;

                Snippet s = (args.NewValue as Snippet);

                // create a local backup of the editable properties (for the cancel operation)

                if (s != null)
                {
                    owner._name     = s.Name;
                    owner._shortcut = s.Shortcut;
                    owner._text     = s.Text;
                }
            }
        }
Ejemplo n.º 6
0
 protected override void OnClosed(EventArgs e)
 {
     instance = null;
 }
Ejemplo n.º 7
0
        private void DoDone(object sender, RoutedEventArgs e)
        {
            FocusManager.SetFocusedElement(this, null);
            this.Hide();

            RaiseCommitValuesEvent(this);

            instance = null;
        }
Ejemplo n.º 8
0
        private void DoCancel(object sender, RoutedEventArgs e)
        {
            Snippet.Name = _name;
            Snippet.Shortcut = _shortcut;
            Snippet.Text = _text;

            this.Hide();
            instance = null;
        }
Ejemplo n.º 9
0
 protected override void OnClosed(EventArgs e)
 {
     instance = null;
 }