public VideoControlDecal(VideoDecal video)
        {
            CanResize = false;
            Stretch = System.Windows.Media.Stretch.None;
            Center = new System.Windows.Point(0.5,1);
            PinPoint = new System.Windows.Point(0.5,1);
            CanMove = false;

            VideoDecal = video;

            Play = new DelegateCommand(() =>
            {
                IsPlay = !IsPlay;
            });
        }
Пример #2
0
        public VideoControlDecal(VideoDecal video)
        {
            CanResize = false;
            Stretch   = System.Windows.Media.Stretch.None;
            Center    = new System.Windows.Point(0.5, 1);
            PinPoint  = new System.Windows.Point(0.5, 1);
            CanMove   = false;

            VideoDecal = video;

            Play = new DelegateCommand(() =>
            {
                IsPlay = !IsPlay;
            });
        }
Пример #3
0
        public Card()
        {
            _isTextPresent = -1;
            _isImagePresent = -1;
            _isVideoPresent = -1;
            _isAudioPresent = -1;
            _isUrlPresent = -1;

            MetaData = new MetaData();

            MetaData.Color = Colors.White;

            _decals = new ObservableCollection<Decal>();

            #if !SILVERLIGHT
            AddText = new DelegateCommand(() =>
            {
                TextDecal decal = new TextDecal();
                AddDecal(decal);

                decal.DelaySelect(true);
            }, CanAddText);

            AddImage = new DelegateCommand<string>((path) =>
            {
                ImageDecal Idecal = new ImageDecal();

                CommonOpenFileDialog cfd = new CommonOpenFileDialog((string)Application.Current.FindResource("Resource_SaveDialogTitle_AddImage"));

                cfd.EnsureReadOnly = true;

                // Set the initial location as the path of the library
                cfd.InitialDirectoryShellContainer = KnownFolders.PicturesLibrary as ShellContainer;

                if (cfd.ShowDialog() == CommonFileDialogResult.Ok)
                {
                    // Get the selection from the user.
                    ShellObject so = cfd.FileAsShellObject;
                    if(so.ParsingName != null)
                    {
                        ((ImageMetaData)Idecal.MetaData).Source = so.ParsingName;
                        AddDecal(Idecal);

                        Idecal.DelaySelect(true);
                    }
                }

            }, CanAddImage);

            AddVideo = new DelegateCommand<string>((path) =>
            {

                CommonOpenFileDialog cfd = new CommonOpenFileDialog((string)Application.Current.FindResource("Resource_SaveDialogTitle_AddVideo"));

                cfd.EnsureReadOnly = true;

                // Set the initial location as the path of the library
                cfd.InitialDirectoryShellContainer = KnownFolders.VideosLibrary as ShellContainer;

                if (cfd.ShowDialog() == CommonFileDialogResult.Ok)
                {
                    // Get the selection from the user.
                    ShellObject so = cfd.FileAsShellObject;
                    if (so.ParsingName != null)
                    {
                        VideoDecal Idecal = new VideoDecal();
                        ((VideoMetaData)Idecal.MetaData).Source = so.ParsingName;
                        AddDecal(Idecal);

                        VideoControlDecal control = new VideoControlDecal(Idecal);

                        Idecal.VideoControl = control;
                        AddDecal(control);

                        Idecal.DelaySelect(true);
                    }
                }

            }, CanAddVideo);

            AddAudio = new DelegateCommand(() =>
            {
                TextToSpeechDecal decal = new TextToSpeechDecal();
                AddDecal(decal);
                decal.DelaySelect(true);
            }, CanAddAudio);

            AddUrl = new DelegateCommand(() =>
            {
                InfoLinkDecal decal = new InfoLinkDecal();
                AddDecal(decal);
                decal.DelaySelect(true);
            }, CanAddUrl);

            RemoveDecal = new DelegateCommand<Decal>((decal) =>
            {
                if (decal == null)
                    decal = SelectedDecal;

                if (decal != null)
                {
                    decal.UnInitialize();
                    DeleteDecal(decal);
                }
            });
            #endif
        }
Пример #4
0
        public Card()
        {
            _isTextPresent  = -1;
            _isImagePresent = -1;
            _isVideoPresent = -1;
            _isAudioPresent = -1;
            _isUrlPresent   = -1;

            MetaData = new MetaData();

            MetaData.Color = Colors.White;

            _decals = new ObservableCollection <Decal>();

#if !SILVERLIGHT
            AddText = new DelegateCommand(() =>
            {
                TextDecal decal = new TextDecal();
                AddDecal(decal);

                decal.DelaySelect(true);
            }, CanAddText);

            AddImage = new DelegateCommand <string>((path) =>
            {
                ImageDecal Idecal = new ImageDecal();

                CommonOpenFileDialog cfd = new CommonOpenFileDialog((string)Application.Current.FindResource("Resource_SaveDialogTitle_AddImage"));

                cfd.EnsureReadOnly = true;

                // Set the initial location as the path of the library
                cfd.InitialDirectoryShellContainer = KnownFolders.PicturesLibrary as ShellContainer;

                if (cfd.ShowDialog() == CommonFileDialogResult.Ok)
                {
                    // Get the selection from the user.
                    ShellObject so = cfd.FileAsShellObject;
                    if (so.ParsingName != null)
                    {
                        ((ImageMetaData)Idecal.MetaData).Source = so.ParsingName;
                        AddDecal(Idecal);

                        Idecal.DelaySelect(true);
                    }
                }
            }, CanAddImage);

            AddVideo = new DelegateCommand <string>((path) =>
            {
                CommonOpenFileDialog cfd = new CommonOpenFileDialog((string)Application.Current.FindResource("Resource_SaveDialogTitle_AddVideo"));

                cfd.EnsureReadOnly = true;

                // Set the initial location as the path of the library
                cfd.InitialDirectoryShellContainer = KnownFolders.VideosLibrary as ShellContainer;

                if (cfd.ShowDialog() == CommonFileDialogResult.Ok)
                {
                    // Get the selection from the user.
                    ShellObject so = cfd.FileAsShellObject;
                    if (so.ParsingName != null)
                    {
                        VideoDecal Idecal = new VideoDecal();
                        ((VideoMetaData)Idecal.MetaData).Source = so.ParsingName;
                        AddDecal(Idecal);

                        VideoControlDecal control = new VideoControlDecal(Idecal);

                        Idecal.VideoControl = control;
                        AddDecal(control);

                        Idecal.DelaySelect(true);
                    }
                }
            }, CanAddVideo);

            AddAudio = new DelegateCommand(() =>
            {
                TextToSpeechDecal decal = new TextToSpeechDecal();
                AddDecal(decal);
                decal.DelaySelect(true);
            }, CanAddAudio);

            AddUrl = new DelegateCommand(() =>
            {
                InfoLinkDecal decal = new InfoLinkDecal();
                AddDecal(decal);
                decal.DelaySelect(true);
            }, CanAddUrl);

            RemoveDecal = new DelegateCommand <Decal>((decal) =>
            {
                if (decal == null)
                {
                    decal = SelectedDecal;
                }

                if (decal != null)
                {
                    decal.UnInitialize();
                    DeleteDecal(decal);
                }
            });
#endif
        }