protected ToggleButtonViewModel()
 {
     Diag.DataBindingPresentation();
     ToggleButtonPosition = _leftAlignment;
     ToggleButtonMargins  = _leftThickness;
     ToggleButtonColor    = _leftColor;
 }
        /// <summary>
        /// Creates a new repository of customers.
        /// </summary>
        /// <param name="customerDataFile">The relative path to an XML resource file that contains customer data.</param>
        public CustomerRepository(string customerDataFile)
        {
            Diag.DataBindingPresentation();

            _customers = LoadCustomers(customerDataFile);


            try
            {
                Diag.UpdateLog("(2) " + GetType().FullName + ";\t" + System.Reflection.MethodBase.GetCurrentMethod().Name + ";\t" + _customers.Count.ToString());
            }
            catch (Exception ex)
            {
                Diag.UpdateLog("(2) " + GetType().FullName + ";\t" + System.Reflection.MethodBase.GetCurrentMethod().Name + ";\t" + ex.Message);
            }
        }
Esempio n. 3
0
 public static Customer CreateCustomer(
     double totalSales,
     string firstName,
     string lastName,
     bool isCompany,
     string email)
 {
     Diag.DataBindingPresentation();
     return(new Customer
     {
         TotalSales = totalSales,
         FirstName = firstName,
         LastName = lastName,
         IsCompany = isCompany,
         Email = email
     });
 }
Esempio n. 4
0
        public CustomerViewModel(Customer customer, CustomerRepository customerRepository)
        {
            Diag.DataBindingPresentation();

            if (customer == null)
            {
                throw new ArgumentNullException("customer");
            }

            if (customerRepository == null)
            {
                throw new ArgumentNullException("customerRepository");
            }

            _customer           = customer;
            _customerRepository = customerRepository;
            _customerType       = Strings.CustomerViewModel_CustomerTypeOption_NotSpecified;
        }
Esempio n. 5
0
        public AllCustomersViewModel(CustomerRepository customerRepository)
        {
            Diag.DataBindingPresentation();

            if (customerRepository == null)
            {
                throw new ArgumentNullException("customerRepository");
            }

            base.ViewModelBaseInstanceName = Strings.AllCustomersViewModel_DisplayName;
            Diag.UpdateLog("(547865\tAllCustomersViewModel(C )\tbase.ViewModelBaseInstanceName \t" + base.ViewModelBaseInstanceName);
            _customerRepository = customerRepository;

            // Subscribe for notifications of when a new customer is saved.
            _customerRepository.CustomerAdded += OnCustomerAddedToRepository;

            // Populate the AllCustomers collection with CustomerViewModels.
            CreateAllCustomers();
        }
Esempio n. 6
0
        public CommandViewModel(string displayName, ICommand command)
        {
            Diag.DataBindingPresentation();
            if (command == null)
            {
                throw new ArgumentNullException("command");
            }

            base.ViewModelBaseInstanceName = displayName;
            Diag.UpdateLog("(789056\tCommandViewModel( )\tbase.ViewModelBaseInstanceName \t" + base.ViewModelBaseInstanceName);

            ControlPanelHyperlinkInvokeCommand = command;


            try
            {
                Diag.UpdateLog("(6)\t" + this.GetType().FullName + ";\t" + System.Reflection.MethodBase.GetCurrentMethod().Name + ";\t" + displayName + ";\t" + command.ToString());
            }
            catch (Exception ex)
            {
                Diag.UpdateLog("(6)\t" + this.GetType().FullName + ";\t" + System.Reflection.MethodBase.GetCurrentMethod().Name + ";\t" + ex.Message);
            }
        }
        public MainWindowViewModel(string customerDataFile)
        {
            Diag.DataBindingPresentation();


            base.ViewModelBaseInstanceName = Strings.MainWindowViewModel_DisplayName;
            Diag.UpdateLog("(451289)\tMainWindowViewModel()\tbase.ViewModelBaseInstanceName\t" +
                           base.ViewModelBaseInstanceName);

            _customerRepository = new CustomerRepository(customerDataFile);


            try
            {
                Diag.UpdateLog("(8)\t" + GetType().FullName + ";\t" +
                               System.Reflection.MethodBase.GetCurrentMethod().Name + ";\t" +
                               base.ViewModelBaseInstanceName + ";\t" +
                               _customerRepository.ToString());
            }
            catch (Exception ex)
            {
                Diag.UpdateLog("(8)\t" + GetType().FullName + ";\t" + System.Reflection.MethodBase.GetCurrentMethod().Name + ";\t" + ex.Message);
            }
        }
 public CustomerAddedEventArgs(Customer newCustomer)
 {
     Diag.DataBindingPresentation();
     this.NewCustomer = newCustomer;
 }
Esempio n. 9
0
 protected Customer()
 {
     Diag.DataBindingPresentation();
 }
Esempio n. 10
0
 public static Customer CreateNewCustomer()
 {
     Diag.DataBindingPresentation();
     return(new Customer()); //Empty data customer
 }
Esempio n. 11
0
 public AllCustomersView()
 {
     InitializeComponent();
     Diag.DataBindingPresentation();
 }
Esempio n. 12
0
 protected WorkspaceViewModel()
 {
     Diag.DataBindingPresentation();
 }