コード例 #1
0
 public override void UpdateStateValue(BoxData newState)
 {
     state = newState;
     if (state._state == LightBox.ConcealState)
     {
         this.image.Source  = GetLightBoxImage(state);
         this.image.Stretch = Stretch.UniformToFill;
     }
     else
     {
         this.projection           = (PlaneProjection)this.image.Projection;
         this.projection.RotationX = 0;
         this.timer.Interval       = TimeSpan.FromMilliseconds(50);
         this.timer.Start();
     }
 }
コード例 #2
0
ファイル: LightBoxView.cs プロジェクト: sunnnjin/Blackbox
 public override void UpdateStateValue(BoxData newState)
 {
     state = newState;
     if (state._state == LightBox.ConcealState)
     {
         this.image.Source = GetLightBoxImage(state);
         this.image.Stretch = Stretch.UniformToFill;
     }
     else
     {
         this.projection = (PlaneProjection)this.image.Projection;
         this.projection.RotationX = 0;
         this.timer.Interval = TimeSpan.FromMilliseconds(50);
         this.timer.Start();
     }
 }
コード例 #3
0
        private BitmapImage GetLightBoxImage(BoxData newState)
        {
            BitmapImage bitmapImage = null;

            switch (newState._state)
            {
            case LightBox.ConcealState:
                bitmapImage =
                    BlackboxImageUtils.Image(BlackboxImageType.LightBoxConceal);
                break;

            case LightBox.DeflectionState:
                bitmapImage = DeflectionImageSource(newState._position);
                break;

            case LightBox.ComplexDeflectionState:
                bitmapImage = ComplexDeflectionImageSource(newState._position);
                break;

            case LightBox.DeflectionOutState:
                bitmapImage = DeflectionOutImageSource(newState._position);
                break;

            case LightBox.ComplexDeflectionOutState:
                bitmapImage = ComplexDeflectionOutImageSource(newState._position);
                break;

            case LightBox.ReflectionState:
                bitmapImage = BlackboxImageUtils.Image(BlackboxImageType.LightBoxReflection);
                break;

            case LightBox.ComplexReflectionState:
                bitmapImage = ComplexReflectionImageSource(newState._position);
                break;

            default:
                break;
            }

            return(bitmapImage);
        }
コード例 #4
0
 public abstract void UpdateStateValue(BoxData newState);
コード例 #5
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            string imgSrc = string.Empty;

            BoxData  boxData  = (BoxData)value;
            Position position = boxData._position;

            switch (boxData._state)
            {
            case NookBox.NookState:
                imgSrc = "/icons/NookBox.NookState.png";
                break;

            case BlackBox.GuessNoneState:
                imgSrc = "/icons/BlackBox.GuessNone.png";
                break;

            case BlackBox.GuessingState:
                imgSrc = "/icons/BlackBox.Guessing.png";
                break;

            case BlackBox.GuessFailedState:
                imgSrc = "/icons/BlackBox.GuessFailed.png";
                break;

            case BlackBox.GuessedState:
                imgSrc = "/icons/BlackBox.Guessed.png";
                break;

            case LightBox.ConcealState:
                imgSrc = "/icons/LightBox.Conceal.png";
                break;

            case LightBox.DeflectionState:
                imgSrc = DeflectionImageSource(position);
                break;

            case LightBox.ComplexDeflectionState:
                imgSrc = ComplexDeflectionImageSource(position);
                break;

            case LightBox.DeflectionOutState:
                imgSrc = DeflectionOutImageSource(position);
                break;

            case LightBox.ComplexDeflectionOutState:
                imgSrc = ComplexDeflectionOutImageSource(position);
                break;

            case LightBox.ReflectionState:
                imgSrc = "/icons/LightBox.Reflection.png";
                break;

            case LightBox.ComplexReflectionState:
                imgSrc = ComplexReflectionImageSource(position);
                break;

            default:
                break;
            }

            return(imgSrc);
        }
コード例 #6
0
ファイル: LightBoxView.cs プロジェクト: sunnnjin/Blackbox
        private BitmapImage GetLightBoxImage(BoxData newState)
        {
            BitmapImage bitmapImage = null;

            switch (newState._state)
            {
                case LightBox.ConcealState:
                    bitmapImage =
                        BlackboxImageUtils.Image(BlackboxImageType.LightBoxConceal);
                    break;
                case LightBox.DeflectionState:
                    bitmapImage = DeflectionImageSource(newState._position);
                    break;
                case LightBox.ComplexDeflectionState:
                    bitmapImage = ComplexDeflectionImageSource(newState._position);
                    break;
                case LightBox.DeflectionOutState:
                    bitmapImage = DeflectionOutImageSource(newState._position);
                    break;
                case LightBox.ComplexDeflectionOutState:
                    bitmapImage = ComplexDeflectionOutImageSource(newState._position);
                    break;
                case LightBox.ReflectionState:
                    bitmapImage = BlackboxImageUtils.Image(BlackboxImageType.LightBoxReflection);
                    break;
                case LightBox.ComplexReflectionState:
                    bitmapImage = ComplexReflectionImageSource(newState._position);
                    break;
                default:
                    break;
            }

            return bitmapImage;
        }
コード例 #7
0
ファイル: BoxView.xaml.cs プロジェクト: sunnnjin/Blackbox
 public abstract void UpdateStateValue(BoxData newState);