public companyWindow(CompanyRepository companyRepository, BillRepository billRepository, BillManager billManager)
        {
            this.companyRepository = companyRepository;
            this.billRepository = billRepository;
            this.billManager = billManager;

            CompanyWindowViewModel = new InformationWindowViewModel<Company>();
            CompanyWindowViewModel.Items = new ObservableCollection<Company>(companyRepository.All.ToList());

            InitializeComponent();

            DataContext = this;

            controller = new InformationWindowController<Company>(CompanyWindowViewModel, companies_ComboBox,
                new TextBox[]
            {
                companyName_TextBox,
                companyStreet_TextBox,
                companyCity_TextBox,
                companyPostalCode_TextBox,
                companyID_TextBox,
                companyAccountNumber_TextBox,
                companyBankName_TextBox,
                companyBankBIC_TextBox,
                companyBillerName_TextBox,
                companyPhoneNumber_TextBox,
                companyEmailAddress_TextBox
            });
        }
Beispiel #2
0
        public void InformationWindowViewModelTest()
        {
            string key = "Info";
            var    vm  = new InformationWindowViewModel(key);

            vm.Setting.TopMost   = true;
            vm.Setting.Placement = new MetroRadiance.Interop.Win32.WINDOWPLACEMENT();
            SettingsHost.SaveFile();
        }
Beispiel #3
0
        public MainWindow()
        {
            InitializeComponent();

            model = new EzBillingModel();
            clientRepository = new ClientRepository(model);
            companyRepository = new CompanyRepository(model);
            billRepository = new BillRepository(model);

            excelConnection = new ExcelConnection();
            billManager = new BillManager();

            clientWindow = new clientWindow(clientRepository, billRepository, billManager);
            companyWindow = new companyWindow(companyRepository, billRepository, billManager);

            clientWindow.Closing += new CancelEventHandler(window_Closing);
            companyWindow.Closing += new CancelEventHandler(window_Closing);

            ClientViewModel = new InformationWindowViewModel<Client>();
            ClientViewModel.Items = new ObservableCollection<Client>(clientRepository.All.ToList());

            CompanyViewModel = new InformationWindowViewModel<Company>();
            CompanyViewModel.Items = new ObservableCollection<Company>(companyRepository.All.ToList());
            CompanyViewModel.PropertyChanged += CompanyViewModel_PropertyChanged;

            ProductViewModel = new InformationWindowViewModel<Product>();
            ProductViewModel.Items = new ObservableCollection<Product>();
            ProductViewModel.PropertyChanged += ProductViewModel_PropertyChanged;

            BillViewModel = new InformationWindowViewModel<Bill>();
            BillViewModel.Items = new ObservableCollection<Bill>();
            BillViewModel.PropertyChanged += BillViewModel_PropertyChanged;

            this.Closing += MainWindow_Closing;

            productSectionInputFields = new TextBox[]
            {
                productName_TextBox,
                productQuantity_TextBox,
                productUnit_TextBox,
                productUnitPrice_TextBox,
                productVATPercent_TextBox
            };

            DataContext = this;

            excelConnection.Open();
        }
Beispiel #4
0
        public void Initialize()
        {
            if (GeneralSettings.IsProxyMode)
            {
                // プロキシ モード (艦これのウィンドウを表示しないやつ)
                // KanColleWindow は作らず、InformationWindow を MainWindow として運用する
                this.informationWindow = new InformationWindowViewModel(true);
                this.MainWindow        = this.informationWindow;
            }
            else
            {
                // 通常モード ((艦これ + 情報ウィンドウ) or その分割)
                this.kanColleWindow = new KanColleWindowViewModel(true);
                this.MainWindow     = this.kanColleWindow;
            }

            KanColleClient.Current.Subscribe(nameof(KanColleClient.IsStarted), this.UpdateMode).AddTo(this);
            KanColleClient.Current.Subscribe(nameof(KanColleClient.IsInSortie), this.UpdateMode).AddTo(this);
        }
Beispiel #5
0
        public void Test1()
        {
            var target   = new PrivateType(typeof(SettingsHost));
            var fullpath = (string)target.GetStaticField("fullpath");

            if (File.Exists(fullpath) == true)
            {
                File.Delete(fullpath);
            }

            SettingsHost.Init();
            var vm = new InformationWindowViewModel();

            vm.Setting.Topmost = true;                  //ここでプロパティを書き換え
            Console.WriteLine(vm.Setting.Topmost);

            SettingsHost.SaveFile();

            var wsetting = SettingsHost.Instance <InformationWindowSetting>();

            Console.WriteLine(wsetting.Topmost);
        }