示例#1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            LaoTzuForm       laoTzu     = new LaoTzuForm();
            List <MenuStrip> toolStrips = new List <MenuStrip>();

            toolStrips.Add(laoTzu.MenuStripMain);
            FormModelBinder modelBinder = new FormModelBinder(laoTzu.Controls, toolStrips);
            LaoTzuViewModel viewModel   = new LaoTzuViewModel(modelBinder, laoTzu);

            modelBinder.ViewModel = viewModel;
            modelBinder.Bind();
            Application.Run(laoTzu);
        }
示例#2
0
 public LaoTzuViewModel(FormModelBinder binder, LaoTzuForm form)
 {
     DefaultConfiguration.SetProperties(this, false);
     if (string.IsNullOrEmpty(ExtractorFolder))
     {
         ExtractorFolder = ".";
     }
     this.Form                   = form;
     this.FormModelBinder        = binder;
     this.MappedSchemaDefinition = new MappedSchemaDefinition(".\\LaoTzu.{0}"._Format(MappedSchemaExtension));
     this.Form.ListViewTables.ItemSelectionChanged += (o, a) =>
     {
         PopulateColumnNameMapList();
     };
 }