Exemplo n.º 1
0
        protected void EditSnippet(Snippet snippet)
        {
            Snippet        editableSnippet = new Snippet(snippet);
            SnippetDetails details         = new SnippetDetails();

            details.Settings    = this.Settings;
            details.DataContext = editableSnippet;
            bool?result = details.ShowDialog();

            if ((result.HasValue) && (result.Value))
            {
                snippet.CopyFrom(editableSnippet);
            }
        }
Exemplo n.º 2
0
        protected void NewSnippet()
        {
            Snippet        snippet = new Snippet();
            SnippetDetails details = new SnippetDetails();

            details.Settings    = this.Settings;
            details.DataContext = snippet;
            bool?result = details.ShowDialog();

            if ((result.HasValue) && (result.Value))
            {
                this.Settings.Snippets.Add(snippet);
            }
        }