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

C# InputType类代码示例

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

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



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

示例1: InputAction

 public InputAction(GamePadButton myButton, bool myNewPressOnly,int myPlayer)
 {
     gamePadButton = myButton;
     newPressOnly = myNewPressOnly;
     inputType = InputType.gamepad;
     playerIndex = myPlayer;
 }
开发者ID:TheNextGuy32,项目名称:GDDAPS2,代码行数:7,代码来源:InputAction.cs


示例2: HoneyPotField

        /// <summary>
        /// Renders out field with honeypot security check enabled
        /// </summary>
        /// <param name="helper">HtmlHelper which will be extended</param>
        /// <param name="name">Name of field. Should match model field of string type</param>
        /// <param name="value">Value of the field</param>
        /// <param name="css">CSS class to be applied to input field</param>
        /// <returns>Returns render out MvcHtmlString for displaying on the View</returns>
        public static MvcHtmlString HoneyPotField(this HtmlHelper helper, string name, object value, string inputCss = null, InputType fieldType=InputType.Text,string honeypotCss = null, InputType honeypotType=InputType.Hidden)
        {
            StringBuilder sbControlHtml = new StringBuilder();
            using (StringWriter stringWriter = new StringWriter())
            {
                using (HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter))
                {
                    HtmlInputText hashedField = new HtmlInputText(fieldType.ToString().ToLower());
                    string hashedName = GetHashedPropertyName(name);
                    hashedField.Value = value != null ? value.ToString() : string.Empty;
                    hashedField.ID = hashedName;
                    hashedField.Name = hashedName;
                    if (!string.IsNullOrWhiteSpace(inputCss))
                    {
                        hashedField.Attributes["class"] = inputCss;
                    }
                    hashedField.RenderControl(htmlWriter);


                    HtmlInputText hiddenField = new HtmlInputText(honeypotType.ToString().ToLower());
                    hiddenField.Value = string.Empty;
                    hiddenField.ID = name;
                    hiddenField.Name = name;
                    if (!string.IsNullOrWhiteSpace(honeypotCss))
                    {
                        hiddenField.Attributes["class"] = honeypotCss;
                    }
                    hiddenField.RenderControl(htmlWriter);
                    sbControlHtml.Append(stringWriter.ToString());
                }
            }
            return new MvcHtmlString(sbControlHtml.ToString());
        }
开发者ID:dejanstojanovic,项目名称:MVC-Honeypot,代码行数:41,代码来源:HtmlHelpers.cs


示例3: RenderFormGroupSelectElement

        public static string RenderFormGroupSelectElement(HtmlHelper html, SelectElementModel inputModel,
			LabelModel labelModel, InputType inputType)
        {
            HtmlString input = null;

            if (inputType == InputType.DropDownList)
                input = RenderSelectElement(html, inputModel, InputType.DropDownList);

            if (inputType == InputType.ListBox)
                input = RenderSelectElement(html, inputModel, InputType.ListBox);

            var label = RenderLabel(html, labelModel ?? new LabelModel
            {
                htmlFieldName = inputModel.htmlFieldName,
                metadata = inputModel.metadata,
                htmlAttributes = new {@class = "control-label"}.ToDictionary()
            });

            var fieldIsValid = true;

            if (inputModel != null)
                fieldIsValid = html.ViewData.ModelState.IsValidField(inputModel.htmlFieldName);

            return new FormGroup(input, label, FormGroupType.TextBoxLike, fieldIsValid).ToHtmlString();
        }
开发者ID:andrewreyes,项目名称:NiftyMvcHelpers,代码行数:25,代码来源:RenderFormGroupSelectElement.cs


示例4: HandleInput

 public override void HandleInput(InputType input)
 {
     if (input == InputType.Confirm && ButtonClicked != null)
     {
         ButtonClicked.Invoke();
     }
 }
开发者ID:SebiH,项目名称:BachelorProject,代码行数:7,代码来源:UIButton.cs


示例5: HtmlInput

 public HtmlInput(InputType type, string name, string value)
     : base("input")
 {
     SetAttribut("type", type.ToString());
     SetAttribut("name", name);
     SetAttribut("value", value);
 }
开发者ID:PavloRomanov,项目名称:TrainingProjects,代码行数:7,代码来源:HtmlInput.cs


示例6: dot

	public void dot(){
		m_dotPressed = true;
		m_activeNum += 0.0f;
		m_view.updateDisplay(m_activeNum);

		m_lastInput = InputType.number;
	}
开发者ID:Lambwatt,项目名称:Calculator,代码行数:7,代码来源:CalculatorController.cs


示例7: GenerateHtml

        public string GenerateHtml(InputType inputType, string label, string name, string value = null,
            List<string> options = null)
        {
            string result = inputList[inputType].GenerateHtml(label, name, value, options);

            return result;
        }
开发者ID:te-ori,项目名称:LK.Lib.Web.AdminPanel.Form,代码行数:7,代码来源:HtmlGenerator.cs


示例8: swipeCalculator

    /// <summary>
    /// Calculates whether input is swipe or not.
    /// </summary>
    private void swipeCalculator()
    {
        if (Input.touchCount > 0)
        {
            Touch t = Input.GetTouch(0);

            switch(t.phase)
            {
                case TouchPhase.Began:
                    {
                        startPos = t.position;
                        break;
                    }
                case TouchPhase.Ended:
                    {
                        endPos = t.position;
                        Vector2 lengthOfSwipe = endPos - startPos;
                        if(lengthOfSwipe.magnitude > 90)
                        {
                            touchInput = InputType.SWIPE;
                        }
                        else
                        {
                            touchInput = InputType.TOUCH;
                        }
                        break;
                    }
            }
        }

    }
开发者ID:seeck,项目名称:TombRaiderGO,代码行数:34,代码来源:Player_old.cs


示例9: InputConfig

        public InputConfig(int index)
        {
            Name = "Input #" + (index + 1).ToString("N0");

            PhantomPower = false;
            Type = InputType.Line;
        }
开发者ID:patrickpaul,项目名称:DSPControlCenter,代码行数:7,代码来源:InputConfig.cs


示例10: GameButton

 public GameButton(Buttons buttonCode)
 {
     this.keyCode = Keys.None;
     this.mouseCode = MouseButtons.None;
     this.buttonCode = buttonCode;
     this.inputType = InputType.Button;
 }
开发者ID:trigger-death,项目名称:ZeldaOracle,代码行数:7,代码来源:GameButton.cs


示例11: OnInput

        public InputResult OnInput(InputType inputType, MouseEventArgs beginArgs, MouseEventArgs endArgs, object args)
        {
            foreach (DrawComponent drawComponent in _drawComponents)
            {
                if (drawComponent is IInputEnabled && Utils.IsInputStartInBounds(drawComponent, beginArgs))
                {
                    InputResult result = (drawComponent as IInputEnabled).OnInput(inputType, beginArgs, endArgs, args);

                    if (result == InputResult.Consumed)
                    {
                        FocusOn((drawComponent as IInputEnabled));
                        return InputResult.Consumed;
                    }

                }
            }

            // try to consume the gesture by myself
            if (inputType == InputType.Drag)
            {
                if ((args as DragDirection? ?? DragDirection.Left) == DragDirection.Down)
                    SetContentOffset(endArgs.Y - beginArgs.Y);

                if ((args as DragDirection? ?? DragDirection.Left) == DragDirection.Up)
                    SetContentOffset(endArgs.Y - beginArgs.Y);

                return InputResult.Consumed;
            }

            return InputResult.Bubble;
        }
开发者ID:rudolf-kajan,项目名称:GDIControlLibrary2015,代码行数:31,代码来源:VerticalStack.cs


示例12: DrawWindow

    /// <summary>
    /// 绘制窗口
    /// </summary>
    public override void DrawWindow()
    {
        // 绘制标题
        base.DrawWindow();

        // 绘制选择类型
        inputType = (InputType) EditorGUILayout.EnumPopup("Input type : " , inputType);

        if(inputType == InputType.Number)
        {
            // 绘制Value
            inputValue = EditorGUILayout.TextField("Value", inputValue);
        }
        else if(inputType == InputType.Randomization)
        {
            // 绘制范围
            randomFrom = EditorGUILayout.TextField("From", randomFrom);
            randomTo = EditorGUILayout.TextField("To", randomTo);

            // 随机值
            if(GUILayout.Button("Calculate Random"))
            {
                calculateRandom();
            }
        }
    }
开发者ID:289997171,项目名称:NodeEditor,代码行数:29,代码来源:InputNode.cs


示例13: Initialise

 public virtual void Initialise(string fieldTitle, string fieldType, int fieldId, int moduleId,
                                string controlHelpText, string defaultValue, bool required, string validationRule,
                                string validationMsg, string editStyle, string inputSettings,
                                string outputSettings, bool normalizeFlag, bool multipleValuesFlag,
                                bool inputFilterTags, bool inputFilterScript, InputType inputSettingsListType,
                                ModuleInstanceContext moduleContext, DataTable fieldSettingsTable,
                                IFormEvents formEvents)
 {
     FieldTitle = fieldTitle;
     FieldType = fieldType;
     FieldId = fieldId;
     ModuleId = moduleId;
     HelpText = controlHelpText;
     DefaultValue = defaultValue;
     Required = required;
     ValidationRule = validationRule;
     _customValidationMessage = validationMsg;
     InputSettings = inputSettings;
     OutputSettings = outputSettings;
     Style = editStyle;
     NormalizeFlag = normalizeFlag;
     MultipleValuesFlag = multipleValuesFlag;
     FilterScript = inputFilterScript;
     FilterTags = inputFilterTags;
     ListInputType = inputSettingsListType;
     ModuleContext = moduleContext;
     FieldSettingsTable = fieldSettingsTable;
     FormEvents = formEvents;
 }
开发者ID:DNNCommunity,项目名称:DNN.FormAndList,代码行数:29,代码来源:EditControl.cs


示例14: OnInput

 private void OnInput(InputType input)
 {
     if (IsSelected)
     {
         HandleInput(input);
     }
 }
开发者ID:SebiH,项目名称:BachelorProject,代码行数:7,代码来源:UIElement.cs


示例15: HandleInput

        public void HandleInput(InputType key, InputState state)
        {
            if (_currentGame == null)
                return;

            if (state == InputState.Released)
            {
                if (key == InputType.Next)
                {
                    StartNextGame();
                    return;
                }

                if (key == InputType.Pause)
                {
                    TogglePause(true);
                    return;
                }
            }

            if (state == InputState.Pressed)
                _currentGame.KeyPressed(key);

            if (state == InputState.Released)
                _currentGame.KeyReleased(key);
        }
开发者ID:Maskl,项目名称:MetroRetro,代码行数:26,代码来源:GameManager.cs


示例16: StringInputController

 public StringInputController(InputType inputType)
 {
     _lastPressedKeys = new List<Keys>();
     MaxInputCharacters = 256;
     CurrentText = string.Empty;
     SetInputType(inputType);
 }
开发者ID:nilllzz,项目名称:Pokemon3D,代码行数:7,代码来源:StringInputController.cs


示例17: GetKeyboardType

 internal static UIKeyboardType GetKeyboardType(InputType inputType) {
     switch (inputType) {
         case InputType.Email  : return UIKeyboardType.EmailAddress;
         case InputType.Number : return UIKeyboardType.NumberPad;
         default               : return UIKeyboardType.Default;
     }
 }
开发者ID:Mvvmcross-Cn,项目名称:acrmvvmcross,代码行数:7,代码来源:Utils.cs


示例18: Update

 // Update is called once per frame
 void Update()
 {
     
     swipeCalculator();
     switch (touchInput)
     {
         case InputType.IDLE:
             {
                 print("Listening for touch");
                 break;
             }
         case InputType.TOUCH:
             {
                 print("You touched");
                 break;
             }
         case InputType.SWIPE:
             {
                 print("You swiped");
                 Vector3 rayCastDirection = getRayCastDirection(endPos - startPos);
                 movePlayerToLocation(rayCastDirection);
                 break;
             }
     }
     touchInput = InputType.IDLE;
 }
开发者ID:seeck,项目名称:TombRaiderGO,代码行数:27,代码来源:Player_old.cs


示例19: InputManager

        public InputManager(InputType type, PlayerIndex player)
        {
            this.inputType = type;
              this.playerIndex = player;

              // Populate Dictionary Entries
              inputToKeys = new Dictionary<Inputs, Keys>();
              inputToKeys.Add(Inputs.A, Keys.A);
              inputToKeys.Add(Inputs.B, Keys.S);
              inputToKeys.Add(Inputs.Back, Keys.Escape);
              inputToKeys.Add(Inputs.Up, Keys.Up);
              inputToKeys.Add(Inputs.Down, Keys.Down);
              inputToKeys.Add(Inputs.Left, Keys.Left);
              inputToKeys.Add(Inputs.Right, Keys.Right);
              inputToKeys.Add(Inputs.Start, Keys.Enter);
              inputToKeys.Add(Inputs.X, Keys.Z);
              inputToKeys.Add(Inputs.Y, Keys.X);

              inputToButtons = new Dictionary<Inputs, Buttons>();
              inputToButtons.Add(Inputs.A, Buttons.A);
              inputToButtons.Add(Inputs.B, Buttons.B);
              inputToButtons.Add(Inputs.Back, Buttons.Back);
              inputToButtons.Add(Inputs.Up, Buttons.DPadUp);
              inputToButtons.Add(Inputs.Down, Buttons.DPadDown);
              inputToButtons.Add(Inputs.Left, Buttons.DPadLeft);
              inputToButtons.Add(Inputs.Right, Buttons.DPadRight);
              inputToButtons.Add(Inputs.Start, Buttons.Start);
              inputToButtons.Add(Inputs.X, Buttons.X);
              inputToButtons.Add(Inputs.Y, Buttons.Y);

              inputToMouse = new Dictionary<Inputs, MouseButton>();
              inputToMouse.Add(Inputs.A, MouseButton.Left);
              inputToMouse.Add(Inputs.B, MouseButton.Right);
              inputToMouse.Add(Inputs.X, MouseButton.Middle);
        }
开发者ID:colincapurso,项目名称:EngineMVC,代码行数:35,代码来源:InputManager.cs


示例20: GUIPlayer

        public GUIPlayer(
            Simulator simulator,
            Dictionary<TurretType, bool> availableTurrets,
            Dictionary<string, LevelDescriptor> levelsDescriptors,
            Color color,
            string representation,
            InputType inputType)
        {
            Simulator = simulator;

            SelectedCelestialBodyAnimation = new SelectedCelestialBodyAnimation(Simulator);

            Cursor = new SpaceshipCursor(Simulator.Scene, Vector3.Zero, 2, VisualPriorities.Default.PlayerCursor, color, representation, true);
            Crosshair = new Cursor(Simulator.Scene, Vector3.Zero, 2, VisualPriorities.Default.PlayerCursor, "crosshairRailGun", false);
            TurretMenu = new TurretMenu(Simulator, VisualPriorities.Default.TurretMenu, color, inputType);
            CelestialBodyMenu = new CelestialBodyMenu(Simulator, VisualPriorities.Default.CelestialBodyMenu, color, inputType);

            FinalSolutionPreview = new FinalSolutionPreview(Simulator);

            CelestialBodyMenu.AvailableTurrets = availableTurrets;
            CelestialBodyMenu.Initialize();

            WorldMenu = new WorldMenu(Simulator, VisualPriorities.Default.CelestialBodyMenu, levelsDescriptors, color);
            NewGameMenu = new NewGameMenu(Simulator, VisualPriorities.Default.CelestialBodyMenu, color);

            PowerUpInputMode = false;
            PowerUpFinalSolution = false;
        }
开发者ID:jodigiordano,项目名称:commander,代码行数:28,代码来源:GUIPlayer.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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