public override void Enable()
 {
     this.BillingAddressChoice.Enable();
     if (this.PaymentMethodView != null)
     {
         CreditCardPaymentForm.Enable();
         SecureNetPaymentView.Enable();
         TwoCheckoutPaymentView.Enable();
         CheckPaymentView.Enable();
         RequestQuoteView.Enable();
         PayPalPaymentView.Enable();
         PurchaseOrderPaymentView.Enable();
         PayPalExpressView.Enable();
         MicroPayPaymentView.Enable();
         CheckOutByAmazonPaymentView.Enable();
         PayPalEmbeddedCheckoutPaymentView.Enable();
         MoneybookersQuickCheckoutPaymentView.Enable();
         ECheckPaymentView.Enable();
         WorldPayPaymentView.Enable();
         if (IsFirstPay)
         {
             this.FirstPayPaymentForm.Enable();
         }
     }
 }
    public override void SetModel(IPaymentModel model, IStringResourceProvider stringResourceProvider)
    {
        base.SetModel(model, stringResourceProvider);

        this.BillingAddressChoice.SetModel(model.AccountModel, this.StringResourceProvider);

        CodPaymentView.SetModel(null, this.StringResourceProvider);
        CreditCardPaymentForm.SetModel(null, this.StringResourceProvider);
        SecureNetPaymentView.SetModel(null, this.StringResourceProvider);
        TwoCheckoutPaymentView.SetModel(null, this.StringResourceProvider);
        CheckPaymentView.SetModel(null, this.StringResourceProvider);
        RequestQuoteView.SetModel(null, this.StringResourceProvider);
        PayPalPaymentView.SetModel(null, this.StringResourceProvider);
        PurchaseOrderPaymentView.SetModel(null, this.StringResourceProvider);
        PayPalExpressView.SetModel(null, this.StringResourceProvider);
        MicroPayPaymentView.SetModel(null, this.StringResourceProvider);
        CheckOutByAmazonPaymentView.SetModel(null, this.StringResourceProvider);
        PayPalEmbeddedCheckoutPaymentView.SetModel(null, this.StringResourceProvider);
        MoneybookersQuickCheckoutPaymentView.SetModel(null, this.StringResourceProvider);
        ECheckPaymentView.SetModel(null, this.StringResourceProvider);
        WorldPayPaymentView.SetModel(null, this.StringResourceProvider);

        foreach (var paymentModel in this.Model.PaymentMethods)
        {
            var paymentView = FindPaymentMethodView(paymentModel.Key);
            if (paymentView != null)
            {
                paymentView.SetModel(paymentModel.Value, this.StringResourceProvider);
                ((IPaymentMethodView)paymentView).PaymentFormSubmitted += OPCControls_PaymentFormAndBillingAddress_PaymentFormSubmitted;
            }

            if (paymentModel.Value.PaymentType == PaymentType.SecureNet)
            {
                SecureNetPaymentView.ExistingCreditCardSelected += (o, e) => CreditCardPaymentForm.Hide();
                SecureNetPaymentView.NewCreditCardSelected      += (o, e) =>
                {
                    CreditCardPaymentForm.Initialize();
                    CreditCardPaymentForm.Show();
                    CreditCardPaymentForm.BindView();
                };

                Model.ProcessingPayment += (o, e) =>
                {
                    if (!(e.PaymentMethod is CreditCardPaymentModel) && !(e.PaymentMethod is SecureNetPaymentModel))
                    {
                        return;
                    }

                    ((SecureNetPaymentModel)paymentModel.Value).SwitchPaymentMethod();
                };
            }
        }

        this.ActivatePaymentView();
    }
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Model model = new Model(Resources.ProductsTable);
            OrderPresentationModel orderPresentationModel = new OrderPresentationModel(model);
            CreditCardPaymentForm  creditCardPaymentForm  = new CreditCardPaymentForm(model);
            MainForm mainForm = new MainForm(creditCardPaymentForm, orderPresentationModel, new ProductsManagementTabPagePresentationModel(model), new ProductTypesManagementTabPagePresentationModel(model), model);

            Application.Run(mainForm);
        }
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Model model = new Model();
            OrderPresentationModel orderPresentationModel = new OrderPresentationModel(model);
            CreditCardPaymentForm  creditCardPaymentForm  = new CreditCardPaymentForm(model);
            MainForm mainForm = new MainForm(creditCardPaymentForm, new InventoryPresentationModel(model), new MainPresentationModel(), orderPresentationModel, new ProductManagementPresentationModel(model), model);

            Application.Run(mainForm);
        }