• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UpdateState类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中UpdateState的典型用法代码示例。如果您正苦于以下问题:C# UpdateState类的具体用法?C# UpdateState怎么用?C# UpdateState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UpdateState类属于命名空间,在下文中一共展示了UpdateState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GetState

 static string GetState(UpdateState mu) {
     if (string.IsNullOrWhiteSpace(mu.CurrentRevision))
         return "New";
     if (mu.IsEqual())
         return "Diagnose";
     return mu.IsNewer() ? "Upgrade" : "Downgrade";
 }
开发者ID:MaHuJa,项目名称:withSIX.Desktop,代码行数:7,代码来源:ModUpdatesToStringConverter.cs


示例2: MouseUp

 public void MouseUp(UpdateState state)
 {
     HITVM.Get().PlaySoundEvent(UISounds.BuildDragToolUp);
     vm.Context.Architecture.RunCommands(Commands);
     Commands.Clear();
     Drawing = false;
 }
开发者ID:gamedev1337,项目名称:Project-Dollhouse,代码行数:7,代码来源:UIFloorPainter.cs


示例3: OnMouseEvent

        private void OnMouseEvent(UIMouseEventType type, UpdateState state)
        {
            switch (type)
            {
                case UIMouseEventType.MouseOver:
                    //m_isOver = true;
                    break;

                case UIMouseEventType.MouseOut:
                    //m_isOver = false;
                    break;

                case UIMouseEventType.MouseDown:
                    m_isDown = true;
                    break;

                case UIMouseEventType.MouseUp:
                    if (m_isDown)
                    {
                        if (OnButtonClick != null)
                        {
                            OnButtonClick(this);
                            //GameFacade.SoundManager.PlayUISound(1);
                        }
                    }
                    m_isDown = false;
                    break;
            }
        }
开发者ID:ddfczm,项目名称:Project-Dollhouse,代码行数:29,代码来源:UIClickableLabel.cs


示例4: ShowDialog

        public DialogResult ShowDialog(UpdateState state, string version="")
        {
            btn_yes.Text = "Yes";
            btn_no.Text = "No";
            string title="";
            string desc="";

            switch(state)
            {
                case UpdateState.OffsetsMissing:
                    pic_image.Image = Properties.Resources.file_missing;
                    btn_no.Text = "Exit program";
                    title="Offsets missing!";
                    desc= String.Format("{0} could not be found. Do you want to download the latest offsets?", settings.OffSetXML);
                    break;
                case UpdateState.UpgradeTool:
                    title="Program update available!";
                    desc = String.Format("Dungeon Teller v{0} is available. Do you want to start the updater?", version);
                    break;
                case UpdateState.UpdateOffsets:
                    title="Offset update available!";
                    desc = String.Format("Your offsets version: {0}\nLatest offsets version: {1}\nDo you want to update them now?", settings.WowVersion, version);
                    break;
            }

            lbl_title.Text = title;
            lbl_desc.Text = desc;

            return this.ShowDialog();
        }
开发者ID:siriuzwhite,项目名称:Dungeon-Teller,代码行数:30,代码来源:UpdaterDialog.cs


示例5:

		UpdateFrequency IUpdate.Update(UpdateState state)
		{
			if (disposed)
				return UpdateFrequency.Terminate;

			Update(state, state.PlayerInput[PlayerIndex].InputState);

			return UpdateFrequency.FullUpdate60hz;
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:9,代码来源:CameraControlled.cs


示例6: requestStateChange

 public void requestStateChange(string name)
 {
     if(this.InvokeRequired) {
         UpdateState d = new UpdateState(requestStateChange);
         this.Invoke(d, new object[]{name});
     } else {
         sHandler.activateState(name);
     }
 }
开发者ID:Railec,项目名称:SE1cKBS,代码行数:9,代码来源:Form1.cs


示例7: Update

        public void Update(UpdateState state)
        {
            DateTime now = DateTime.Now;

            if (_lastCacheClean + _cleanInterval >= now)
                return;

            _landCache.Clean();
            _lastCacheClean = now;
        }
开发者ID:andyhebear,项目名称:HappyQ-WowServer,代码行数:10,代码来源:TextureFactory.cs


示例8: MouseDown

 public void MouseDown(UpdateState state)
 {
     if (!Drawing)
     {
         HITVM.Get().PlaySoundEvent(UISounds.BuildDragToolDown);
         Drawing = true;
         var tilePos = World.State.WorldSpace.GetTileAtPosWithScroll(new Vector2(state.MouseState.X, state.MouseState.Y));
         StartPosition = new Point((int)Math.Round(tilePos.X), (int)Math.Round(tilePos.Y));
     }
 }
开发者ID:gamedev1337,项目名称:Project-Dollhouse,代码行数:10,代码来源:UIWallPlacer.cs


示例9: Update

		public virtual void Update(UpdateState state)
		{
			MaterialManager.RefreshLights();
			PhysicsSpace.Update();

		    foreach (var gameObject in beingRemoved)
		    {
                drawToScreen.Remove(gameObject);
		    }
            
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:11,代码来源:Scene.cs


示例10: OnMouse

 private void OnMouse(UIMouseEventType type, UpdateState state)
 {
     if (type == UIMouseEventType.MouseOver)
     {
         if (isDown) { return; }
         color = Color.Red;
     }
     else if (type == UIMouseEventType.MouseOut)
     {
         if (isDown) { return; }
         color = Color.White;
     }
     else if (type == UIMouseEventType.MouseDown)
     {
         color = Color.Blue;
         isDown = true;
     }
     else if (type == UIMouseEventType.MouseUp)
     {
         isDown = false;
         color = Color.Green;
     }
 }
开发者ID:ddfczm,项目名称:Project-Dollhouse,代码行数:23,代码来源:UIRectangle.cs


示例11: Update

		/// <summary></summary>
		/// <param name="state"></param>
		/// <param name="input"></param>
		protected override sealed void Update(UpdateState state, InputState input)
		{
			Vector2 r = input.ThumbSticks.RightStick * (rotAcceleration * rotAcceleration * 0.05f + new Vector2(1, 1));

			viewRotation += r * RotationSensitivity * 0.04f;

			float cap = v_cap;

			if (viewRotation.Y > cap)
				viewRotation.Y = cap;
			if (viewRotation.Y < -cap)
				viewRotation.Y = -cap;

			rotAcceleration += input.ThumbSticks.RightStick * (new Vector2(0.5f, 0.25f) * (1.5f - move.Length() * 0.5f)) * 1.25f;
			rotAcceleration *= 0.9f;

#if !XBOX360
			if (state.PlayerInput[PlayerIndex].ControlInput == ControlInput.KeyboardMouse)
				rotAcceleration *= 0;//no rotation acceleration for mouse
#endif

			move *= 0.75f;
			move += input.ThumbSticks.LeftStick / 4;

			if (rotAcceleration.LengthSquared() > 0 && r.LengthSquared() > 0)
			{
				Vector2 v1 = rotAcceleration, v2 = r;
				v1.Normalize();
				v2.Normalize();
				float a = Vector2.Dot(v1, v2);
				if (a > 0)
					rotAcceleration *= a;
				else
					rotAcceleration *= 0.25f;
			}

			Matrix m1, rotation;

			if (zUp)
			{
				//z is up, so rotate left/right is around z.
				Matrix.CreateRotationZ(-viewRotation.X, out rotation);
				//x is always left to right, so rotate up/down is around x
				Matrix.CreateRotationX(viewRotation.Y + MathHelper.PiOver2, out m1);
			}
			else
			{
				//y is up, so rotate left/right is around y.
				Matrix.CreateRotationY(-viewRotation.X, out rotation);
				Matrix.CreateRotationX(viewRotation.Y, out m1);
			}

			Matrix.Multiply(ref m1, ref rotation, out rotation);

			Vector3 pos = Position;
			pos -= (rotation.Forward * move.Y * MovementSensitivity.Y * -8 + rotation.Left * move.X * MovementSensitivity.X * 8);// new Vector3(move.X * -8, 0, move.Y * 8);

			Matrix.CreateTranslation(ref pos, out m1);
			Matrix.Multiply(ref rotation, ref m1, out rotation);

			CameraMatrix = rotation;
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:65,代码来源:CameraControlled.cs


示例12: Update

		public UpdateFrequency Update(UpdateState state)
		{
			Vector3 color = new Vector3(0.08f, 0.08f, 0.08f);
			if (Highlight)
				color = new Vector3(0.15f, 0.5f, 0.05f);

			this.Colour = this.Colour * 0.75f + color * 0.25f;
			Vector3 half = Vector3.One * 0.5f;

			background[0].Colour = new Color(this.Colour * Fade);
			background[2].Colour = new Color(new Vector3(0.25f, 0.25f, 0.25f) * Fade + half * (1 - Fade));
			background[1].Colour = new Color(new Vector3(1, 1, 1) * Fade + half * (1-Fade));
			text.ColourFloat = new Vector4(this.Colour + Vector3.One * 0.5f, Fade);

			return UpdateFrequency.OncePerFrame;
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:16,代码来源:Menu.cs


示例13: ButtonAnim

        public void ButtonAnim(UpdateState state)
        {
            icon.button.Selected = false;
            if (Alert && Ticks < 30) icon.button.Selected = true;

            if (++Ticks > 59)
            {
                Ticks = 0;
            }
        }
开发者ID:ddfczm,项目名称:Project-Dollhouse,代码行数:10,代码来源:UIMessage.cs


示例14: Update

        private void Update(UpdateState state)
        {
            Vector2 pt = Target.GetMousePosition(state.MouseState);
            var pt2 = new Microsoft.Xna.Framework.Point((int)pt.X, (int)pt.Y);
            if (m_active)
            {
                if (m_fade < 1) m_fade += 0.1f;
                if (m_fade > 1) m_fade = 1;

                GameFacade.Screens.TooltipProperties.UpdateDead = false;
                GameFacade.Screens.TooltipProperties.Position = m_position;
                GameFacade.Screens.TooltipProperties.Opacity = m_fade;
                /** fade in **/
                if (!Target.GetBounds().Contains(pt2) || !GameFacade.Focus || !Target.WillDraw())
                {
                    m_active = false;
                    GameFacade.Screens.TooltipProperties.Show = false;
                    GameFacade.Screens.TooltipProperties.Opacity = 0;
                    m_fade = 0;
                }
            }
            else
            {
                if (Target.GetBounds().Contains(pt2) && Target.Tooltip != null && Target.WillDraw() && GameFacade.Focus)
                {
                    m_active = true;
                    GameFacade.Screens.TooltipProperties.Show = true;
                    GameFacade.Screens.TooltipProperties.Opacity = 0;
                    GameFacade.Screens.TooltipProperties.UpdateDead = false;
                    GameFacade.Screens.Tooltip = Target.Tooltip;
                    m_fade = 0;

                    m_position = new Vector2(state.MouseState.X, Target.LocalPoint(new Vector2(0, 0)).Y); //at top of element
                }
            }
        }
开发者ID:sector-c,项目名称:Project-Dollhouse,代码行数:36,代码来源:UIUtils.cs


示例15: SetUpdateProgress

        private void SetUpdateProgress(int updatedItemCount = 0, int totalUpdateItemCount = 0, UpdateState updateState = UpdateState.Default)
        {
            int progress = 0;
            string message = "";

            if (totalUpdateItemCount > 0)
                progress = (int)(100.0f * (float)updatedItemCount / (float)totalUpdateItemCount);

            if (updateState == UpdateState.Default)
            {
                switch (_state)
                {
                    case NovelState.Active:
                        updateState = UpdateState.Waiting;
                        break;
                    case NovelState.Completed:
                        updateState = UpdateState.Completed;
                        break;
                    case NovelState.Inactive:
                        updateState = UpdateState.Inactive;
                        break;
                    case NovelState.Dropped:
                        updateState = UpdateState.Dropped;
                        break;

                }
            }

            switch (updateState)
            {
                case UpdateState.Waiting:
                    progress = 0;
                    message = "Waiting For Updates";
                    break;
                case UpdateState.Checking:
                    progress = 0;
                    message = "Checking For Updates";
                    break;
                case UpdateState.Fetching:
                    message = "Fetching Updates: " + updatedItemCount + " / " + totalUpdateItemCount;
                    break;
                case UpdateState.UpToDate:
                    if (_state == NovelState.Active)
                        message = "Novel Up To Date";
                    else if(_state == NovelState.Completed)
                        message = "Complted Novel Up To Date";
                    else if (_state == NovelState.Inactive)
                        message = "Inactive Novel Up To Date";
                    else if (_state == NovelState.Dropped)
                        message = "Dropped Novel Up To Date";
                    progress = 100;
                    break;
                case UpdateState.Completed:
                    progress = 100;
                    message = "Novel Completed";
                    break;
                case UpdateState.Inactive:
                    progress = 0;
                    message = "Novel Inactive";
                    break;
                case UpdateState.Dropped:
                    progress = 0;
                    message = "Novel Dropped";
                    break;
            }

            if (BackgroundService.Instance.novelReaderForm != null && BackgroundService.Instance.novelReaderForm.InvokeRequired)
            {
                BackgroundService.Instance.novelReaderForm.BeginInvoke(new System.Windows.Forms.MethodInvoker(delegate
                {
                    UpdateProgress = new Tuple<int, string>(progress, message);
                }));
            }
            else
            {
                UpdateProgress = new Tuple<int, string>(progress, message);
            }
        }
开发者ID:TheTerribleChild,项目名称:Windows-Novel-Reader,代码行数:78,代码来源:Novel.cs


示例16: Update

 public override void Update(UpdateState GState)
 {
 }
开发者ID:ddfczm,项目名称:Project-Dollhouse,代码行数:3,代码来源:CitySceneElement.cs


示例17: OnMouse

 private void OnMouse(UIMouseEventType type, UpdateState state)
 {
 }
开发者ID:Blayer98,项目名称:Project-Dollhouse,代码行数:3,代码来源:UIBlocker.cs


示例18: DragMouseEvents

        /// <summary>
        /// Handle mouse events for dragging
        /// </summary>
        /// <param name="evt"></param>
        private void DragMouseEvents(UIMouseEventType evt, UpdateState state)
        {
            switch (evt)
            {
                case UIMouseEventType.MouseDown:
                    /** Start drag **/
                    m_doDrag = true;
                    DragControl.AddUpdateHook(UpdateHook);

                    var position = DragControl.GetMousePosition(state.MouseState);
                    m_dragOffsetX = position.X;
                    m_dragOffsetY = position.Y;
                    break;

                case UIMouseEventType.MouseUp:
                    /** Stop drag **/
                    m_doDrag = false;
                    DragControl.RemoveUpdateHook(UpdateHook);
                    break;
            }
        }
开发者ID:sector-c,项目名称:Project-Dollhouse,代码行数:25,代码来源:UIUtils.cs


示例19: CallUpdate

		internal void CallUpdate(UpdateState state)
		{
			((IUpdate)updateManager).Update(state);
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:4,代码来源:Application.cs


示例20: Update

		protected override void Update(UpdateState state)
		{
			if (state.PlayerInput[PlayerIndex.One].InputState.Buttons.Back.OnPressed)
				this.Shutdown();
		}
开发者ID:shadarath,项目名称:Wirtualna-rzeczywistosc,代码行数:5,代码来源:ModelInstance.cs



注:本文中的UpdateState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UpdateType类代码示例发布时间:2022-05-24
下一篇:
C# UpdateFlags类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap