Esempio n. 1
0
        void ButtonEditClicked(object sender, EventArgs e)
        {
            var template = GetSelectedTemplate();

            if (template != null)
            {
                templatesToSave.Add(template);
                using (var editDialog = new EditTemplateDialog(template, false))
                    if (MessageService.ShowCustomDialog(editDialog, this.Toplevel as Gtk.Window) == (int)ResponseType.Ok)
                    {
                        templatesToSave.Add(template);
                    }
                HandleChanged(this, EventArgs.Empty);
            }
        }
		void ButtonAddClicked (object sender, EventArgs e)
		{
			var newTemplate = new CodeTemplate ();
			using (var editDialog = new EditTemplateDialog (newTemplate, true)) {
				if (MessageService.ShowCustomDialog (editDialog, this.Toplevel as Gtk.Window) == (int)ResponseType.Ok) {
					InsertTemplate (newTemplate);
					templates.Add (newTemplate);
					templatesToSave.Add (newTemplate);
				}
			}
		}
		void ButtonEditClicked (object sender, EventArgs e)
		{
			var template = GetSelectedTemplate ();
			if (template != null) {
				templatesToSave.Add (template);
				using (var editDialog = new EditTemplateDialog (template, false))
					if (MessageService.ShowCustomDialog (editDialog, this.Toplevel as Gtk.Window) == (int)ResponseType.Ok)
						templatesToSave.Add (template);
				HandleChanged (this, EventArgs.Empty);
			}
		}