コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: xxxxst/desktopDate
        private void Window_Closed(object sender, EventArgs e)
        {
            try {
                bool hasChanged = AutoSaveServer.ins.hasChanged;

                AutoSaveServer.ins.clear();
                NowTimeServer.ins.clear();
                TimerServer.ins.clear();
                ClockServer.ins.clear();

                if (detailWin != null)
                {
                    detailWin.Close();
                    detailWin = null;
                }

                if (hasChanged)
                {
                    saveConfig();
                }
                //xmlCfg.save();
            } catch (Exception ex) {
                Debug.WriteLine(ex.ToString());
            }
        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: xxxxst/desktopDate
        private void initDetailWin()
        {
            detailWin = new DetailWin();
            MainModel.ins.detailWin = detailWin;

            //refreshDate();

            detailWin.onClose = () => {
                //detailWin = null;
            };

            ConfigModel md = MainModel.ins.cfgMd;

            switch (md.winAlign)
            {
            case WinAlign.LeftTop: {
                detailWin.Left = Left;
                detailWin.Top  = Top + Height + 10;
                break;
            }

            case WinAlign.RightTop: {
                detailWin.Left = Left + Width - detailWin.Width;
                detailWin.Top  = Top + Height + 10;
                break;
            }

            case WinAlign.LeftBottom: {
                detailWin.Left = Left;
                detailWin.Top  = Top - detailWin.Height - 10;
                break;
            }

            case WinAlign.RightBottom:
            default: {
                detailWin.Left = Left + Width - detailWin.Width;
                detailWin.Top  = Top - detailWin.Height - 10;
                break;
            }
            }
            //detailWin.Left = Left + Width - detailWin.Width;
            //detailWin.Top = Top - detailWin.Height - 10;
        }