当前位置: 首页>>代码示例>>C#>>正文


C# InputType类代码示例

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


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


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