コード例 #1
0
ファイル: App.xaml.cs プロジェクト: MrLoong/Information-Home
        /// <summary>
        /// Application 对象的构造函数。
        /// </summary>
        public App()
        {
            Client = Connect.Client;
            // 未捕获的异常的全局处理程序。
            UnhandledException += Application_UnhandledException;

            // 标准 XAML 初始化
            InitializeComponent();

            // 特定于电话的初始化
            InitializePhoneApplication();

            // 语言显示初始化
            InitializeLanguage();

            // 调试时显示图形分析信息。
            if (Debugger.IsAttached)
            {
                // 显示当前帧速率计数器。
                Application.Current.Host.Settings.EnableFrameRateCounter = true;

                // 显示在每个帧中重绘的应用程序区域。
                //Application.Current.Host.Settings.EnableRedrawRegions = true;

                // 启用非生产分析可视化模式,
                // 该模式显示递交给 GPU 的包含彩色重叠区的页面区域。
                //Application.Current.Host.Settings.EnableCacheVisualization = true;

                // 通过禁用以下对象阻止在调试过程中关闭屏幕
                // 应用程序的空闲检测。
                //  注意: 仅在调试模式下使用此设置。禁用用户空闲检测的应用程序在用户不使用电话时将继续运行
                // 并且消耗电池电量。
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }
        }
コード例 #2
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     threadScreen = new Thread(new ThreadStart(Show_Image));
     base.OnNavigatedTo(e);
     Client = Connect.Client;
     threadScreen.Start();
 }
コード例 #3
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            this.ConPPT.IsEnabled = false;
            Client = Connect.Client;
            changlanguage();
            Client.SendCommand("data?");
            if (e.NavigationMode == NavigationMode.Back && PickFiles.PickedFiles.Count > 0)
            {
                StorageFile         file       = PickFiles.PickedFiles[0];
                IRandomAccessStream fileStream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);

                Stream stream = WindowsRuntimeStreamExtensions.AsStreamForRead(fileStream.GetInputStreamAt(0));
                byte[] bt     = ConvertStreamTobyte(stream);

                Client.SendCommand("FileName|" + file.Name);
                Thread.Sleep(1000);
                Client.SendCommand(bt);

                string[] type = file.Name.Split('.');
                if (type[type.Length - 1] == "ppt")
                {
                    this.ConPPT.IsEnabled = true;
                }
            }
        }
コード例 #4
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     Client = Connect.Client;
     changlanguage();
     threadInvite = new Thread(Invite);                            //实例化线程
     threadShare  = new Thread(new ThreadStart(GetPreview));
     if (captureSource == null)
     {
         // 创建摄像机对象。
         captureSource      = new CaptureSource();
         videoCaptureDevice = CaptureDeviceConfiguration.GetDefaultVideoCaptureDevice();
         // eventhandlers capturesource添加为。
         captureSource.CaptureFailed += new EventHandler <ExceptionRoutedEventArgs>(OnCaptureFailed);
         // 初始化相机如果存在手机上。
         if (videoCaptureDevice != null)
         {
             TheVideoBrush.SetSource(captureSource);
             captureSource.Start();
         }
         else
         {
             MessageBox.Show("您的摄像头设备不支持");
         }
     }
 }
コード例 #5
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     Client        = Connect.Client;
     threadReceive = new Thread(new ThreadStart(Show_Sound));
     Invite_Click();
     changlanguage();
 }
コード例 #6
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     changelanguage();
     Client = Connect.Client;
     timer  = new GameTimer();
     timer.UpdateInterval      = TimeSpan.FromTicks(333333);
     timer.Update             += OnUpdate;
     accHelper                 = new WPAccHelper();
     accHelper.SupportedAction = ActionEnum.LeftShake | ActionEnum.UpShake | ActionEnum.RightShake | ActionEnum.DownShake;
 }
コード例 #7
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     Client = Connect.Client;
     if (goToto == 0)
     {
         Debug.WriteLine(goToto + "+11111111" + nowName + "+" + nowWay + "+" + lastWay, DateTime.Now.ToShortTimeString());
         Client.SendCommand(@"size?0|");                //发送指令来回收大小
         int size = Client.Receive(@"size?0|");         //接收大小
         Client.SendCommand(@"0|", size);               //发送指令来回收数据
         string re_str = Client.Receive(size);          //接收数据
         Debug.WriteLine("第一" + re_str + "+" + nowName + "+" + nowWay + "+" + lastWay, DateTime.Now.ToShortTimeString());
         Documents_Items = new List <Documents_Item>(); //初始化
         string[] device = re_str.Split('|');
         for (int i = 0; i < device.Length - 1; i++)
         {
             Documents_Items.Add(new Documents_Item()
             {
                 Name = device[i], size = 40, ImageUrl = imageUrl + "Hard_Disk.png"
             });
         }
         this.top_Text.DataContext  = new Now_Top("我的电脑");
         List_Documents.ItemsSource = Documents_Items;//指定ListBox的数据来源为的数组
     }
     else if (goToto == 1)
     {
         goToto = 0;
         Debug.WriteLine(goToto + "+" + nowName + "+" + nowWay + "+" + lastWay, DateTime.Now.ToShortTimeString());
         Client.SendCommand(@"size?1|" + nowWay);                                //发送指令来回收大小
         int size = Client.Receive(@"size?1|" + nowWay);                         //接收大小
         Client.SendCommand(@"1|" + nowWay, size);                               //发送指令来回收数据
         string re_str = Client.Receive(size);                                   //接收数据
         Debug.WriteLine("第二" + re_str + "+" + nowName + "+" + nowWay + "+" + lastWay, DateTime.Now.ToShortTimeString());
         this.top_Text.DataContext = new Now_Top(nowName);
         Bind_Data(re_str);
     }
 }
コード例 #8
0
 public System_Manage()
 {
     InitializeComponent();
     this.Client = Connect.Client;
     changlanguage();
 }
コード例 #9
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     goTo = 0;
     base.OnNavigatedTo(e);
     Client = Connect.Client;
 }
コード例 #10
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     Client = Connect.Client;
     changlanguage();
 }
コード例 #11
0
 public Key_Box()
 {
     InitializeComponent();
     Client = Connect.Client;
 }