예제 #1
0
 public InfoShowControl(InfoDetail infoDetail)
 {
     InitializeComponent();
     infoDetail.Size16  = CommDef.Size16;
     infoDetail.Size18  = CommDef.Size18;
     infoDetail.Size20  = CommDef.Size20;
     infoDetail.Size27  = CommDef.Size27;
     infoDetail.Size50  = CommDef.Size50;
     infoDetail.Size55  = CommDef.Size55;
     infoDetail.Size277 = CommDef.Size277;
     this.DataContext   = infoDetail;
 }
예제 #2
0
        public MainWindow(Org org)
        {
            InitializeComponent();

            int height = (int)SystemParameters.WorkArea.Height;
            int width  = (int)SystemParameters.WorkArea.Width;

            this.Width  = width;
            this.Height = height;

            CommDef.ScreenMultiple = 1080 / (double)height;
            CommDef.Size8         /= CommDef.ScreenMultiple;
            CommDef.Size14        /= CommDef.ScreenMultiple;
            CommDef.Size16        /= CommDef.ScreenMultiple;
            CommDef.Size18        /= CommDef.ScreenMultiple;
            CommDef.Size20        /= CommDef.ScreenMultiple;
            CommDef.Size22        /= CommDef.ScreenMultiple;
            CommDef.Size24        /= CommDef.ScreenMultiple;
            CommDef.Size26        /= CommDef.ScreenMultiple;
            CommDef.Size27        /= CommDef.ScreenMultiple;
            CommDef.Size30        /= CommDef.ScreenMultiple;
            CommDef.Size35        /= CommDef.ScreenMultiple;
            CommDef.Size40        /= CommDef.ScreenMultiple;
            CommDef.Size48        /= CommDef.ScreenMultiple;
            CommDef.Size50        /= CommDef.ScreenMultiple;
            CommDef.Size52        /= CommDef.ScreenMultiple;
            CommDef.Size55        /= CommDef.ScreenMultiple;
            CommDef.Size60        /= CommDef.ScreenMultiple;
            CommDef.Size80        /= CommDef.ScreenMultiple;
            CommDef.Size86        /= CommDef.ScreenMultiple;
            CommDef.Size88        /= CommDef.ScreenMultiple;
            CommDef.Size90        /= CommDef.ScreenMultiple;
            CommDef.Size100       /= CommDef.ScreenMultiple;
            CommDef.Size120       /= CommDef.ScreenMultiple;
            CommDef.Size140       /= CommDef.ScreenMultiple;
            CommDef.Size180       /= CommDef.ScreenMultiple;
            CommDef.Size200       /= CommDef.ScreenMultiple;
            CommDef.Size213       /= CommDef.ScreenMultiple;
            CommDef.Size240       /= CommDef.ScreenMultiple;
            CommDef.Size277       /= CommDef.ScreenMultiple;
            CommDef.Size380       /= CommDef.ScreenMultiple;

            mainWindowFixInfo.ClassFixSize = 0;
            mainWindowFixInfo.Size14       = CommDef.Size14;
            mainWindowFixInfo.Size18       = CommDef.Size18;
            mainWindowFixInfo.Size30       = CommDef.Size30;
            mainWindowFixInfo.Size20       = CommDef.Size20;
            mainWindowFixInfo.Size22       = CommDef.Size22;
            mainWindowFixInfo.Size24       = CommDef.Size24;
            mainWindowFixInfo.Size26       = CommDef.Size26;
            mainWindowFixInfo.Size27       = CommDef.Size27;
            mainWindowFixInfo.Size40       = CommDef.Size40;
            mainWindowFixInfo.Size50       = CommDef.Size50;
            mainWindowFixInfo.Size60       = CommDef.Size60;
            mainWindowFixInfo.Size80       = CommDef.Size80;
            mainWindowFixInfo.Size86       = CommDef.Size86;
            mainWindowFixInfo.Size88       = CommDef.Size88;
            mainWindowFixInfo.Size100      = CommDef.Size100;
            mainWindowFixInfo.Size120      = CommDef.Size120;
            mainWindowFixInfo.Size180      = CommDef.Size180;
            mainWindowFixInfo.Size200      = CommDef.Size200;
            mainWindowFixInfo.Size213      = CommDef.Size213;
            mainWindowFixInfo.Size240      = CommDef.Size240;
            mainWindowFixInfo.Size380      = CommDef.Size380;
            this.DataContext = mainWindowFixInfo;

            String CurrPath = Directory.GetCurrentDirectory().Trim();

            if (CurrPath.EndsWith("upgrade"))
            {
                System.IO.Directory.SetCurrentDirectory(@"../");
            }

            InfoDetail orginfo = new InfoDetail();
            Bitmap     orgBmp  = null;

            try {
                orgBmp = (Bitmap)Bitmap.FromFile(".\\Images\\org.png");
            } catch (Exception err) {
                orgBmp = Properties.Resources.org;
            }
            orginfo.InfoImage = BitmapToBitmapImage(orgBmp);
            orginfo.InfoTitle = "培训学校";
            orginfo.InfoText  = org.name;
            InfoShowControl infoShow = new InfoShowControl(orginfo);

            this.OrgInfoList.Children.Add(infoShow);
            InfoDetail dateinfo = new InfoDetail();
            Bitmap     dateBmp  = null;

            try {
                dateBmp = (Bitmap)Bitmap.FromFile(".\\Images\\date.png");
            } catch (Exception err) {
                dateBmp = Properties.Resources.date;
            }
            dateinfo.InfoImage = BitmapToBitmapImage(dateBmp);
            dateinfo.InfoTitle = "日期";
            dateinfo.InfoText  = GetCurrDate();
            infoShow           = new InfoShowControl(dateinfo);
            this.OrgInfoList.Children.Add(infoShow);

            InfoDetail addinfo    = new InfoDetail();
            Bitmap     addressBmp = null;

            try {
                addressBmp = (Bitmap)Bitmap.FromFile(".\\Images\\addr.png");
            } catch (Exception err) {
                addressBmp = Properties.Resources.address;
            }
            addinfo.InfoImage = BitmapToBitmapImage(addressBmp);
            addinfo.InfoTitle = "地址";
            addinfo.InfoText  = org.address;
            infoShow          = new InfoShowControl(addinfo);
            this.OrgInfoList.Children.Add(infoShow);

            mGreen = new SolidColorBrush(System.Windows.Media.Color.FromRgb(0x43, 0xA0, 0x47));
            Thread signUp = new Thread(new ThreadStart(SignUpHandler));

            signUp.IsBackground = true;
            signUp.Start();
        }