Esempio n. 1
0
        public AboutWindow(AboutInfomation aboutInfo)
        {
            InitializeComponent();

            this.about = aboutInfo;

            UpdateDisplay(aboutInfo);
        }
Esempio n. 2
0
 private void UpdateDisplay(AboutInfomation aboutInfo)
 {
     this.name.Text        = aboutInfo.ProductName;
     this.version.Text     = aboutInfo.ProductVersion;
     this.copyright.Text   = aboutInfo.Copyright;
     this.author.Text      = aboutInfo.Author;
     this.description.Text = aboutInfo.Description;
 }
Esempio n. 3
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            dataSavePath   = this.loginedUser.UserFolder + "\\accounts.acc";
            infoSavePath   = this.loginedUser.UserFolder + "\\logcat.log";
            annualSavePath = this.loginedUser.UserFolder + "\\annuals.ann";

            //先创建好不存在的文件
            if (!File.Exists(dataSavePath))
            {
                File.Create(dataSavePath);
            }

            if (!File.Exists(infoSavePath))
            {
                File.Create(infoSavePath);
            }

            if (!File.Exists(annualSavePath))
            {
                File.Create(annualSavePath);
            }

            //为账户创建存储目录
            if (!Directory.Exists(loginedUser.UserFolder))
            {
                Directory.CreateDirectory(loginedUser.UserFolder);
            }
            //首先加载保存的信息
            LoadSaveDatas();

            //如果静态账户为空,创建4个静态账户
            if (this.staticAccountCollection.Count == 0)
            {
                //创建静态总额账户
                AccountClass totalAccount = new AccountClass("total", 0.0, "记录当前资金总额", AccountClass.AccoutType.总额);
                this.staticAccountCollection.Add(totalAccount);

                //创建静态工资账户
                AccountClass salaryAccount = new AccountClass("salary", 0.0, "记录工资收入情况", AccountClass.AccoutType.收);
                this.staticAccountCollection.Add(salaryAccount);

                //创建静态其他收入账户
                AccountClass anotherInAccount = new AccountClass("anotherIncome", 0.0, "记录其他收入情况", AccountClass.AccoutType.收);
                this.staticAccountCollection.Add(anotherInAccount);

                //创建静态支出账户
                AccountClass outlayAccount = new AccountClass("outlay", 0.0, "记录总支出情况", AccountClass.AccoutType.支);
                this.staticAccountCollection.Add(outlayAccount);
            }

            //设置绑定
            MySetContentBinding(this.staticAccountCollection[0], "TotalValue", this.totalValueLb);
            MySetContentBinding(this.staticAccountCollection[1], "TotalValue", this.salaryValueLb);
            MySetContentBinding(this.staticAccountCollection[2], "TotalValue", this.otherValueLb);
            MySetContentBinding(this.staticAccountCollection[3], "TotalValue", this.spendValueLb);

            //设置数据源
            this.accountsGrid.ItemsSource = this.dynamicAccountCollection;

            //设置当前选择第一个账户
            this.accountsGrid.SelectedIndex = 0;

            //设置当前选择的账户对象
            //currentAccount = this.dynamicAccountCollection[0];

            //当前账户不为空,绑定
            MySetContentBinding(this.currentAccount, "TotalValue", this.selectAccountTotalValueLb);

            //为源combobox控件添加items
            UpdateTransSrcItems();

            //this.srcAccountCmb.ItemsSource = this.dynamicAccountCollection;
            this.desAccountCmb.ItemsSource = this.desAccountCollection;

            //加载年度计划
            LoadAnnuals();

            //初始化关于信息加载与保存的参数
            this.aboutSavepath = this.loginedUser.UserFolder + "\\about.sav";

            if (!aboutInfo.Load(this.aboutSavepath))
            {
                aboutInfo = new AboutInfomation(this.newAppName, this.newCopyright, this.newAuthor,
                                                this.newDescription, this.newContackInfo);
            }
        }