Exemple #1
0
 /// <summary>
 /// Add input to the local powershell's input collection
 /// </summary>
 /// <param name="sender">sender of this event, unused</param>
 /// <param name="eventArgs">arguments describing this event</param>
 private void HandleInputReceived(object sender, RemoteDataEventArgs <object> eventArgs)
 {
     // This can be called in pushed runspace scenarios for error reporting (pipeline stopped).
     // Ignore for noInput.
     if (!_noInput && (InputCollection != null))
     {
         InputCollection.Add(eventArgs.Data);
     }
 }
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.LeftArrow))
        {
            inputCollection.Add(InputType.LeftDown, Time.frameCount);
        }
        else if (Input.GetKeyUp(KeyCode.LeftArrow))
        {
            inputCollection.Add(InputType.LeftUp, Time.frameCount);
        }

        if (Input.GetKeyDown(KeyCode.RightArrow))
        {
            inputCollection.Add(InputType.RightDown, Time.frameCount);
        }
        else if (Input.GetKeyUp(KeyCode.RightArrow))
        {
            inputCollection.Add(InputType.RightUp, Time.frameCount);
        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            inputCollection.Add(InputType.JumpDown, Time.frameCount);
        }
        else if (Input.GetKeyUp(KeyCode.Space))
        {
            inputCollection.Add(InputType.JumpUp, Time.frameCount);
        }
    }
 private void AddInput(object sender, EventArgs e)
 {
     using (var form = new IdentifierForm <InputObj>("Input", inputs.Keys))
     {
         if (form.ShowDialog(this) == DialogResult.OK)
         {
             var obj = new InputObj
             {
                 UserDefined = true,
                 Type        = "any"
             };
             inputs.Add(form.Identifier, obj);
             cmboInputs.Items.Add(form.Identifier);
             cmboInputs.SelectedIndex = cmboInputs.FindStringExact(form.Identifier);
             InputChanged(null, EventArgs.Empty);
         }
     }
 }
Exemple #4
0
        public object Create(object parent, object configContext, System.Xml.XmlNode section)
        {
            if (section.ChildNodes == null)
            {
                return(null);
            }
            InputCollection list = new InputCollection();

            for (int i = 0; i < section.ChildNodes.Count; i++)
            {
                XmlNode node = section.ChildNodes[i];
                if (node.NodeType == XmlNodeType.Element)
                {
                    Input input = new Input();
                    input.Name     = node.Attributes["name"].InnerText;
                    input.ProgId   = node.Attributes["progId"].InnerText;
                    input.TypeName = node.Attributes["type"].InnerText;
                    list.Add(input);
                }
            }
            return(list);
        }
Exemple #5
0
        ///############################################################
        /// <summary>
        /// Initializes the class.
        /// </summary>
        /// <param name="oTable">MultiArray representing the table metadata to render.<para/>NOTE: Column definitions can be from more then one table.</param>
        /// <param name="sIDColumn">String representing the name of the primary key column (this column will not be included in the generated SQL statements).<para/>NOTE: Pass in a null-string if there is no ID column.</param>
        ///############################################################
        /// <LastUpdated>December 11, 2009</LastUpdated>
        private void Initilize(MultiArray oTable, string sIDColumn)
        {
            Inputs.AdditionalData oAdditionalData = new Inputs.AdditionalData();
            string sPicklistName;
            string sColumnName;
            int    iIDColumnLen;
            int    i;

            Inputs.enumSaveTypes eSaveType;

            //#### Init the global vars
            g_oGet           = new DBMS.GetValue(this);
            ga_sInputAliases = null;
            g_iColumnCount   = 0;

            //#### If the caller passed in a oTable with data
            if (oTable != null && oTable.RowCount > 0)
            {
                //#### Reset g_iColumnCount, dimension ga_sInputAliases and determine sIDColumn's .Length
                g_iColumnCount   = oTable.RowCount;
                ga_sInputAliases = new string[g_iColumnCount];
                iIDColumnLen     = sIDColumn.Length;

                //#### Traverse the oTable's .Rows (each of which represent a column within the referenced sTableName)
                for (i = 0; i < g_iColumnCount; i++)
                {
                    //#### Collect the current sColumnName, setting it into the ga_sInputAliases as we go (as we use the sColumnName as the sInputAlias below)
                    sColumnName         = oTable.Value(i, "Column_Name");
                    ga_sInputAliases[i] = sColumnName;

                    //#### If the current sColumnName matches the passed sIDColumn (checking their .Lengths first as that is a far faster comparsion)
                    if (iIDColumnLen == sColumnName.Length && sIDColumn == sColumnName)
                    {
                        //#### Set the current sColumnName/sIDColumn's eSaveType as .cnID
                        eSaveType = Web.Inputs.enumSaveTypes.cnID;
                    }
                    //#### Else this is a non-.cnID column definition
                    else
                    {
                        //#### If the current column Is_Nullable, set it's eSaveType as .cnInsertNull
                        if (Data.Tools.MakeBoolean(oTable.Value(i, "Is_Nullable"), false))
                        {
                            eSaveType = Web.Inputs.enumSaveTypes.cnInsertNull;
                        }
                        //#### Else the current column Is_(not)Nullable, so set it's eSaveType as .cnRequired
                        else
                        {
                            eSaveType = Web.Inputs.enumSaveTypes.cnRequired;
                        }
                    }

                    //#### Collect the current RelatedPicklist sPicklistName
                    sPicklistName = Data.Tools.MakeString(oTable.Value(i, "RelatedPicklist"), "");

                    //#### If a sPicklistName was collected above, set it into the oAdditionalData
                    if (sPicklistName.Length > 0)
                    {
                        oAdditionalData.Picklist_Name = sPicklistName;
                    }
                    //#### Else no sPicklistName was found, so ensure that the related key in oAdditionalData is blank
                    else
                    {
                        oAdditionalData.Picklist_Name = null;
                    }

                    //#### .Add the above determined input
                    InputCollection.Add(sColumnName, oTable.Value(i, "Table_Name"), sColumnName, eSaveType, MetaData.enumValueTypes.cnSingleValue, oAdditionalData);
                }
            }
            //#### Else the passed a oTable that was empty, so raise the error
            else
            {
//!
            }
        }
 public void AddInput(Input input)
 {
     _inputs.Add(input);
 }