示例#1
0
 private void lnkClose_Tap(object sender, System.Windows.Input.GestureEventArgs e)
 {
     //광고 컨트롤 추가
     VersionUtils.DecideAdControl(this.LayoutRoot, this.txtInfomation);
     SettingManager.Instance.UpdateNLoad(SettingManager.KEY_GETTING_START, false);
     this.LayoutRoot.Children.Remove(layerGettingStart);
 }
示例#2
0
 private void lnkHide_Tap(object sender, System.Windows.Input.GestureEventArgs e)
 {
     //광고 컨트롤 추가
     VersionUtils.DecideAdControl(this.LayoutRoot, this.txtInfomation);
     this.LayoutRoot.Children.Remove(layerGettingStart);
 }
示例#3
0
        // 생성자
        public MainPage()
        {
            InitializeComponent();

            //기본 설정 로드
            DeviceInfo.Load();
            ResourceUri.Load();

            // ApplicationBar를 지역화하는 샘플 코드
            BuildLocalizedApplicationBar();

            //터치 재사용 객체 생성
            touchInfos = new TouchInfo[5];
            for (int i = 0; i < touchInfos.Length; i++)
            {
                touchInfos[i] = new TouchInfo();
            }

            Touch.FrameReported += new TouchFrameEventHandler(Touch_FrameReported);
            PointingControlManager.Instance.PropertyChanged    += pointerCtrlMgr_PropertyChanged;
            PointingControlManager.Instance.ImageReceiveFailed += Instance_ImageReceiveFailed;
            PointingControlManager.Instance.DeviceType          = SettingManager.Instance.SettingInfo.DeviceType;
            PointingControlManager.Instance.ImageQualityType    = SettingManager.Instance.SettingInfo.ImageQualityType;

            //접속 체크 쓰레드 함수 생성 및 시작
            new Thread(CheckConnectionThreadFn).Start();

            //메세지팁 생성
            msgTip                   = new Apps.UI.Notification.MessageTip();
            msgTip.MaxWidth          = DeviceInfo.ScreenWidth * 0.75;
            msgTip.Margin            = new Thickness(15);
            msgTip.VerticalAlignment = System.Windows.VerticalAlignment.Bottom;
            LayoutRoot.Children.Add(msgTip);

            //로딩 팝업을 위한 백그라운드 워커
            loadWorker                     = new BackgroundWorker();
            loadWorker.DoWork             += loadWorker_DoWork;
            loadWorker.RunWorkerCompleted += loadWorker_RunWorkerCompleted;

            //데이터 용량 알림 이벤트 핸들러 등록
            AppLoader.CellularDataUtil.NotifyUsagePerMegaBytes += CellularDataUtil_NotifyUsagePerMegaBytes;

            //기본 키보드 생성
            Apps.UI.Keyboard.Keyboard keybd = new Apps.UI.Keyboard.Keyboard();
            keybd.Margin = new Thickness(10);
            keybdLayer.Children.Add(keybd);

            //화면상의 모든 객체를 숨김으로 처리
            HideAllChildren();
            //기본 셋팅 버튼만 표시
            UIUtils.SetVisibility(btnMenu, true);
            //앱바 및 버튼 상태 업데이트
            UpdateUIElements();

            bool isShowGettingStart = SettingManager.Instance.SettingInfo.GettingStart;

            //자동 재접속
            if (NetworkUtils.IsNetworkAvailable && SettingManager.Instance.SettingInfo.AutoConnect)
            {
                ServerInfo serverInfo = SettingManager.Instance.SettingInfo.ServerInfo;
                if (!string.IsNullOrEmpty(serverInfo.ServerIP) && serverInfo.AccessCode >= 1000 &&
                    serverInfo.TcpPort > 0 && serverInfo.UdpPort > 0)
                {
                    isShowGettingStart = false;
                    ConnectionManager.Instance.ConnectionInfo.CurrentServer = serverInfo;
                    //접속 요청
                    txtInfomation.Text = I18n.GetString("ServerConnectPageConnecting");
                    System.Net.Sockets.SocketError result = (System.Net.Sockets.SocketError)ConnectionManager.Instance.ConnectServer(
                        SettingManager.Instance.SettingInfo.DeviceType,

                        new CallbackHandler(CallbackConnectServer));
                }
            }

            //마우스 배경화면
            backgroundTouchScreenBitmap = new WriteableBitmap(0, 0).FromContent(ResourceUri.IMG_TOUCHSCREEN_BACKGROUND);
            backgroundMouseBitmap       = new WriteableBitmap(0, 0).FromContent(ResourceUri.IMG_MOUSE_BACKGROUND);
            UpdateBackgroundImage(SettingManager.Instance.SettingInfo.DeviceType == DeviceTypes.Mouse ? backgroundMouseBitmap : backgroundTouchScreenBitmap);

            //시작하기
            UIUtils.SetVisibility(layerGettingStart, isShowGettingStart);

            if (!isShowGettingStart)
            {
                //광고 컨트롤 추가
                VersionUtils.DecideAdControl(this.LayoutRoot, this.txtInfomation);
            }
        }