예제 #1
0
        private ListForm CreateListForm(string formTypeName)
        {
            if (Database == null)
            {
                throw new NotImplementedException("Database property");
            }

            Type type = Assembly.GetEntryAssembly().GetType(formTypeName);


            if (type == null || (type.BaseType.Name != "ListForm"))
            {
                throw new ArgumentException(EntryControl.Resources.Message.Error.WrongListForm);
            }

            ConstructorInfo constructor = type.GetConstructor(new Type[] { typeof(Database) });

            if (constructor != null)
            {
                ListForm form = (ListForm)constructor.Invoke(new object[] { Database });
                form.ItemSelected += new EventHandler(formItemSelected);
                return(form);
            }

            return(null);
        }
예제 #2
0
 private void RaiseShowListForm(ListForm form)
 {
     if (onShowListForm != null)
     {
         onShowListForm(this, new ReferenceBoxEventArgs(form));
     }
 }
예제 #3
0
 private void btnShowListForm_Click(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(ListForm))
     {
         ListForm form = CreateListForm(ListForm);
         form.SelectedItem = SelectedItem;
         RaiseShowListForm(form);
         form.Show();
     }
     else
     {
         throw new NotImplementedException("ListForm property");
     }
 }
예제 #4
0
 public ReferenceBoxEventArgs(ListForm form)
     : base()
 {
     Form = form;
 }