﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PostSharp.Laos;

namespace AopForms.Aspect
{
    [Serializable()]
    class CreateAnything : OnMethodBoundaryAspect
    {
        public override void OnEntry(MethodExecutionEventArgs eventArgs)
        {
            InputDialog dlg = new InputDialog();
            if (dlg.ShowDialog() != System.Windows.Forms.DialogResult.OK) return;

            ElementEventArgs ea = new ElementEventArgs();
            ea.Element = dlg.Input;

            Controller.InvokeSomethingCreated(this, ea);
        }
    }
}
