Exemplo n.º 1
0
 public void ShowEncryptionIndicatorWindow(bool bshow)
 {
     encryptionIndicatoWindow.ShowWindow = bshow;
     encryptionIndicatoWindow.Refresh();
     if (bshow)
     {
         encryptionIndicatoWindow.UpdateWindow();
     }
     else
     {
         _lastEncryption = MediaEncryptionIndicator.None;
     }
 }
Exemplo n.º 2
0
        public void UpdateEncryptionIndicator(MediaEncryptionIndicator currentEncryption)
        {
            if (_lastEncryption != currentEncryption)
            {
                var currentIndicator = "EncryptionOff";
                var lastIndicator    = "EncryptionOff";
                switch (_lastEncryption)
                {
                case MediaEncryptionIndicator.On:
                    lastIndicator = "EncryptionOn";
                    break;

                case MediaEncryptionIndicator.Off:
                    lastIndicator = "EncryptionOff";
                    break;

                default:
                    lastIndicator = "None";
                    break;
                }

                switch (currentEncryption)
                {
                case MediaEncryptionIndicator.On:
                    currentIndicator = "EncryptionOn";
                    break;

                case MediaEncryptionIndicator.Off:
                    currentIndicator = "EncryptionOff";
                    break;

                default:
                    return;
                }

                _lastEncryption = currentEncryption;
                var container =
                    FindChild <Grid>(encryptionIndicatoWindow.TransparentWindow, "MediaEncryptionContainer");
                if (container != null)
                {
                    var image =
                        FindChild <Image>(container, lastIndicator);
                    if (image != null)
                    {
                        image.Visibility = Visibility.Collapsed;
                    }
                    else
                    {
                        image =
                            FindChild <Image>(container, "EncryptionOn");

                        if (image != null)
                        {
                            image.Visibility = Visibility.Collapsed;
                        }
                        image =
                            FindChild <Image>(container, "EncryptionOff");
                        if (image != null)
                        {
                            image.Visibility = Visibility.Collapsed;
                        }
                    }

                    image =
                        FindChild <Image>(container, currentIndicator);
                    if (image != null)
                    {
                        image.Visibility = Visibility.Visible;
                    }
                }
            }
            encryptionIndicatoWindow.Refresh();
            encryptionIndicatoWindow.UpdateWindow();
        }