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

C# ControlState类代码示例

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

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



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

示例1: TacticalBattle

        public ControlState controlState;                //get and set the control state
        #endregion

        #region constructor/load
        public TacticalBattle(List<Piece> player1Army, List<Piece> player2Army, TacMap map, ContentManager content)
        {
            //p1Avatar = player1;
            //p2Avatar = player2;

            this.player1Army = player1Army;
            this.player2Army = player2Army;

            isPlayer1Turn = true;
            this.map = map;
            battleOver = false;
            gridOn = false;

            mouseVisible = true;
            controlState = ControlState.selectUnit;

            selectedUnit = null;
            status = "Combat begins";
            selectionTiles = new List<Tile>();
            unitInfo = "";
            //load interface items                  TODO
            confirmation = content.Load<Texture2D>("confirmationPopup");
            background = content.Load<Texture2D>("TerrainSprites/battle");
            statusFont = content.Load<SpriteFont>("Arial");
            playerFont = content.Load<SpriteFont>("playerFont");
            infoFont = content.Load<SpriteFont>("infoFont");
            moveBox = content.Load<Texture2D>("TerrainSprites/move");
            targetBox = content.Load<Texture2D>("TerrainSprites/target");
            selectedBox = content.Load<Texture2D>("TerrainSprites/selected");
            horizontal = content.Load<Texture2D>("TerrainSprites/horizontal");
            vertical = content.Load<Texture2D>("TerrainSprites/vertical");
            winBox = content.Load<Texture2D>("Menu/Win message");
            //set units to starting positions
            startingPositions();
        }
开发者ID:Risab,项目名称:dawn-of-conquest,代码行数:39,代码来源:TacticalBattle.cs


示例2: LoadEditor

 public void LoadEditor(IProperties imageServiceSettings)
 {
     _loadedState = ControlState.Loading;
     _imageServiceSettings = imageServiceSettings;
     LoadEditor();
     _loadedState = ControlState.Loaded;
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:7,代码来源:ImageServiceSettingsEditor.cs


示例3: Update

    // Update is called once per frame
    void Update()
    {
        switch(controlState){
            case ControlState.DEBUG:
                Vector2 mouse = Input.mousePosition;
                float h = mouse.x / cam.pixelWidth;
                float v = (cam.pixelHeight - mouse.y)/cam.pixelHeight ;

                //Script used for detecting if controller should be used
                transform.rotation = Quaternion.Euler(v * verticalRotationAmount + verticalRotationOffset,h * horizontalRotationAmount + horizontalRotationOffset,0);

            break;
            case ControlState.NVR:
                controllerRotX += (Input.GetAxis("ViewY") * turnSpeed * Time.deltaTime);
                controllerRotY += (Input.GetAxis("ViewX") * turnSpeed * Time.deltaTime);

                controllerRotX = Mathf.Clamp(controllerRotX,-90,90);

                transform.rotation = Quaternion.Euler(controllerRotX,controllerRotY + cartOffsetRotY,0);
            break;
            case ControlState.VR:
                transform.rotation = Quaternion.Euler(0,cartOffsetRotY - 180,0);
            break;
        }

        if(Input.GetKeyDown("c")){
            if((int)++controlState % 3 == 0)
                controlState = ControlState.DEBUG;
                Console.Instance.AddMessage("ControlState: " + controlState);
                Debug.Log("ControlState: " + controlState);
        }
    }
开发者ID:Jalict,项目名称:MED5-PGP-P1,代码行数:33,代码来源:HeadControl.cs


示例4: LoadEditor

 public void LoadEditor(IImageUploadSettingsEditorContext context)
 {
     _loadedState = ControlState.Loading;
     _context = context;
     LoadEditor();
     _loadedState = ControlState.Loaded;
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:7,代码来源:ImageFileUploadSettingsEditor.cs


示例5: Update

        public void Update(TimeSpan elapsedTime, ControlState controlState)
        {
            var leftRight = this.helpSteer(controlState).Clamped(-1, 1);

            this.updateMovement(elapsedTime, controlState.Acceleration, leftRight);

            this.update();
        }
开发者ID:amulware,项目名称:ld33,代码行数:8,代码来源:CentiHead.cs


示例6: PaintScrollBarThumbEventArgs

 public PaintScrollBarThumbEventArgs(System.Drawing.Graphics graphics, Rectangle thumbRect, ControlState controlState, System.Windows.Forms.Orientation orientation, bool enabled)
 {
     this._graphics = graphics;
     this._thumbRect = thumbRect;
     this._controlState = controlState;
     this._orientation = orientation;
     this._enabled = enabled;
 }
开发者ID:jxdong1013,项目名称:archivems,代码行数:8,代码来源:PaintScrollBarThumbEventArgs.cs


示例7: PaintScrollBarThumbEventArgs

 public PaintScrollBarThumbEventArgs(
     Graphics graphics,
     Rectangle thumbRect,
     ControlState controlState,
     Orientation orientation)
     : this(graphics, thumbRect, controlState, orientation, true)
 {
 }
开发者ID:panshuiqing,项目名称:winform-ui,代码行数:8,代码来源:PaintScrollBarThumbEventArgs.cs


示例8: Blend

        public ColorValue[] States; // Modulate colors for all possible control states

        #endregion Fields

        #region Methods

        /// <summary>Blend the colors together</summary>
        public void Blend(ControlState state, float elapsedTime, float rate)
        {
            if ((States == null) || (States.Length == 0) )
                return; // Nothing to do

            ColorValue destColor = States[(int)state];
            Current = ColorOperator.Lerp(Current, destColor, 1.0f - (float)Math.Pow(rate, 30 * elapsedTime) );
        }
开发者ID:JeremiahZhang,项目名称:AKA,代码行数:15,代码来源:dxmutgui.cs


示例9: PaintScrollBarArrowEventArgs

 public PaintScrollBarArrowEventArgs(System.Drawing.Graphics graphics, Rectangle arrowRect, ControlState controlState, System.Windows.Forms.ArrowDirection arrowDirection, System.Windows.Forms.Orientation orientation, bool enabled)
 {
     this._graphics = graphics;
     this._arrowRect = arrowRect;
     this._controlState = controlState;
     this._arrowDirection = arrowDirection;
     this._orientation = orientation;
     this._enabled = enabled;
 }
开发者ID:jxdong1013,项目名称:archivems,代码行数:9,代码来源:PaintScrollBarArrowEventArgs.cs


示例10: OnMouseEnter

 protected override void OnMouseEnter(EventArgs e)
 {
     if (state != ControlState.Down)
     {
         state = ControlState.Hover; ;
     }
     this.Invalidate();
     base.OnMouseEnter(e);
 }
开发者ID:yienit,项目名称:KST,代码行数:9,代码来源:SkinItemButton.cs


示例11: LoadEditor

 public void LoadEditor(ImageDecoratorEditorContext context, object state, IImageTargetEditor imageTargetEditor)
 {
     _loadedState = ControlState.Loading;
     _context = context;
     _state = state;
     _imageTargetEditor = imageTargetEditor;
     LoadEditor();
     _loadedState = ControlState.Loaded;
     OnEditorLoaded();
 }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:10,代码来源:ImageDecoratorEditor.cs


示例12: PaintScrollBarArrowEventArgs

 public PaintScrollBarArrowEventArgs(
     Graphics graphics,
     Rectangle arrowRect,
     ControlState controlState,
     ArrowDirection arrowDirection,
     Orientation orientation)
     : this(graphics,
     arrowRect,
     controlState,
     arrowDirection,
     orientation,
     true)
 {
 }
开发者ID:panshuiqing,项目名称:winform-ui,代码行数:14,代码来源:PaintScrollBarArrowEventArgs.cs


示例13: StateHotspot

        public StateHotspot(ControlState representedState, Rectangle hotspotRect, bool selected, Image activeImage, Image inactiveImage)
        {
            //Setting what state the hotspot represents
            this.representedState = representedState;

            //Setting if it is currently selected
            this.selected = selected;

            //Setting the size and position of the hotspot
            this.hotspotRect = hotspotRect;

            //Setting the images it will use to display if it is active
            this.activeImage = activeImage;
            this.inactiveImage = inactiveImage;
        }
开发者ID:AlexanderMcNeill,项目名称:voxvisio,代码行数:15,代码来源:StateHotspot.cs


示例14: Update

		public void Update ()
		{
			if (stateChanged)
			{
				stateChanged = false;
				return;
			}
			if (_state == ControlState.Starting)
			{
				_state = ControlState.Active;
			}
			if (_state == ControlState.Ending)
			{
				_state = ControlState.Inactive;
			}
		}
开发者ID:raxter,项目名称:6-Fold-Mass-Production,代码行数:16,代码来源:InputCatcher.cs


示例15: SetControlState

 private void SetControlState(ControlState state)
 {
     switch (state)
     {
         case ControlState.TimerStopped:
             this.groupBoxStartTimers.Enabled = true;
             this.groupBoxControls.Enabled = false;
             break;
         case ControlState.TimerRunning:
             this.groupBoxStartTimers.Enabled = false;
             this.groupBoxControls.Enabled = true;
             break;
         default:
             break;
     }
 }
开发者ID:kihonkai,项目名称:basictimer,代码行数:16,代码来源:FormMain.cs


示例16: helpSteer

        private float helpSteer(ControlState controlState)
        {
            var leftRight = (
                controlState.LeftRight * 2f
                ).Clamped(-1, 1);

            var rayAngle = Angle.FromRadians(0.7f);
            var rayLength = 2.5.U();

            var vVector = this.Direction.Vector;

            leftRight += this.modifySteering(rayAngle, rayLength, vVector);
            leftRight -= this.modifySteering(-rayAngle, rayLength, vVector);

            return leftRight;
        }
开发者ID:amulware,项目名称:ld33,代码行数:16,代码来源:CentiHead.cs


示例17: GetResWithState

 /// <summary>
 /// 图片按钮的背景图是4个,根据状态获取其中背景图
 /// </summary>
 /// <param name="name">图片名称</param>
 /// <param name="state">状态</param>
 /// <returns></returns>
 public static Bitmap GetResWithState(String name, ControlState state)
 {
     Bitmap bitmap = (Bitmap)GetResAsImage(name);
     if (bitmap == null)
     {
         return null;
     }
     int block = 0;
     switch (state)
     {
         case ControlState.Normal: block = 0; break;
         case ControlState.MouseOver: block = 1; break;
         case ControlState.MouseDown: block = 2; break;
         case ControlState.Disable: block = 3; break;
     }
     int width = bitmap.Width / 4;
     Rectangle rect = new Rectangle(block * width, 0, width, bitmap.Height);
     return bitmap.Clone(rect, bitmap.PixelFormat);
 }
开发者ID:EvolveZy,项目名称:ClassCheck,代码行数:25,代码来源:Module.cs


示例18: XbmcHandler

        public XbmcHandler(XbmcJsonRpcConnection xbmc, DisplayHandler display)
        {
            if (xbmc == null)
            {
                throw new ArgumentNullException("xbmc");
            }
            if (display == null)
            {
                throw new ArgumentNullException("display");
            }

            this.xbmc = xbmc;
            this.display = display;

            this.xbmc.Connected                     +=  this.xbmcConnected;
            this.xbmc.Aborted                       +=  this.xbmcAborted;
            this.xbmc.Player.PlaybackStarted        +=  this.xbmcPlaybackStarted;
            this.xbmc.Player.PlaybackPaused         +=  this.xbmcPlaybackPaused;
            this.xbmc.Player.PlaybackResumed        +=  this.xbmcPlaybackResumed;
            this.xbmc.Player.PlaybackStopped        +=  this.xbmcPlaybackStopped;
            this.xbmc.Player.PlaybackEnded          +=  this.xbmcPlaybackEnded;
            this.xbmc.Player.PlaybackSeek           +=  this.xbmcPlaybackSeek;
            this.xbmc.Player.PlaybackSeekChapter    +=  this.xbmcPlaybackSeek;
            this.xbmc.Player.PlaybackSpeedChanged   +=  this.xbmcPlaybackSpeedChanged;

            this.progressTimer = new System.Timers.Timer();
            this.progressTimer.Interval = ProgressUpdateInterval;
            this.progressTimer.Elapsed += progressTimerUpdate;
            this.progressTimer.AutoReset = true;

            this.WorkerReportsProgress = false;
            this.WorkerSupportsCancellation = true;

            this.controlModeState = new ControlState();
            this.controlModeTimer = new System.Timers.Timer();
            this.controlModeTimer.Interval = ControlModeUpdateInterval;
            this.controlModeTimer.Elapsed += controlModeTimerUpdate;
            this.controlModeTimer.AutoReset = true;

            this.semReady = new Semaphore(0, 1);
            this.semWork = new Semaphore(0, 1);
        }
开发者ID:Montellese,项目名称:xbmc-on-imon,代码行数:42,代码来源:XbmcHandler.cs


示例19: SetControlState

        /// <summary>
        /// Set state of control
        /// </summary>
        /// <param name="controlState"></param>
        public void SetControlState(ControlState controlState)
        {
            switch (controlState)
            {
                case ControlState.NewFee:
                    {
                        this.txtCode.Enabled = true;
                        this.txtDescription.Enabled = true;
                        this.txtAmount.Enabled = true;

                        break;
                    }
                case ControlState.ViewFee:
                    {
                        this.txtCode.Enabled = false;
                        this.txtDescription.Enabled = false;
                        this.txtAmount.Enabled = false;
                        break;
                    }
            }
        }
开发者ID:michaelwechter,项目名称:BE-ESUBMIT,代码行数:25,代码来源:FeeDetailControl.cs


示例20: DefineCurrentState

    /// <summary>
    /// Определяет текущее состояние пользователя.
    /// </summary>
    protected virtual void DefineCurrentState()
    {
        SLService.SLService service = new SLService.SLService();
        IList<WorkEvent> mainAndLastWorkEvent = service.GetMainWorkAndLastEvent(Page.CurrentUser.ID.Value);
        WorkEvent TodayWorkEvent = mainAndLastWorkEvent[0];
        WorkEvent LastEvent = mainAndLastWorkEvent[1];

        if (TodayWorkEvent == null ||
            (TodayWorkEvent.BeginTime != TodayWorkEvent.EndTime))
        {
            State = ControlState.WorkFinished;
            return;
        }

        switch (LastEvent.EventType)
        {
            case WorkEventType.MainWork:
                State = ControlState.WorkGoes;
                break;

            case WorkEventType.TimeOff:
                State = LastEvent.BeginTime == LastEvent.EndTime
                            ? ControlState.Absent
                            : ControlState.WorkGoes;
                break;

            case WorkEventType.LanchTime:
                State = LastEvent.BeginTime == LastEvent.EndTime
                            ? ControlState.Feeding
                            : ControlState.WorkGoes;
                break;

            case WorkEventType.StudyEnglish:
                State = LastEvent.BeginTime == LastEvent.EndTime
                            ? ControlState.EnglishLesson
                            : ControlState.WorkGoes;
                break;
        }
    }
开发者ID:Confirmit,项目名称:Portal,代码行数:42,代码来源:NewDay.ascx.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# ControlType类代码示例发布时间:2022-05-24
下一篇:
C# ControlScheme类代码示例发布时间: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