private void MoveToPosition(double x) { double num1 = Math.Min(x, 0.0); double translateX = num1 <= -160.0 ? num1 - (num1 + 160.0) / 2.0 : num1; double slideToCancelOpacity = AudioRecorderUC.GetSlideToCancelOpacity(translateX); List <AnimationInfo> animInfoList = new List <AnimationInfo>(); AnimationInfo animationInfo1 = new AnimationInfo(); animationInfo1.target = (DependencyObject)this.transformButton; animationInfo1.propertyPath = CompositeTransform.TranslateXProperty; animationInfo1.from = this.transformButton.TranslateX; animationInfo1.to = translateX; animationInfo1.duration = 200; CubicEase cubicEase1 = new CubicEase(); int num2 = 0; ((EasingFunctionBase)cubicEase1).EasingMode = ((EasingMode)num2); animationInfo1.easing = (IEasingFunction)cubicEase1; animInfoList.Add(animationInfo1); AnimationInfo animationInfo2 = new AnimationInfo(); animationInfo2.target = (DependencyObject)this.translateRecordDuration; animationInfo2.propertyPath = TranslateTransform.XProperty; animationInfo2.from = this.translateRecordDuration.X; animationInfo2.to = translateX; animationInfo2.duration = 200; CubicEase cubicEase2 = new CubicEase(); int num3 = 0; ((EasingFunctionBase)cubicEase2).EasingMode = ((EasingMode)num3); animationInfo2.easing = (IEasingFunction)cubicEase2; animInfoList.Add(animationInfo2); AnimationInfo animationInfo3 = new AnimationInfo(); animationInfo3.target = (DependencyObject)this.panelSlideToCancel; animationInfo3.propertyPath = UIElement.OpacityProperty; animationInfo3.from = ((UIElement)this.panelSlideToCancel).Opacity; animationInfo3.to = slideToCancelOpacity; animationInfo3.duration = 200; CubicEase cubicEase3 = new CubicEase(); int num4 = 0; ((EasingFunctionBase)cubicEase3).EasingMode = ((EasingMode)num4); animationInfo3.easing = (IEasingFunction)cubicEase3; animInfoList.Add(animationInfo3); int?startTime = new int?(); // ISSUE: variable of the null type AnimationUtil.AnimateSeveral(animInfoList, startTime, null); }
public void HandleManipulationDelta(ManipulationDeltaEventArgs e) { if (this._isInSendState) { return; } Point translation1 = e.CumulativeManipulation.Translation; Point translation2 = e.DeltaManipulation.Translation; // ISSUE: explicit reference operation double x = ((Point)@translation2).X; // ISSUE: explicit reference operation if (Math.Abs(((Point)@translation1).Y) < 80.0) { if (this._isInInitial) { this._isInInitial = false; // ISSUE: explicit reference operation this.MoveToPosition(((Point)@translation1).X); } else { CompositeTransform transformButton1 = this.transformButton; double num1 = transformButton1.TranslateX + x; transformButton1.TranslateX = num1; if (this.transformButton.TranslateX > 0.0) { this.transformButton.TranslateX = 0.0; } else if (this.transformButton.TranslateX > -160.0) { this.ShowHideCancelOverlay(false); } else { this.ShowHideCancelOverlay(true); CompositeTransform transformButton2 = this.transformButton; double num2 = transformButton2.TranslateX - x / 2.0; transformButton2.TranslateX = num2; } this.translateRecordDuration.X = this.transformButton.TranslateX; ((UIElement)this.panelSlideToCancel).Opacity = (AudioRecorderUC.GetSlideToCancelOpacity(this.transformButton.TranslateX)); } } else { this.MoveToInitial(); } }
public void InitializeComponent() { if (this._contentLoaded) { return; } this._contentLoaded = true; Application.LoadComponent(this, new Uri("/VKClient.Common;component/UC/NewMessageUC.xaml", UriKind.Relative)); this.mentionPicker = (MentionPickerUC)base.FindName("mentionPicker"); this.panelReply = (StackPanel)base.FindName("panelReply"); this.checkBoxAsCommunity = (CheckBox)base.FindName("checkBoxAsCommunity"); this.textBlockReply = (TextBlock)base.FindName("textBlockReply"); this.ucReplyUser = (ReplyUserUC)base.FindName("ucReplyUser"); this.scrollNewMessage = (ScrollViewer)base.FindName("scrollNewMessage"); this.ucNewPost = (NewPostUC)base.FindName("ucNewPost"); this.borderEmoji = (Border)base.FindName("borderEmoji"); this.ellipseHasStickersUpdates = (Ellipse)base.FindName("ellipseHasStickersUpdates"); this.borderHoldToRecord = (Border)base.FindName("borderHoldToRecord"); this.borderSend = (Border)base.FindName("borderSend"); this.borderVoice = (Border)base.FindName("borderVoice"); this.ucAudioRecorder = (AudioRecorderUC)base.FindName("ucAudioRecorder"); this.ucStickersAutoSuggest = (StickersAutoSuggestUC)base.FindName("ucStickersAutoSuggest"); this.panelControl = (TextBoxPanelControl)base.FindName("panelControl"); }
private void Touch_OnFrameReported(object sender, TouchFrameEventArgs e) { TouchPointCollection touchPoints = e.GetTouchPoints((UIElement)this.gridRecordOverlay); if (((PresentationFrameworkCollection <TouchPoint>)touchPoints).Count == 0) { return; } TouchPoint touchPoint = ((PresentationFrameworkCollection <TouchPoint>)touchPoints)[0]; Point position = touchPoint.Position; Point point1; if (!this._previousPoint.HasValue) { point1 = new Point(0.0, 0.0); } else { // ISSUE: explicit reference operation double x1 = ((Point)@position).X; Point point2 = this._previousPoint.Value; // ISSUE: explicit reference operation double x2 = ((Point)@point2).X; double num1 = x1 - x2; // ISSUE: explicit reference operation double y1 = ((Point)@position).Y; Point point3 = this._previousPoint.Value; // ISSUE: explicit reference operation double y2 = ((Point)@point3).Y; double num2 = y1 - y2; point1 = new Point(num1, num2); } Point point4 = point1; this._previousPoint = new Point?(position); // ISSUE: explicit reference operation double x = ((Point)@point4).X; TouchAction action = touchPoint.Action; if (action != TouchAction.Move) { if (action != TouchAction.Up || this._isInSendState) { return; } // ISSUE: explicit reference operation if (((Point)@position).Y < -80.0 && !this._isInSendState) { this.GoToSendState(); } else if (this.transformButton.TranslateX > -160.0) { if (this._viewModel.RecordDuration > 500) { this.StopRecordingAndSend(); } else { this.IsOpened = false; } } else { if (this.transformButton.TranslateX > -16.0) { this.transformButton.CenterX = 44.0; } this.IsOpened = false; } } else { if (this._isInSendState) { return; } // ISSUE: explicit reference operation if (((Point)@position).Y > -80.0) { if (this._isInInitial) { this._isInInitial = false; // ISSUE: explicit reference operation this.MoveToPosition(((Point)@position).X); } else { CompositeTransform transformButton1 = this.transformButton; double num1 = transformButton1.TranslateX + x; transformButton1.TranslateX = num1; if (this.transformButton.TranslateX > 0.0) { this.transformButton.TranslateX = 0.0; } else if (this.transformButton.TranslateX > -160.0) { this.ShowHideCancelOverlay(false); } else { this.ShowHideCancelOverlay(true); CompositeTransform transformButton2 = this.transformButton; double num2 = transformButton2.TranslateX - x / 2.0; transformButton2.TranslateX = num2; } this.translateRecordDuration.X = this.transformButton.TranslateX; ((UIElement)this.panelSlideToCancel).Opacity = (AudioRecorderUC.GetSlideToCancelOpacity(this.transformButton.TranslateX)); } } else { this.MoveToInitial(); } } }