コード例 #1
0
        private void setDesktop_Click(object sender, RoutedEventArgs e)
        {
            if (vw != null)
            {
                vw.Close();
                return;
            }
            //Debug.WriteLine(" UriSchemePack :  " + PackUriHelper.UriSchemePack);
            string s = System.IO.Packaging.PackUriHelper.UriSchemePack;

            vw         = new VideoWindow();
            vw.Closed += (s3, e3) =>
            {
                Debug.WriteLine("vw is closed");
            };
            App.Current.MainWindow.Closing += (e2, s2) => {
                if (vw != null)
                {
                    vw.Close();
                }
            };
            vw.Loaded += (s1, e1) =>
            {
                //Tool.ScreenInfo(vw);
                win32.CustomDesktop(vw);
            };

            //Uri u = new Uri(CreateAbsolutePathTo("Assets/Media/121.gif"), UriKind.Relative);
            //Uri u = new Uri("ms-appx:///Assets/Media/121.gif", UriKind.Absolute);
            //Uri u1 = new Uri("App.xaml",UriKind.Relative);
            //Uri u = new Uri("pack://application:,,,/Assets/Media/121.gif", UriKind.Absolute);
            Uri u = new Uri("Assets/Media/121.gif", UriKind.Relative);

            //Uri u3 = new Uri("Animation.ico", UriKind.Relative);
            //System.Windows.MessageBox.Show("u.uri: "+u.AbsoluteUri);
            //Debug.WriteLine("URL:" + u);
            //Debug.WriteLine("is file:"+u.IsFile);
            //Debug.WriteLine("path: "+AppDomain.CurrentDomain.BaseDirectory);

            //Debug.WriteLine("helper: " + PackUriHelper.GetPartUri(u));
            vw.MyME.Source = u;
            vw.MyME.Play();

            vw.UpdateLayout();
            vw.Show();
        }
コード例 #2
0
        private void PLAY_Click(object sender, RoutedEventArgs e)
        {
            //if (choosedFile.Text != null)
            //{
            //    System.Windows.MessageBox.Show("The file is setted!");
            //}
            //Uri iconUri = new Uri("pack://application:,,,/Animation.ico");
            //Icon  i= new Icon("Animation.ico");
            ////(App.Current as App).launchNotification();
            //StringBuilder s = new StringBuilder();
            //s.AppendLine("File: " + iconUri.AbsolutePath);
            //s.AppendLine("Uri: " + iconUri.AbsoluteUri);
            ////s.AppendLine("FileExist: "+ FileExists());
            //choosedFile.Text = "File:"+iconUri.AbsolutePath;
            //(App.Current as App).launchNotification();


            //VideoController.playback("11");
            //VideoController.play();

            VideoWindow v = new VideoWindow();

            v.Show();
        }