Inheritance: MonoBehaviour
Exemple #1
0
 private void BtnViewCode_Click(object sender, RoutedEventArgs e)
 {
     if (_isCodeViewing)
     {
         if (Helper.Tier == 2)
         {
             AnimationHelper.SetEasingFunction(GroupPalette, new CubicEase()
             {
                 EasingMode = EasingMode.EaseOut
             });
             AnimationHelper.SetMarginTo(GroupPalette, new Thickness(0, 0, 0, 0));
             AnimationHelper.SetEasingFunction(GroupCode, new CubicEase()
             {
                 EasingMode = EasingMode.EaseOut
             });
             AnimationHelper.SetMarginTo(GroupCode, new Thickness(0, 0, 0, 0));
         }
         else
         {
             GroupPalette.Margin = new Thickness(0, 0, 0, 0);
             GroupCode.Margin    = new Thickness(0, 0, 0, 0);
         }
         BtnViewCode.Content = Properties.Resource.ViewCode;
     }
     else
     {
         if (Helper.Tier == 2)
         {
             AnimationHelper.SetEasingFunction(GroupPalette, new CubicEase()
             {
                 EasingMode = EasingMode.EaseOut
             });
             AnimationHelper.SetMarginTo(GroupPalette, new Thickness(0, -120, 0, 0));
             AnimationHelper.SetEasingFunction(GroupCode, new CubicEase()
             {
                 EasingMode = EasingMode.EaseOut
             });
             AnimationHelper.SetMarginTo(GroupCode, new Thickness(0, 0, 0, -120));
         }
         else
         {
             GroupPalette.Margin = new Thickness(0, -120, 0, 0);
             GroupCode.Margin    = new Thickness(0, 0, 0, -120);
         }
         BtnViewCode.Content = Properties.Resource.CloseCodeViewer;
     }
     _isCodeViewing = !_isCodeViewing;
 }
        private void InkPresenter_StrokeStarted(InkStrokeInput sender, PointerEventArgs args)
        {
            // hide the pen icon
            if (!_touchHereWasHidden)
            {
                if (null != _penTouchPointGrid)
                {
                    AnimationHelper.PerformFadeOut(_penTouchPointGrid, 100d, 0d);
                }

                _touchHereWasHidden = true;
            }

            // telemetry
            //TelemetryService.Current?.SendTelemetry(TelemetryService.TELEMETRY_STARTPEN, System.DateTime.UtcNow.ToString("yyyy-MM-dd hh:mm:ss tt", CultureInfo.InvariantCulture), true, 0);
        }
Exemple #3
0
        public void NavigateFromPage()
        {
            // animations out
            AnimationHelper.PerformPageExitAnimation(this);

            ClosePopupsOnExit();

            rBtnRightPixelSense.ResetEntranceAnimation();
            rBtnRightPixelSense.ResetRadiateAnimation();

            rBtnLeftPixelSense.ResetEntranceAnimation();
            rBtnLeftPixelSense.ResetRadiateAnimation();

            rBtnBottomPixelSense.ResetEntranceAnimation();
            rBtnBottomPixelSense.ResetRadiateAnimation();
        }
Exemple #4
0
        private static void LoadPlugins()
        {
            var sw = new Stopwatch();

            sw.Start();
            var plugins = App.Resolve <IPluginManager>();

            // process cmdline params
            CmdLineProcessor.Processing();
            plugins.LoadPlugins();
            // init internal plugin
            (new PluginInternal()).Initialize(App.Resolve <IServiceProvider>());
            // register stage images for icon animation
            AnimationHelper.Register(AnimationHelper.WORKING, Resources.process_working, 16, 16);
            LoadPluginsMS = sw.ElapsedMilliseconds;
        }
        public CopyButton()
        {
            InitializeComponent();

            Loaded += delegate
            {
                TheButton.PreviewMouseLeftButtonDown += (s, x) => PreviewMouseButtonDownAnim(CopyButtonBrush);
                TheButton.MouseEnter += (s, x) => ButtonMouseOverAnim(CopyButtonBrush, true);
                TheButton.MouseLeave += (s, x) => ButtonMouseLeaveAnimBgColor(CopyButtonBrush, false);

                if (!Properties.Settings.Default.DarkTheme)
                {
                    AnimationHelper.LightThemeMouseEvent(this, IconBrush);
                }
            };
        }
Exemple #6
0
        public void NavigateFromPage()
        {
            // animations out
            AnimationHelper.PerformPageExitAnimation(this);

            rBtnBottom.ResetEntranceAnimation();
            rBtnBottom.ResetRadiateAnimation();

            rBtnTop.ResetEntranceAnimation();
            rBtnTop.ResetRadiateAnimation();

            rBtnCenter.ResetEntranceAnimation();
            rBtnCenter.ResetRadiateAnimation();

            ClosePopupsOnExit();
        }
Exemple #7
0
        /// <inheritdoc/>
        public override TimeSpan GetTotalDuration()
        {
            TimeSpan duration = TimeSpan.Zero;

            if (X != null)
            {
                duration = AnimationHelper.Max(duration, X.GetTotalDuration());
            }

            if (Y != null)
            {
                duration = AnimationHelper.Max(duration, Y.GetTotalDuration());
            }

            return(duration);
        }
Exemple #8
0
        public void NavigateFromPage()
        {
            // animations out
            AnimationHelper.PerformPageExitAnimation(this);

            ClosePopupsOnExit();

            this.rBtnTop.ResetEntranceAnimation();
            this.rBtnTop.ResetRadiateAnimation();

            this.rBtnLeft.ResetEntranceAnimation();
            this.rBtnLeft.ResetRadiateAnimation();

            this.rBtnRight.ResetEntranceAnimation();
            this.rBtnRight.ResetRadiateAnimation();
        }
    void Awake()
    {
        waypointManager = GetComponent <WaypointManager> ();
        owningPlayer    = GetComponent <PlayerConfig> ();

        enemyModel      = GetComponent <EnemyModel> ();
        enemyController = GetComponent <EnemyController> ();
        enemyView       = GetComponent <EnemyView> ();

        movementModel      = GetComponent <MovementModel> ();
        movementController = GetComponent <MovementController> ();
        movementView       = GetComponent <MovementView> ();

        sfx  = GetComponent <AudioHelper> ();
        anim = GetComponent <AnimationHelper> ();
    }
Exemple #10
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            Storyboard storyboard = new Storyboard();

            storyboard.Children.Add(AnimationHelper.CreateElasticAnimation(this.leftButton, new PropertyPath("(Button.RenderTransform).(TranslateTransform.X)"), -45));
            storyboard.Children.Add(AnimationHelper.CreateElasticAnimation(this.leftButton, new PropertyPath("(Button.RenderTransform).(TranslateTransform.Y)"), -30));


            storyboard.Children.Add(AnimationHelper.CreateElasticAnimation(this.middleButton, new PropertyPath("(Button.RenderTransform).(TranslateTransform.Y)"), -50));


            storyboard.Children.Add(AnimationHelper.CreateElasticAnimation(this.rightButton, new PropertyPath("(Button.RenderTransform).(TranslateTransform.X)"), 45));
            storyboard.Children.Add(AnimationHelper.CreateElasticAnimation(this.rightButton, new PropertyPath("(Button.RenderTransform).(TranslateTransform.Y)"), -30));

            storyboard.Begin();
        }
        protected override double[] InterpolateValueCore(double[] baseValue, double keyFrameProgress)
        {
            if (MathHelper.IsVerySmall(keyFrameProgress))
            {
                return(baseValue);
            }

            if (MathHelper.AreClose(keyFrameProgress, 1))
            {
                return(Numbers);
            }

            var splineProgress = KeySpline.GetSplineProgress(keyFrameProgress);

            return(AnimationHelper.InterpolateGeometryValue(baseValue, Numbers, splineProgress));
        }
Exemple #12
0
 private void HideAllSliders()
 {
     foreach (var s in Sliders.Children)
     {
         if (s.Visibility.IsVisible())
         {
             AnimationHelper.CreateFadeAnimation(new FadeAnimationRequest()
             {
                 RequestFadeType = FadeType.FadeOut,
                 Target          = s as FrameworkElement,
                 Duration        = TimeSpan.FromMilliseconds(150),
                 Completed       = (sender, arg) => { s.Visibility = Visibility.Collapsed; }
             }).Begin();
         }
     }
 }
Exemple #13
0
    private void Awake()
    {
        if (Instance == null)
        {
            Instance = this;
        }
        else
        {
            Destroy(gameObject);
        }

        _rumbler        = GetComponent <Rumbler>();
        AnimationHelper = GetComponent <AnimationHelper>();

        _skeletonAnimation = GetComponentInChildren <SkeletonAnimation>();
    }
Exemple #14
0
 private void StartToShowControlPanel(double duration = 150)
 {
     ControlPanelScroll.Visibility = Visibility.Visible;
     AnimationHelper.CreateSlideAnimation(new SlideAnimationRequest()
     {
         Target          = ControlPanelUnit,
         Duration        = TimeSpan.FromMilliseconds(duration),
         RequestFadeSide = FadeSide.Right,
         RequestFadeType = FadeType.FadeIn,
         Distance        = ControlPanelScroll.ActualWidth,
         Completed       = (sender, arg) =>
         {
             ControlPanelDisplayed = true;
         }
     }).Begin();
 }
        protected void ApplyProperty(object value)
        {
            if (Property == null)
            {
                throw new InvalidOperationException("Property parameter is null! Check the prototype!");
            }

            if (Light is IAnimationProperties properties)
            {
                properties.SetAnimatableProperty(Property, value);
            }
            else
            {
                AnimationHelper.SetAnimatableProperty(Light, Property, value);
            }
        }
 public void RotateSmoothly(FrameworkElement target, double angle)
 {
     if (IsRotating)
     {
         return;
     }
     IsRotating = true;
     AnimationHelper.CreateSmoothRotateAnimation(new AnimationRequest()
     {
         Target    = target,
         Completed = (obj, sender) =>
         {
             IsRotating = false;
         }
     }, angle).Begin();
 }
        private void BtnExecute_Click(object sender, RoutedEventArgs e)
        {
            if (!IsLoaded)
            {
                return;
            }

            var button = new Button()
            {
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment   = VerticalAlignment.Center,
                Height  = 35,
                Width   = 150,
                Content = "Button"
            };

            GrdContainer.Children.Clear();
            GrdContainer.Children.Add(button);

            AnimationHelper.SetBeginTimeSeconds(button, SldBeginTime.Value);
            AnimationHelper.SetDurationSeconds(button, SldDuration.Value);

            if (ChbFadeIn.IsChecked == true)
            {
                AnimationHelper.SetFadeIn(button, true);
            }
            if (ChbFadeOut.IsChecked == true)
            {
                AnimationHelper.SetFadeOut(button, true);
            }
            if (ChbSlideFromLeft.IsChecked == true)
            {
                AnimationHelper.SetSlideInFromLeft(button, true);
            }
            if (ChbSlideFromTop.IsChecked == true)
            {
                AnimationHelper.SetSlideInFromTop(button, true);
            }
            if (ChbSlideFromRight.IsChecked == true)
            {
                AnimationHelper.SetSlideInFromRight(button, true);
            }
            if (ChbSlideFromBottom.IsChecked == true)
            {
                AnimationHelper.SetSlideInFromBottom(button, true);
            }
        }
        /// <inheritdoc/>
        public TimeSpan?GetAnimationTime(TimeSpan time)
        {
            // Get the effective start, end and duration of the clip.
            TimeSpan clipStart, clipEnd, clipLength;

            GetClip(out clipStart, out clipEnd, out clipLength);

            // ----- Delay
            time -= Delay;
            if (time < TimeSpan.Zero)
            {
                // The animation has not started.
                return(null);
            }

            // ----- Speed
            time = new TimeSpan((long)(time.Ticks * (double)Speed));

            // ----- Duration
            TimeSpan duration = Duration ?? clipLength;

            // ----- FillBehavior
            if (time > duration)
            {
                if (FillBehavior == FillBehavior.Stop)
                {
                    // The animation has stopped.
                    return(null);
                }

                // The animation holds the last value.
                Debug.Assert(FillBehavior == FillBehavior.Hold);
                time = duration;
            }

            // ----- Adjust animation time to play/loop clip from original timeline.
            time = clipStart + ClipOffset + time;
            AnimationHelper.LoopParameter(time, clipStart, clipEnd, LoopBehavior, out time);

            // ----- Reverse
            if (IsClipReversed)
            {
                time = clipEnd - (time - clipStart);
            }

            return(time);
        }
        public FlipButton()
        {
            InitializeComponent();

            Loaded += delegate
            {
                TheButton.PreviewMouseLeftButtonDown += delegate
                {
                    PreviewMouseButtonDownAnim(FlipButtonBrush);
                };

                TheButton.MouseEnter += delegate
                {
                    ButtonMouseOverAnim(FlipButtonBrush, true);

                    ToolTip = TheButton.IsChecked.Value ?
                              Application.Current.Resources["Unflip"] :
                              Application.Current.Resources["Flip"];
                };

                TheButton.MouseLeave += delegate
                {
                    ButtonMouseLeaveAnimBgColor(FlipButtonBrush, false);
                };

                TheButton.Click += delegate
                {
                    UILogic.TransformImage.Rotation.Flip();
                };

                // Change FlipButton's icon when (un)checked
                TheButton.Checked += delegate
                {
                    FlipPath.Data = Geometry.Parse("M448,192l-128,96v-64H128v128h248c4.4,0,8,3.6,8,8v48c0,4.4-3.6,8-8,8H72c-4.4,0-8-3.6-8-8V168c0-4.4,3.6-8,8-8h248V96 L448, 192z");
                };

                TheButton.Unchecked += delegate
                {
                    FlipPath.Data = Geometry.Parse("M192,96v64h248c4.4,0,8,3.6,8,8v240c0,4.4-3.6,8-8,8H136c-4.4,0-8-3.6-8-8v-48c0-4.4,3.6-8,8-8h248V224H192v64L64,192 L192, 96z");
                };

                if (!Properties.Settings.Default.DarkTheme)
                {
                    AnimationHelper.LightThemeMouseEvent(this, IconBrush);
                }
            };
        }
Exemple #20
0
        public void RotateLiveviewImage(double angle, EventHandler <object> Completed = null)
        {
            var scale = CalcRotatedLiveviewImageScale(angle);

            if (scale == double.NaN)
            {
                return;
            }                                    // LiveviewGrid is already disappeared.

            angle = ToRelativeLiveviewAngle(angle);

            AnimationHelper.CreateSmoothRotateScaleAnimation(new AnimationRequest()
            {
                Target    = LiveviewGrid,
                Completed = Completed,
            }, angle, scale).Begin();
        }
        protected override void OnClosing(CancelEventArgs e)
        {
            base.OnClosing(e);

            if (_shouldBeClosed)
            {
                return;
            }
            var desktopWorkingArea = SystemParameters.WorkArea;

            switch (ShowAnimation)
            {
            case ShowAnimation.None:
                break;

            case ShowAnimation.HorizontalMove:
            {
                var animation = AnimationHelper.CreateAnimation(desktopWorkingArea.Width);
                animation.Completed += Animation_Completed;
                BeginAnimation(LeftProperty, animation);
                e.Cancel        = true;
                _shouldBeClosed = true;
            }
            break;

            case ShowAnimation.verticalMove:
            {
                var animation = AnimationHelper.CreateAnimation(desktopWorkingArea.Height);
                animation.Completed += Animation_Completed;
                BeginAnimation(TopProperty, animation);
                e.Cancel        = true;
                _shouldBeClosed = true;
            }
            break;

            case ShowAnimation.Fade:
            {
                var animation = AnimationHelper.CreateAnimation(0);
                animation.Completed += Animation_Completed;
                BeginAnimation(OpacityProperty, animation);
                e.Cancel        = true;
                _shouldBeClosed = true;
            }
            break;
            }
        }
Exemple #22
0
        protected override void ExecuteUserCmd(PlayerEntity playerEntity, IUserCmd cmd)
        {
            var animator   = playerEntity.thirdPersonAnimator.UnityAnimator;
            var seq        = cmd.Seq;
            int layerIndex = DefaultLayerIndex;

            try
            {
                Logger.InfoFormat(AnimationHelper.PrintAnimator(animator, layerIndex, seq));
                Logger.InfoFormat(AnimationHelper.PrintAnimatorParam(animator));
                Logger.InfoFormat(AnimationHelper.PrintNetworkAnimator(playerEntity.networkAnimator, layerIndex, seq));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        private static float ObstacleTimeAdjust(float original, ObstacleData obstacleData, float move1Duration, float finishMovementTime)
        {
            if (original > move1Duration)
            {
                NoodleObstacleData?noodleData = TryGetObjectData <NoodleObstacleData>(obstacleData);
                if (noodleData != null)
                {
                    float?time = noodleData.Track?.Select(n => AnimationHelper.TryGetProperty <float?>(n, TIME)).FirstOrDefault(n => n.HasValue);
                    if (time.HasValue)
                    {
                        return((time.Value * (finishMovementTime - move1Duration)) + move1Duration);
                    }
                }
            }

            return(original);
        }
Exemple #24
0
        private static Vector3 DefiniteNoteJump(Vector3 original, float time)
        {
            NoodleObjectData noodleData = NoteControllerUpdate.NoodleData;
            if (noodleData != null)
            {
                AnimationHelper.GetDefinitePositionOffset(noodleData.AnimationObject, noodleData.Track, time, out Vector3? position);
                if (position.HasValue)
                {
                    Vector3 noteOffset = noodleData.NoteOffset;
                    _definitePosition = true;
                    return position.Value + noteOffset;
                }
            }

            _definitePosition = false;
            return original;
        }
Exemple #25
0
        private static Vector3 DefiniteNoteFloorMovement(Vector3 original, NoteFloorMovement noteFloorMovement)
        {
            NoodleObjectData noodleData = NoteControllerUpdate.NoodleData;

            if (noodleData != null)
            {
                AnimationHelper.GetDefinitePositionOffset(noodleData.AnimationObject, noodleData.Track, 0, out Vector3? position);
                if (position.HasValue)
                {
                    Vector3 noteOffset = noodleData.NoteOffset;
                    Vector3 endPos     = NoteControllerUpdate._floorEndPosAccessor(ref noteFloorMovement);
                    return(original + (position.Value + noteOffset - endPos));
                }
            }

            return(original);
        }
Exemple #26
0
        /// <summary>
        /// Animates in the control
        /// </summary>
        public void AnimateIn()
        {
            //Debug.WriteLine("Animating in");
            AnimationHelper.FadeObjectVisibility(this, 0, 1, Visibility.Visible);

            stackPanelColorAnimationInner.RenderTransform.SetValue(CompositeTransform.TranslateYProperty, 0);
            scrollViewerExportItems.RenderTransform.SetValue(CompositeTransform.TranslateXProperty, 0);
            scrollViewerExportItems2.RenderTransform.SetValue(CompositeTransform.TranslateXProperty, 0);

            stackPanelColorAnimation.Opacity = 0;
            scrollViewerExportItems2.Opacity = 0;

            AnimationHelper.ChangeObjectTranslateY(gridTitleBar, 40, 0);
            AnimationHelper.ChangeObjectTranslateY(scrollViewerExportItems, 120, 0, 300);
            AnimationHelper.ChangeObjectTranslateY(scrollViewerExportItems2, 120, 0, 300);
            AnimationHelper.ChangeObjectOpacity(scrollViewerExportItems2, 0, 1, 250, 200);
        }
Exemple #27
0
        public static void DrawAura(this MyPlayer modPlayer, AuraAnimationInfo aura)
        {
            Player    player           = modPlayer.player;
            Texture2D texture          = aura.GetTexture();
            Rectangle textureRectangle = new Rectangle(0, aura.GetHeight() * modPlayer.auraCurrentFrame, texture.Width, aura.GetHeight());
            float     scale            = aura.GetAuraScale(modPlayer);
            Tuple <float, Vector2> rotationAndPosition = aura.GetAuraRotationAndPosition(modPlayer);
            float   rotation = rotationAndPosition.Item1;
            Vector2 position = rotationAndPosition.Item2;

            AnimationHelper.SetSpriteBatchForPlayerLayerCustomDraw(aura.blendState, player.GetPlayerSamplerState());

            // custom draw routine
            Main.spriteBatch.Draw(texture, position - Main.screenPosition, textureRectangle, Color.White, rotation, new Vector2(aura.GetWidth(), aura.GetHeight()) * 0.5f, scale, SpriteEffects.None, 0f);

            AnimationHelper.ResetSpriteBatchForPlayerDrawLayers(player.GetPlayerSamplerState());
        }
Exemple #28
0
        private async void Import(IReadOnlyList <IStorageItem> files)
        {
            Debug.WriteLine("Using the new import method!");

            //Checks if files is empty, if not continue

            if (files.Count > 0)
            {
                foreach (IStorageItem i in files)
                {
                    if (i.IsOfType(StorageItemTypes.File))
                    {
                        ImportPhotos((StorageFile)i);
                    }
                    if (i.IsOfType(StorageItemTypes.Folder))
                    {
                        StorageFolder s = (StorageFolder)i;

                        foreach (IStorageItem i2 in await s.GetFilesAsync())
                        {
                            if (i2.IsOfType(StorageItemTypes.File))
                            {
                                ImportPhotos((StorageFile)i2);
                            }
                        }
                    }
                }

                if (mainPageViewModel.ImageList.Count != 0)
                {
                    //Performs first time animation if need be

                    if (stackpanelImport.IsHitTestVisible == true)
                    {
                        stackpanelImport.IsHitTestVisible = false;

                        gridOOBE.Visibility = Visibility.Collapsed;
                        relativePanelContainer.Visibility = Visibility.Visible;
                        AnimationHelper.ChangeObjectOpacity(gridSidebarBG, 0, 1, 200);

                        AnimateInContent.Begin();
                    }
                }
            }
        }
        private void buttonShowRadial_Click(object sender, RoutedEventArgs e)
        {
            if (gridRadial.Opacity == 1)
            {
                AnimationHelper.ChangeObjectOpacity(gridRadial, 1, 0);
                gridRadial.IsHitTestVisible = false;
                AnimationHelper.ChangeObjectOpacity(gradientTrackBar, 0, 1);
                gradientTrackBar.IsHitTestVisible = true;
            }

            if (gridRadial.Opacity == 0)
            {
                AnimationHelper.ChangeObjectOpacity(gridRadial, 0, 1);
                gridRadial.IsHitTestVisible = true;
                AnimationHelper.ChangeObjectOpacity(gradientTrackBar, 1, 0);
                gradientTrackBar.IsHitTestVisible = false;
            }
        }
        public MenuCloseButton()
        {
            InitializeComponent();

            Loaded += delegate
            {
                PreviewMouseLeftButtonDown += (s, x) => PreviewMouseButtonDownAnim(CloseButtonBrush);
                MouseEnter += (s, x) => ButtonMouseOverAnim(CloseButtonBrush, true);
                MouseLeave += (s, x) => ButtonMouseLeaveAnimBgColor(CloseButtonBrush, false);

                if (!Properties.Settings.Default.DarkTheme)
                {
                    AnimationHelper.LightThemeMouseEvent(this, IconBrush);
                }

                TheButton.Click += delegate { UC.Close_UserControls(); };
            };
        }
        /// <summary>
        /// Initializes a new instance of the Expando class with default settings
        /// </summary>
        public Expando()
            : base()
        {
            // This call is required by the Windows.Forms Form Designer.
            this.components = new System.ComponentModel.Container();

            // set control styles
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            this.SetStyle(ControlStyles.Selectable, true);
            this.TabStop = true;

            // get the system theme settings
            this.systemSettings = ThemeManager.GetSystemExplorerBarSettings();

            this.customSettings = new ExpandoInfo();
            this.customSettings.Expando = this;
            this.customSettings.SetDefaultEmptyValues();

            this.customHeaderSettings = new HeaderInfo();
            this.customHeaderSettings.Expando = this;
            this.customHeaderSettings.SetDefaultEmptyValues();

            this.BackColor = this.systemSettings.Expando.NormalBackColor;

            // the height of the Expando in the expanded state
            this.expandedHeight = 100;

            // animation
            this.animate = false;
            this.animatingFade = false;
            this.animatingSlide = false;
            this.animationImage = null;
            this.slideEndHeight = -1;
            this.animationHelper = null;
            this.fadeHeights = new int[AnimationHelper.NumAnimationFrames];

            // size
            this.Size = new Size(this.systemSettings.Header.BackImageWidth, this.expandedHeight);
            this.titleBarHeight = this.systemSettings.Header.BackImageHeight;
            this.headerHeight = this.titleBarHeight;
            this.oldWidth = this.Width;

            // start expanded
            this.collapsed = false;

            // not a special group
            this.specialGroup = false;

            // unfocused titlebar
            this.focusState = FocusStates.None;

            // no title image
            this.titleImage = null;
            this.watermark = null;

            this.Font = new Font(this.TitleFont.Name, 8.25f, FontStyle.Regular);

            // don't get the Expando to layout its items itself
            this.autoLayout = false;

            // don't know which TaskPane we belong to
            this.taskpane = null;

            // internal list of items
            this.itemList = new ItemCollection(this);
            this.hiddenControls = new ArrayList();

            // initialise the dummyPanel
            this.dummyPanel = new AnimationPanel();
            this.dummyPanel.Size = this.Size;
            this.dummyPanel.Location = new Point(-1000, 0);

            this.canCollapse = true;

            this.showFocusCues = false;
            this.useDefaultTabHandling = true;

            this.CalcAnimationHeights();

            this.slideAnimationBatched = false;

            this.dragging = false;
            this.dragStart = Point.Empty;

            this.beginUpdateCount = 0;

            this.initialising = false;
            this.layout = false;
        }
        /// <summary> 
        /// Releases the unmanaged resources used by the Expando and 
        /// optionally releases the managed resources
        /// </summary>
        /// <param name="disposing">True to release both managed and unmanaged 
        /// resources; false to release only unmanaged resources</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (components != null)
                {
                    components.Dispose();
                }

                if (this.systemSettings != null)
                {
                    this.systemSettings.Dispose();
                    this.systemSettings = null;
                }

                if (this.animationHelper != null)
                {
                    this.animationHelper.Dispose();
                    this.animationHelper = null;
                }
            }

            base.Dispose(disposing);
        }
        /// <summary>
        /// Shows the Controls contained in the specified array
        /// </summary>
        /// <param name="controls">The array Controls to show</param>
        public void ShowControl(Control[] controls)
        {
            // don't bother if we are animating
            if (this.Animating || this.Collapsed)
            {
                return;
            }

            this.SuspendLayout();

            // flag to check if any controls were shown
            bool anyHidden = false;

            foreach (Control control in controls)
            {
                // show the control if we own it and it is not already shown
                if (this.Controls.Contains(control) && this.hiddenControls.Contains(control))
                {
                    anyHidden = true;

                    control.Visible = true;
                    this.hiddenControls.Remove(control);
                }
            }

            this.ResumeLayout(false);

            // if we didn't show any, get out of here
            if (!anyHidden)
            {
                return;
            }

            //
            if (this.beginUpdateCount > 0)
            {
                this.slideAnimationBatched = true;

                return;
            }

            // are we able to animate?
            if (!this.AutoLayout || !this.Animate)
            {
                // guess not
                this.DoLayout();
            }
            else
            {
                if (this.animationHelper != null)
                {
                    this.animationHelper.Dispose();
                    this.animationHelper = null;
                }

                this.animationHelper = new AnimationHelper(this, AnimationHelper.SlideAnimation);

                this.animationHelper.StartAnimation();
            }
        }
        /// <summary>
        /// Resumes drawing of the Expando after drawing is suspended by the 
        /// BeginUpdate method
        /// </summary>
        public void EndUpdate()
        {
            this.beginUpdateCount = Math.Max(--this.beginUpdateCount, 0);

            if (beginUpdateCount == 0)
            {
                if (this.slideAnimationBatched)
                {
                    this.slideAnimationBatched = false;

                    if (this.Animate && this.AutoLayout)
                    {
                        if (this.animationHelper != null)
                        {
                            this.animationHelper.Dispose();
                            this.animationHelper = null;
                        }

                        this.animationHelper = new AnimationHelper(this, AnimationHelper.SlideAnimation);

                        this.animationHelper.StartAnimation();
                    }
                    else
                    {
                        this.DoLayout(true);
                    }
                }
                else
                {
                    this.DoLayout(true);
                }
            }
        }
Exemple #35
0
        public void ShowControl(Control[] controls)
        {
            if (this.Animating || this.Collapsed)
            {
                return;
            }

            this.SuspendLayout();

            bool anyHidden = false;

            foreach (Control control in controls)
            {

                if (this.Controls.Contains(control) && this.hiddenControls.Contains(control))
                {
                    anyHidden = true;

                    control.Visible = true;
                    this.hiddenControls.Remove(control);
                }
            }

            this.ResumeLayout(false);

            if (!anyHidden)
            {
                return;
            }

            if (this.beginUpdateCount > 0)
            {
                this.slideAnimationBatched = true;

                return;
            }

            if (!this.AutoLayout || !this.Animate)
            {

                this.DoLayout();
            }
            else
            {
                if (this.animationHelper != null)
                {
                    this.animationHelper.Dispose();
                    this.animationHelper = null;
                }

                this.animationHelper = new AnimationHelper(this, AnimationHelper.SlideAnimation);

                this.animationHelper.StartAnimation();
            }
        }
Exemple #36
0
        public Expando()
            : base()
        {
            this.components = new System.ComponentModel.Container();

            this.SetStyle(ControlStyles.DoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            this.SetStyle(ControlStyles.Selectable, true);
            this.TabStop = true;

            this.systemSettings = ThemeManager.GetSystemExplorerBarSettings();

            this.customSettings = new ExpandoInfo();
            this.customSettings.Expando = this;
            this.customSettings.SetDefaultEmptyValues();

            this.customHeaderSettings = new HeaderInfo();
            this.customHeaderSettings.Expando = this;
            this.customHeaderSettings.SetDefaultEmptyValues();

            this.BackColor = this.systemSettings.Expando.NormalBackColor;

            this.expandedHeight = 100;

            this.animate = false;
            this.animatingFade = false;
            this.animatingSlide = false;
            this.animationImage = null;
            this.slideEndHeight = -1;
            this.animationHelper = null;
            this.fadeHeights = new int[AnimationHelper.NumAnimationFrames];

            this.Size = new Size(this.systemSettings.Header.BackImageWidth, this.expandedHeight);
            this.titleBarHeight = this.systemSettings.Header.BackImageHeight;
            this.headerHeight = this.titleBarHeight;
            this.oldWidth = this.Width;

            this.collapsed = false;

            this.specialGroup = false;

            this.focusState = FocusStates.None;

            this.titleImage = null;
            this.watermark = null;

            this.Font = new Font(this.TitleFont.Name, 8.25f, FontStyle.Regular);

            this.autoLayout = false;

            this.taskpane = null;

            this.itemList = new ItemCollection(this);
            this.hiddenControls = new ArrayList();

            this.dummyPanel = new AnimationPanel();
            this.dummyPanel.Size = this.Size;
            this.dummyPanel.Location = new Point(-1000, 0);

            this.canCollapse = true;

            this.showFocusCues = false;
            this.useDefaultTabHandling = true;

            this.CalcAnimationHeights();

            this.slideAnimationBatched = false;

            this.dragging = false;
            this.dragStart = Point.Empty;

            this.beginUpdateCount = 0;

            this.initialising = false;
            this.layout = false;
        }