public void InitGrids() { DataTable columns = new DataTable(); DataColumn column = new DataColumn(); column = columns.Columns.Add(colTipo); column.DataType = typeof(String); column = columns.Columns.Add(colNombre); column.DataType = typeof(String); column = columns.Columns.Add(colPropiedad); column.DataType = typeof(String); column = columns.Columns.Add(colValor); column.DataType = typeof(String); ugParametros.DataSource = columns; ValueList List = new ValueList(); List.ValueListItems.Add("SQL/Propiedad"); List.ValueListItems.Add("Crystal/String"); List.ValueListItems.Add("Crystal/Int"); List.ValueListItems.Add("Crystal/Decimal"); List.ValueListItems.Add("Crystal/Boolean"); List.ValueListItems.Add("Crystal/DateTime"); ugParametros.DisplayLayout.Bands[0].Columns[colTipo].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList; ugParametros.DisplayLayout.Bands[0].Columns[colTipo].ValueList = List; ugParametros.DisplayLayout.Bands[0].Columns[colPropiedad].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton; MapKeys(ref ugParametros); }
public virtual ExpressionNode Execute(ValueList args) { for (var i = 0; i < args.Count; i++) { SetVariable(new VariableNode(_args[i].Name, new Expression(args[i]))); } foreach (var codeNode in Nodes) { if (codeNode is VariableNode) { var n = (VariableNode) codeNode; var expr = n.Expression.Resolve(this); SetVariable(new VariableNode(n.Name, new Expression(expr))); } else if (codeNode is ReturnNode) { return ((ReturnNode) codeNode).Expression.Resolve(this); } else { throw new NotSupportedException(); } } throw new Exception("Could not find return statement"); }
private void listaModelliLetteraUCLoad(object sender, EventArgs e) { var editorControl = new SceltaDocumentoUC(_modelloLetteraService); Controls.Add(editorControl); ultraControlContainerEditor1.EditingControl = editorControl; ultraControlContainerEditor1.EditingControlPropertyName = "Checksum"; editorControl.ApriModello += editorControlApriModello; var renderControl = new SceltaDocumentoUC(_modelloLetteraService); ultraControlContainerEditor1.RenderingControl = renderControl; ultraControlContainerEditor1.RenderingControlPropertyName = "Checksum"; if (lista.DisplayLayout.ValueLists.Count == 0) { if (_tipiModello.Count == 0) { lista.DisplayLayout.ValueLists.Add(DataSourceHelper.GetValueList<TipoModelloLetteraEnum>("TipoModello")); lista.DisplayLayout.Bands[0].Columns["Tipo"].ValueList = lista.DisplayLayout.ValueLists["TipoModello"]; } else { var valueList = new ValueList {Key = "TipoModello"}; foreach (var tipoModelloLetteraEnum in _tipiModello) valueList.ValueListItems.Add(tipoModelloLetteraEnum, tipoModelloLetteraEnum.ToString()); lista.DisplayLayout.ValueLists.Add(valueList); lista.DisplayLayout.Bands[0].Columns["Tipo"].ValueList = lista.DisplayLayout.ValueLists["TipoModello"]; } } if(ParentForm != null) ParentForm.FormClosing += parentFormFormClosing; }
public void SetEntryPerceptrons(ValueList<double> entryValues) { for (var i = 1; i <= Layers[1].CountPerceptrons; i++) { Layers[1].Perceptron(i).EntryValue = entryValues[i]; } }
public ValueList Calculate() { boll = MA(CLOSE, N); UPPER = boll + M * STD(CLOSE, N); LOWER = boll - M * STD(CLOSE, N); return boll; }
public ValueList<double> GetLastLayerExitValues() { var exitValues = new ValueList<double>(); foreach (Perceptron perceptron in _lastLayer.Perceptrons) exitValues.Add(perceptron.ExitValue()); return exitValues; }
public NeuralNetwork(LayerDictionary layers, AcceptanceMatcher acceptanceMatcher) { LayerDictionary = layers; DeltaDictionary = DeltaDictionaryBuilder.Build(LayerDictionary); EntryValues = new ValueList<double>(); ExitValues = new ValueList<double>(); _acceptanceMatcher = acceptanceMatcher; _errorCoefficient = 0.2; }
public ValueList<double> Next(int numberOfBytes) { var byteValues = new ValueList<double>(); for (var i = 0; i < numberOfBytes; i++) byteValues.Add(_fileStream.ReadByte() / 255.0); return byteValues; }
public ValueList Calculate() { DIFF = EMA(CLOSE, s) - EMA(CLOSE, l); DEA = EMA(DIFF, m); macd = DIFF - DEA; // TODO: 根据上穿和下击 来给出买卖建议 return macd; }
public void InitGrid() { // Distritos DataTable columns = new DataTable(); DataColumn column = new DataColumn(); column = columns.Columns.Add(colOrigen); column.DataType = typeof(String); column = columns.Columns.Add(colDestino); column.DataType = typeof(String); column = columns.Columns.Add(colTipoVehiculo); column.DataType = typeof(String); ugDistritos.DataSource = columns; ugDistritos.DisplayLayout.Bands[0].Columns[colOrigen].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton; ugDistritos.DisplayLayout.Bands[0].Columns[colDestino].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.EditButton; ValueList List = new ValueList(); List.ValueListItems.Add("AUTOMÓVIL", "AUTOMÓVIL"); List.ValueListItems.Add("MOTOCICLETA", "MOTOCICLETA"); List.ValueListItems.Add("CAMIÓN PEQUEÑO", "CAMIÓN PEQUEÑO"); List.ValueListItems.Add("CAMIÓN MEDIANO", "CAMIÓN MEDIANO"); List.ValueListItems.Add("CAMIÓN GRANDE", "CAMIÓN GRANDE"); ugDistritos.DisplayLayout.Bands[0].Columns[colTipoVehiculo].ValueList = List; ugDistritos.DisplayLayout.Bands[0].Columns[colTipoVehiculo].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList; MapKeys(ref ugDistritos); //Escalas columns = new DataTable(); column = columns.Columns.Add(colDesde); column.DataType = typeof(Int32); column = columns.Columns.Add(colHasta); column.DataType = typeof(Int32); column = columns.Columns.Add(colDescripcion); column.DataType = typeof(String); column = columns.Columns.Add(colPrecio); column.DataType = typeof(Decimal); ugEscalas.DataSource = columns; ugEscalas.DisplayLayout.Bands[0].Columns[colDesde].DefaultCellValue = 0; ugEscalas.DisplayLayout.Bands[0].Columns[colHasta].DefaultCellValue = 0; ugEscalas.DisplayLayout.Bands[0].Columns[colPrecio].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DoubleNonNegative; ugEscalas.DisplayLayout.Bands[0].Columns[colPrecio].DefaultCellValue = 0; ugEscalas.DisplayLayout.Bands[0].Columns[colPrecio].CellAppearance.TextHAlign = Infragistics.Win.HAlign.Right; MapKeys(ref ugEscalas); }
public void Enumerate() { var test = new ValueList<ValueInt>(() => ValueInt.GetValues(5)); test.Insert(0, 4, 0); int index = 0; int[] indexes = { 4, 0, 0 }; foreach (var item in test.List) { Assert.AreEqual<ValueInt>(test.Values[indexes[index++]], item); } }
public void LoadValuesFor(NeuralNetwork neuralNetwork) { var firstLayerWeights = new ValueList<double>(); var secondLayerWeights = new ValueList<double>(); var secondLayerThresholds = new ValueList<double>(); var thirdLayerThresholds = new ValueList<double>(); try { var connection = new NpgsqlConnection(ConnectionString); connection.Open(); var command = new NpgsqlCommand { Connection = connection }; command.CommandText = "SELECT weight FROM pr4_weights_layer1 ORDER BY id ASC"; var reader = command.ExecuteReader(); while (reader.Read()) firstLayerWeights.Add(reader.GetDouble(0)); reader.Close(); command.CommandText = "SELECT weight FROM pr4_weights_layer2 ORDER BY id ASC"; reader = command.ExecuteReader(); while (reader.Read()) secondLayerWeights.Add(reader.GetDouble(0)); reader.Close(); command.CommandText = "SELECT threshold FROM pr4_thresholds_layer2 ORDER BY id ASC"; reader = command.ExecuteReader(); while (reader.Read()) secondLayerThresholds.Add(reader.GetDouble(0)); reader.Close(); command.CommandText = "SELECT threshold FROM pr4_thresholds_layer3 ORDER BY id ASC"; reader = command.ExecuteReader(); while (reader.Read()) thirdLayerThresholds.Add(reader.GetDouble(0)); neuralNetwork.SetWeightsForLayer(1, firstLayerWeights); neuralNetwork.SetWeightsForLayer(2, secondLayerWeights); neuralNetwork.SetThresholdsForLayer(2, secondLayerThresholds); neuralNetwork.SetThresholdsForLayer(3, thirdLayerThresholds); } catch (Exception) { Console.WriteLine("There was a problem loading values from the database."); throw; } }
public CsvParser(TextReader reader) { Debug.Assert(reader != null, "Reader must never be null."); this.reader = reader; this.buffer = new char[BufferSize]; this.values = new ValueList(); this.valueBuilder = new ValueBuilder(this); this.valueSeparator = Constants.DefaultValueSeparator; this.valueDelimiter = Constants.DefaultValueDelimiter; this.UpdateSpecialCharacterMask(); }
public EachNode(ValueList variables, ValueList list) { foreach (var variable in variables) { if (!(variable is ReferenceNode)) throw new Exception("Only variable names allowed in each"); ReferenceNode referenceNode = (ReferenceNode) variable; Variables.Add(new VariableNode(referenceNode.VariableName)); } List = list; }
public void ActualizarCombos() { foreach (UltraGridRow Row in ugItemAccion.Rows) { ValueList List = new ValueList(); foreach (ItemAccion Item in this.Accion.Items) { if(!Item.ID.Equals(((ItemAccion)Row.Tag).ID)){ List.ValueListItems.Add(Item.Nombre, Item.Nombre); } } List.ValueListItems.Add("Salir", "Salir del Flujo"); Row.Cells[colExito].ValueList = List; Row.Cells[colError].ValueList = List; } }
public void AgregarUnidades(UltraGridRow Row) { ItemEntradaInventario Item = (ItemEntradaInventario)Row.Tag; ValueList List = new ValueList(); foreach (ExistenciaUnidad Unidad in Item.Producto.Unidades) { if (Unidad.EsUnidadBase) { Item.Unidad = Unidad.Unidad; Item.Factor = Unidad.FactorConversion; } List.ValueListItems.Add(Unidad, Unidad.Unidad.Nombre); } Row.Cells[colUnidad].ValueList = List; }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["pk"] == "0") {// No primary key--add mode _pageMode = Constant.PageMode.Add; } else {// We have a primary key--edit mode _pageMode = Constant.PageMode.Edit; } DataTable dataTable; DataRow foundRow; SimpleData simpleData = new SimpleData(); ConnectionStringSettings connectionStringSettings = ConfigurationManager.ConnectionStrings["db"]; simpleData.ConnectionString = connectionStringSettings.ConnectionString; // Get drink data from db if (_pageMode == Constant.PageMode.Add) { DataTable dtTemp = simpleData.FetchSP("GetDrink", new SqlParameter[] { new SqlParameter("DrinkID", Request.QueryString["pk"]) }); _drDrink = dtTemp.NewRow(); } else { _drDrink = simpleData.FetchSP("GetDrink", new SqlParameter[] { new SqlParameter("DrinkID", Request.QueryString["pk"]) }).Rows[0]; } _dtDrinkAttributes = simpleData.FetchSP("GetDrinkAttributes", new SqlParameter[] { new SqlParameter("DrinkID", Request.QueryString["pk"]) }); _dtDrinkAttributes.PrimaryKey = new DataColumn[] { _dtDrinkAttributes.Columns["ListItem_pk"] }; _dtDrinkFlavors = simpleData.FetchSP("GetDrinkFlavors", new SqlParameter[] { new SqlParameter("DrinkID", Request.QueryString["pk"]) }); _dtDrinkFlavors.PrimaryKey = new DataColumn[] { _dtDrinkFlavors.Columns["ListItem_pk"] }; // Title if (_drDrink["Name"] != DBNull.Value) _titleLiteral.Text = (string)_drDrink["Name"]; // Load combo items ############################################################################# // Category dataTable = simpleData.FetchSP("GetListItems", new SqlParameter[] { new SqlParameter("ListID", Convert.ToInt32(Constant.List.DrinkCategory)) }); _categoryCombo.DataSource = dataTable; _categoryCombo.DataBind(); // Family dataTable = simpleData.FetchSP("GetListItems", new SqlParameter[] { new SqlParameter("ListID", Convert.ToInt32(Constant.List.Family)) }); _familyCombo.DataSource = dataTable; _familyCombo.DataBind(); _familyCombo.Items.Insert(0, new ListItem(Constant.NotSpecifiedDescription, Convert.ToString(Constant.NotSpecifiedValue))); // Structure dataTable = simpleData.FetchSP("GetListItems", new SqlParameter[] { new SqlParameter("ListID", Convert.ToInt32(Constant.List.Structure)) }); _structureCombo.DataSource = dataTable; _structureCombo.DataBind(); _structureCombo.Items.Insert(0, new ListItem(Constant.NotSpecifiedDescription, Convert.ToString(Constant.NotSpecifiedValue))); // Glasses dataTable = simpleData.FetchSP("GetGlasses", null); _glassCombo.DataSource = dataTable; _glassCombo.DataBind(); // Temp dataTable = simpleData.FetchSP("GetListItems", new SqlParameter[] { new SqlParameter("ListID", Convert.ToInt32(Constant.List.Temperature)) }); _tempCombo.DataSource = dataTable; _tempCombo.DataBind(); // Private Source dataTable = simpleData.FetchSP("GetListItems", new SqlParameter[] { new SqlParameter("ListID", Convert.ToInt32(Constant.List.PrivateSource)) }); _privateSourceCombo.DataSource = dataTable; _privateSourceCombo.DataBind(); // Set control states ############################################################################ if (Page.IsPostBack) {// In postback // Grab dropdown values from form object (so we don't need to use viewstate) _categoryCombo.SelectedValue = Request.Form[_categoryCombo.UniqueID]; _familyCombo.SelectedValue = Request.Form[_familyCombo.UniqueID]; _structureCombo.SelectedValue = Request.Form[_structureCombo.UniqueID]; _glassCombo.SelectedValue = Request.Form[_glassCombo.UniqueID]; _tempCombo.SelectedValue = Request.Form[_tempCombo.UniqueID]; _privateSourceCombo.SelectedValue = Request.Form[_privateSourceCombo.UniqueID]; _instructionsText.Text = Request.Form[_instructionsText.UniqueID]; _notesText.Text = Request.Form[_notesText.UniqueID]; } else {// Not in postback if (_pageMode == Constant.PageMode.Edit) {// Edit // Name _nameText.Text = (string)_drDrink["Name"]; // Private _privateCheck.Checked = (bool)_drDrink["Private"]; // Servings _servingsNumber.Value = (decimal)_drDrink["Servings"]; // Dilution ratio _dilutionRatioNumber.Value = (decimal)_drDrink["DilutionRatio"]; // Instructions _instructionsText.Text = (string)_drDrink["Instructions"]; // Notes _notesText.Text = (string)_drDrink["Notes"]; if (_drDrink["CategoryID"] == DBNull.Value) _categoryCombo.SelectedIndex = 0; else _categoryCombo.SelectedValue = Convert.ToString(_drDrink["CategoryID"]); if (_drDrink["FamilyID"] == DBNull.Value) _familyCombo.SelectedIndex = 0; else _familyCombo.SelectedValue = Convert.ToString(_drDrink["FamilyID"]); if (_drDrink["StructureID"] == DBNull.Value) _structureCombo.SelectedIndex = 0; else _structureCombo.SelectedValue = Convert.ToString(_drDrink["StructureID"]); foreach (ListItem li in _attributeList.Items) { foundRow = _dtDrinkAttributes.Rows.Find(li.Value); if (foundRow != null) li.Selected = true; } foreach (ListItem li in _flavorList.Items) { foundRow = _dtDrinkFlavors.Rows.Find(li.Value); if (foundRow != null) li.Selected = true; } if (_drDrink["GlassID"] == DBNull.Value) _glassCombo.SelectedIndex = 0; else _glassCombo.SelectedValue = Convert.ToString(_drDrink["GlassID"]); if (_drDrink["TempID"] == DBNull.Value) _tempCombo.SelectedIndex = 0; else _tempCombo.SelectedValue = Convert.ToString(_drDrink["TempID"]); if (_drDrink["PrivateSourceID"] == DBNull.Value) _privateSourceCombo.SelectedIndex = 0; else _privateSourceCombo.SelectedValue = Convert.ToString(_drDrink["PrivateSourceID"]); // Ingredient grid _dtDrinkIngredient = simpleData.FetchSP("GetDrinkIngredients2", new SqlParameter[] { new SqlParameter("DrinkID", Request.QueryString["pk"]) }); _ingredientGrid.DataSource = _dtDrinkIngredient; _ingredientGrid.DataBind(); // DrinkSource grid _dtDrinkSource = simpleData.FetchSP("GetSourcesForDrink", new SqlParameter[] { new SqlParameter("DrinkID", Request.QueryString["pk"]) }); _drinkSourceGrid.DataSource = _dtDrinkSource; _drinkSourceGrid.DataBind(); // DrinkIngredient grid _dtDrinkIngredient2 = simpleData.FetchSP("GetLinkedIngredientsForDrink", new SqlParameter[] { new SqlParameter("DrinkID", Request.QueryString["pk"]) }); _drinkIngredientGrid.DataSource = _dtDrinkIngredient2; _drinkIngredientGrid.DataBind(); // DrinkDrink grid _dtDrinkDrink = simpleData.FetchSP("GetLinkedDrinksForDrink", new SqlParameter[] { new SqlParameter("DrinkID", Request.QueryString["pk"]) }); _drinkDrinkGrid.DataSource = _dtDrinkDrink; _drinkDrinkGrid.DataBind(); // DrinkArticle grid _dtDrinkArticle = simpleData.FetchSP("GetLinkedArticlesForDrink", new SqlParameter[] { new SqlParameter("DrinkID", Request.QueryString["pk"]) }); _drinkArticleGrid.DataSource = _dtDrinkArticle; _drinkArticleGrid.DataBind(); } else {// Add _servingsNumber.Value = 1; _dilutionRatioNumber.Value = .85; _glassCombo.SelectedValue = "20"; _tempCombo.SelectedValue = "88"; _privateSourceCombo.SelectedValue = "140"; } } // Set up ingredient grid ####################################################################### _ingredientGrid.DisplayLayout.AllowAddNewDefault = AllowAddNew.Yes; _ingredientGrid.DisplayLayout.AllowUpdateDefault = AllowUpdate.Yes; _ingredientGrid.DisplayLayout.AllowDeleteDefault = AllowDelete.Yes; _ingredientGrid.DisplayLayout.CellClickActionDefault = CellClickAction.Edit; _ingredientGrid.DisplayLayout.AddNewBox.Hidden = false; _ingredientGrid.Bands[0].AddButtonCaption = "Add New Ingredient"; _ingredientGrid.DisplayLayout.RowSelectorsDefault = RowSelectors.Yes; //_ingredientGrid.DisplayLayout.ClientSideEvents.InitializeRowHandler = "InitializeRow"; if (_pageMode == Constant.PageMode.Add) {// Add mode--need to build columns _ingredientGrid.Bands[0].Columns.Add("DrinkID", "DrinkID"); _ingredientGrid.Bands[0].Columns.Add("Sort", "Sort"); _ingredientGrid.Bands[0].Columns.Add("Prefix", "Prefix"); _ingredientGrid.Bands[0].Columns.Add("Amount", "Amount"); _ingredientGrid.Bands[0].Columns.Add("UnitID", "UnitID"); _ingredientGrid.Bands[0].Columns.Add("IngredientID", "IngredientID"); _ingredientGrid.Bands[0].Columns.Add("Suffix", "Suffix"); _ingredientGrid.Bands[0].Columns.Add("Principal", "Principal"); } _ingredientGrid.Bands[0].Columns.FromKey("DrinkID").Hidden = true; _ingredientGrid.Bands[0].Columns.FromKey("Sort").Width = Unit.Percentage(6); _ingredientGrid.Bands[0].Columns.FromKey("Prefix").Width = Unit.Percentage(13); _ingredientGrid.Bands[0].Columns.FromKey("Amount").Width = Unit.Percentage(10); _ingredientGrid.Bands[0].Columns.FromKey("UnitID").Type = ColumnType.DropDownList; _ingredientGrid.Bands[0].Columns.FromKey("UnitID").Width = Unit.Percentage(13); _ingredientGrid.Bands[0].Columns.FromKey("IngredientID").Type = ColumnType.DropDownList; _ingredientGrid.Bands[0].Columns.FromKey("IngredientID").Width = Unit.Percentage(35); _ingredientGrid.Bands[0].Columns.FromKey("Suffix").Width = Unit.Percentage(13); _ingredientGrid.Bands[0].Columns.FromKey("Principal").Width = Unit.Percentage(10); // Ingredient valuelist _vlIngredient = new ValueList(); _dtIngredient = simpleData.FetchSP("GetIngredients", null); _vlIngredient.DataSource = _dtIngredient; _vlIngredient.DisplayMember = "Name"; _vlIngredient.ValueMember = "Ingredient_pk"; _vlIngredient.DataBind(); _vlIngredient.DisplayStyle = ValueListDisplayStyle.DisplayText; _ingredientGrid.Bands[0].Columns.FromKey("IngredientID").ValueList = _vlIngredient; // Unit valuelist _vlUnit = new ValueList(); _dtUnit = simpleData.FetchSP("GetUnits", null); _vlUnit.DataSource = _dtUnit; _vlUnit.DisplayMember = "Name"; _vlUnit.ValueMember = "Unit_pk"; _vlUnit.DataBind(); _vlUnit.DisplayStyle = ValueListDisplayStyle.DisplayText; _ingredientGrid.Bands[0].Columns.FromKey("UnitID").ValueList = _vlUnit; // Set up DrinkSource grid ####################################################################### _drinkSourceGrid.DisplayLayout.AllowAddNewDefault = AllowAddNew.Yes; _drinkSourceGrid.DisplayLayout.AllowDeleteDefault = AllowDelete.Yes; _drinkSourceGrid.DisplayLayout.CellClickActionDefault = CellClickAction.Edit; _drinkSourceGrid.DisplayLayout.AddNewBox.Hidden = false; _drinkSourceGrid.Bands[0].AddButtonCaption = "Add New Source"; _drinkSourceGrid.DisplayLayout.RowSelectorsDefault = RowSelectors.Yes; if (_pageMode == Constant.PageMode.Add) {// Add mode--need to build columns _drinkSourceGrid.Bands[0].Columns.Add("DrinkID", "DrinkID"); _drinkSourceGrid.Bands[0].Columns.Add("SourceID", "SourceID"); } _drinkSourceGrid.Bands[0].Columns.FromKey("DrinkID").Hidden = true; _drinkSourceGrid.Bands[0].Columns.FromKey("SourceID").Width = Unit.Percentage(100); _drinkSourceGrid.Bands[0].Columns.FromKey("SourceID").Type = ColumnType.DropDownList; _drinkSourceGrid.Bands[0].Columns.FromKey("SourceID").DefaultValue = DBNull.Value; // Source valuelist _vlSource = new ValueList(); _dtSource = simpleData.FetchSP("GetSources", null); _vlSource.DataSource = _dtSource; _vlSource.DisplayMember = "Name"; _vlSource.ValueMember = "Source_pk"; _vlSource.DataBind(); _vlSource.DisplayStyle = ValueListDisplayStyle.DisplayText; _drinkSourceGrid.Bands[0].Columns.FromKey("SourceID").ValueList = _vlSource; // Set up DrinkIngredient grid ####################################################################### _drinkIngredientGrid.DisplayLayout.AllowAddNewDefault = AllowAddNew.Yes; _drinkIngredientGrid.DisplayLayout.AllowDeleteDefault = AllowDelete.Yes; _drinkIngredientGrid.DisplayLayout.CellClickActionDefault = CellClickAction.Edit; _drinkIngredientGrid.DisplayLayout.AddNewBox.Hidden = false; _drinkIngredientGrid.Bands[0].AddButtonCaption = "Add New Ingredient Link"; _drinkIngredientGrid.DisplayLayout.RowSelectorsDefault = RowSelectors.Yes; if (_pageMode == Constant.PageMode.Add) {// Add mode--need to build columns _drinkIngredientGrid.Bands[0].Columns.Add("DrinkID", "DrinkID"); _drinkIngredientGrid.Bands[0].Columns.Add("IngredientID", "IngredientID"); } _drinkIngredientGrid.Bands[0].Columns.FromKey("DrinkID").Hidden = true; _drinkIngredientGrid.Bands[0].Columns.FromKey("IngredientID").Width = Unit.Percentage(100); _drinkIngredientGrid.Bands[0].Columns.FromKey("IngredientID").Type = ColumnType.DropDownList; _drinkIngredientGrid.Bands[0].Columns.FromKey("IngredientID").DefaultValue = DBNull.Value; // Ingredient valuelist //_vlIngredient = new ValueList(); //_dtIngredient = simpleData.FetchSP("GetIngredients", null); //_vlIngredient.DataSource = _dtIngredient; //_vlIngredient.DisplayMember = "Name"; //_vlIngredient.ValueMember = "Ingredient_pk"; //_vlIngredient.DataBind(); //_vlIngredient.DisplayStyle = ValueListDisplayStyle.DisplayText; _drinkIngredientGrid.Bands[0].Columns.FromKey("IngredientID").ValueList = _vlIngredient; // Set up DrinkDrink grid ####################################################################### _drinkDrinkGrid.DisplayLayout.AllowAddNewDefault = AllowAddNew.Yes; _drinkDrinkGrid.DisplayLayout.AllowDeleteDefault = AllowDelete.Yes; _drinkDrinkGrid.DisplayLayout.CellClickActionDefault = CellClickAction.Edit; _drinkDrinkGrid.DisplayLayout.AddNewBox.Hidden = false; _drinkDrinkGrid.Bands[0].AddButtonCaption = "Add New Drink Link"; _drinkDrinkGrid.DisplayLayout.RowSelectorsDefault = RowSelectors.Yes; if (_pageMode == Constant.PageMode.Add) {// Add mode--need to build columns _drinkDrinkGrid.Bands[0].Columns.Add("DrinkID1", "DrinkID1"); _drinkDrinkGrid.Bands[0].Columns.Add("DrinkID2", "DrinkID2"); } _drinkDrinkGrid.Bands[0].Columns.FromKey("DrinkID1").Hidden = true; _drinkDrinkGrid.Bands[0].Columns.FromKey("DrinkID2").Width = Unit.Percentage(100); _drinkDrinkGrid.Bands[0].Columns.FromKey("DrinkID2").Type = ColumnType.DropDownList; _drinkDrinkGrid.Bands[0].Columns.FromKey("DrinkID2").DefaultValue = DBNull.Value; // Drink valuelist _vlDrink = new ValueList(); _dtDrink = simpleData.FetchSP("GetDrinks", null); _vlDrink.DataSource = _dtDrink; _vlDrink.DisplayMember = "Name"; _vlDrink.ValueMember = "Drink_pk"; _vlDrink.DataBind(); _vlDrink.DisplayStyle = ValueListDisplayStyle.DisplayText; _drinkDrinkGrid.Bands[0].Columns.FromKey("DrinkID2").ValueList = _vlDrink; // Set up DrinkArticle grid ####################################################################### _drinkArticleGrid.DisplayLayout.AllowAddNewDefault = AllowAddNew.Yes; _drinkArticleGrid.DisplayLayout.AllowDeleteDefault = AllowDelete.Yes; _drinkArticleGrid.DisplayLayout.CellClickActionDefault = CellClickAction.Edit; _drinkArticleGrid.DisplayLayout.AddNewBox.Hidden = false; _drinkArticleGrid.Bands[0].AddButtonCaption = "Add New Article Link"; _drinkArticleGrid.DisplayLayout.RowSelectorsDefault = RowSelectors.Yes; if (_pageMode == Constant.PageMode.Add) {// Add mode--need to build columns _drinkArticleGrid.Bands[0].Columns.Add("DrinkID", "DrinkID"); _drinkArticleGrid.Bands[0].Columns.Add("ArticleID", "ArticleID"); } _drinkArticleGrid.Bands[0].Columns.FromKey("DrinkID").Hidden = true; _drinkArticleGrid.Bands[0].Columns.FromKey("ArticleID").Width = Unit.Percentage(100); _drinkArticleGrid.Bands[0].Columns.FromKey("ArticleID").Type = ColumnType.DropDownList; _drinkArticleGrid.Bands[0].Columns.FromKey("ArticleID").DefaultValue = DBNull.Value; // Article valuelist _vlArticle = new ValueList(); _dtArticle = simpleData.FetchSP("GetArticles", null); _vlArticle.DataSource = _dtArticle; _vlArticle.DisplayMember = "Title"; _vlArticle.ValueMember = "Article_pk"; _vlArticle.DataBind(); _vlArticle.DisplayStyle = ValueListDisplayStyle.DisplayText; _drinkArticleGrid.Bands[0].Columns.FromKey("ArticleID").ValueList = _vlArticle; }
public IProxyPredicate GetProxyExecutionPredicate(IIndexProvider indexManager, IQueryStore queryStore, IEnumerable <long> rowsEnumerator) { //Get reducable terminal expressions in the ORExpression... List <ComparisonPredicate> terminalPreds = new List <ComparisonPredicate>(); foreach (var predciate in _predciates) { ComparisonPredicate comparePred = predciate as ComparisonPredicate; if (comparePred != null && comparePred.PredicateType.Equals(PredicateType.SingleVariable)) { terminalPreds.Add(comparePred); } } IEnumerable <Attribute> repAttributes = new List <Attribute>(); List <ITreePredicate> compPreds = new List <ITreePredicate>(); foreach (var predciate in _predciates) { if (predciate is ComparisonPredicate) { compPreds.Add(predciate); } } if (terminalPreds.Count > 0 && compPreds.Count > 0) { repAttributes = PredicateHelper.GetRepeatedAttributes(compPreds); } foreach (var attribute in repAttributes) { Dictionary <int, ComparisonPredicate> reducablePreds = new Dictionary <int, ComparisonPredicate>(); for (int i = 0; i < _predciates.Count; i++) { if (_predciates[i] is ComparisonPredicate) { ComparisonPredicate comparePred = _predciates[i] as ComparisonPredicate; if (ReducablePredicate(comparePred) && comparePred.Attributes[0] == attribute) { reducablePreds.Add(i, comparePred); } } } if (reducablePreds.Count < 2) { continue; } ValueList values = new ValueList(); foreach (var pair in reducablePreds) { values.Add(PredicateHelper.GetConstant(pair.Value.ConstantValues[0])); } ComparisonPredicate reducedPred = new ComparisonPredicate(attribute, Condition.In, values); for (int i = 0; i < _predciates.Count; i++) { if (reducablePreds.Keys.Contains(i)) { _predciates.RemoveAt(i); } } _predciates.Add(reducedPred); } var predicate = new ProxyOrPredicate(); foreach (var predciate in _predciates) { predicate.AddExpression(predciate); predicate.AddChildPredicate(predciate.GetProxyExecutionPredicate(indexManager, queryStore, rowsEnumerator)); } return(predicate); }
public ControlImportExportPolicyVulnerabilities() { InitializeComponent(); // Hide all radio buttons for single selection group box radioButton1.Visible = false; radioButton2.Visible = false; radioButton3.Visible = false; radioButton4.Visible = false; radioButton5.Visible = false; radioButton6.Visible = false; radioButton7.Visible = false; radioButton8.Visible = false; // Hide single selectin group box groupBox_TriggerSingle.Visible = false; // Hide all checkboxes for multiple selection group box checkBox1.Visible = false; checkBox2.Visible = false; checkBox3.Visible = false; checkBox4.Visible = false; checkBox5.Visible = false; checkBox6.Visible = false; checkBox7.Visible = false; checkBox8.Visible = false; // Hide multiple selection group box groupBox_CriteriaMultiple.Visible = false; // Hide User Entered Multiple Selection group box groupBox_CriteriaUserEnterMultiple.Visible = false; // Hide User Entered Single Selection group box groupBox_CriteriaUserEnterSingle.Visible = false; // Hide Enabled Disabled Only group box groupBox_TriggerDisabledEnabledOnly.Visible = false; radioButton_SeverityCritical.Text = Utility.DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.High); radioButton_SeverityMedium.Text = Utility.DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Medium); radioButton_SeverityLow.Text = Utility.DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Low); _toolStripButton_ColumnChooser.Image = AppIcons.AppImage16(AppIcons.Enum.GridFieldChooser); _toolStripButton_GroupBy.Image = AppIcons.AppImage16(AppIcons.Enum.GridGroupBy); _toolStripButton_Save.Image = AppIcons.AppImage16(AppIcons.Enum.GridSaveToExcel); _toolStripButton_Print.Image = AppIcons.AppImage16(AppIcons.Enum.Print); // load value lists for grid display ValueListItem listItem; ValueList severityValueList = new ValueList(); severityValueList.Key = valueListSeverity; severityValueList.DisplayStyle = ValueListDisplayStyle.DisplayText; ultraGridPolicyMetrics.DisplayLayout.ValueLists.Add(severityValueList); severityValueList.ValueListItems.Clear(); listItem = new ValueListItem(Utility.Policy.Severity.Ok, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Ok)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.check_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.Low, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Low)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.LowRisk_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.Medium, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Medium)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.MediumRisk_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.High, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.High)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.HighRisk_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.Undetermined, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Undetermined)); listItem.Appearance.Image = AppIcons.AppImage16(AppIcons.Enum.Unknown); listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); ValueList enabledValueList = new ValueList(); enabledValueList.Key = valueListEnabled; enabledValueList.DisplayStyle = ValueListDisplayStyle.DisplayText; ultraGridPolicyMetrics.DisplayLayout.ValueLists.Add(enabledValueList); listItem = new ValueListItem(true, "Yes"); enabledValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(false, "No"); enabledValueList.ValueListItems.Add(listItem); }
private void prcCreateButton(RibbonTab rt, RibbonGroup rtg, string strContainerFlag) { try { foreach (DataRow dr in dsMaster.Tables["Menu"].Rows) { if (Int16.Parse(dr["isFormBased"].ToString()) != 0) { ButtonTool btn = new ButtonTool(dr["menuId"].ToString()); btn.SharedProps.Caption = dr["menuCaption"].ToString(); //Picture does not Exist for menu if (Int16.Parse(dr["menuImageExist"].ToString()) == 0) { this.toolMan.Tools.Add(btn); rtg.Tools.AddTool(dr["menuId"].ToString()); } else { alMenuImage.Add(dr["menuId"].ToString()); //Picture Exist for menu prcFillImageList(dr["menuImageName"].ToString(), Int16.Parse(dr["menuImageSize"].ToString())); Common.Classes.clsMain.alMnuFrmName.Add(dr["frmName"].ToString()); if (Int16.Parse(dr["menuImageSize"].ToString()) != 2) { //Small Image btn.SharedProps.AppearancesSmall.Appearance.Image = alMenuImage.Count - 1;//Common.Classes.clsMain.alMnuFrmName.Count - 1; } else { //Large Image btn.SharedProps.AppearancesLarge.Appearance.Image = alMenuImage.Count - 1; } btn.SharedProps.DisplayStyle = ToolDisplayStyle.ImageAndText; this.toolMan.Tools.Add(btn); //Set Large Image ToolBase tb = rtg.Tools.AddTool(dr["MenuId"].ToString()); tb.CustomizedCaption = dr["menuCaption"].ToString(); if (Int16.Parse(dr["menuImageSize"].ToString()) == 2) { tb.InstanceProps.PreferredSizeOnRibbon = RibbonToolSize.Large; } } } if (strContainerFlag == "Combo") { //Crate Combobox tool ComboBoxTool cbo = new ComboBoxTool("cbo" + dr["menuName"].ToString()); //Create ValueList For Loading Combo Data ValueList valueList1 = new ValueList(0); valueList1.DisplayStyle = Infragistics.Win.ValueListDisplayStyle.DisplayText; valueList1.PreferredDropDownSize = new System.Drawing.Size(0, 0); string strDefault = ""; foreach (DataRow dr3 in dsMaster.Tables["Company"].Rows) { if (Int16.Parse(dr3["isDefault"].ToString()) != 0) { strDefault = dr3["comId"].ToString(); } ValueListItem v1 = new ValueListItem(); v1.DataValue = dr3["comId"].ToString(); v1.DisplayText = dr3["comName"].ToString(); valueList1.ValueListItems.Add(v1); } cbo.ValueList = valueList1; this.toolMan.Tools.AddRange(new ToolBase[] { cbo }); ToolBase tbCompany = rtg.Tools.AddTool(cbo.Key); //Set Default Value if (strDefault.Length > 0) { ((ComboBoxTool)toolMan.Tools[cbo.Key]).Value = Int16.Parse(strDefault); } } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Creating Button"); } }
internal ItemsEnumerator(ValueList <T> list) { _list = list; _index = -1; }
private ValueList GetValuelistWeightType() { ValueList vlist = new ValueList(); try { vlist.ValueListItems.Add("0", "����"); vlist.ValueListItems.Add("1", "ʵ��"); vlist.ValueListItems.Add("2", "ʵ�أ�����"); vlist.ValueListItems.Add("", ""); } catch { } return vlist; }
public PolicyUsers() { InitializeComponent(); // Initialize base class fields. m_menuConfiguration = new Utility.MenuConfiguration(); _ultraTabControl_Users.ImageList = AppIcons.AppImageList16(); // hook the toolbar labels to the grids so the heading can be used for printing _grid_Users.Tag = _label_Users; // hook the grids to the toolbars so they can be used for button processing _headerStrip_Users.Tag = _grid_Users; // Hookup all application images _toolStripButton_ColumnChooser.Image = AppIcons.AppImage16(AppIcons.Enum.GridFieldChooser); _toolStripButton_GroupBy.Image = AppIcons.AppImage16(AppIcons.Enum.GridGroupBy); _toolStripButton_Save.Image = AppIcons.AppImage16(AppIcons.Enum.GridSaveToExcel); _toolStripButton_Print.Image = AppIcons.AppImage16(AppIcons.Enum.Print); // set all grids to start in the same initial display mode _grid_Users.DisplayLayout.GroupByBox.Hidden = Utility.Constants.InitialState_GroupByBoxHidden; // load value lists for grid display ValueList severityValueList = new ValueList(); severityValueList.Key = ValueListYesNo; severityValueList.DisplayStyle = ValueListDisplayStyle.DisplayText; _grid_Users.DisplayLayout.ValueLists.Add(severityValueList); ValueListItem listItem; severityValueList.ValueListItems.Clear(); listItem = new ValueListItem("Y", "Yes"); severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem("N", "No"); severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(string.Empty, "N/A"); severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(" ", "N/A"); severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(null, "N/A"); severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(DBNull.Value, "N/A"); severityValueList.ValueListItems.Add(listItem); // Initialize the tabs _ultraTabControl_Users.SuspendLayout(); _ultraTabControl_Users.Tabs.Clear(); //Start-SQLsecure 3.1 (Tushar)--Adding support for Azure SQL Database. string[] userTypes; if (m_serverInstance != null && m_serverInstance.ServerType == ServerType.AzureSQLDatabase) { userTypes = new string[] { tabKey_AzureSQLDatabase, tabKey_Sql, tabKey_All }; } else if (m_serverInstance != null && m_serverInstance.ServerType != ServerType.AzureSQLDatabase) { userTypes = new string[] { tabKey_Windows, tabKey_Sql, tabKey_All }; } else { userTypes = new string[] { tabKey_Windows, tabKey_AzureSQLDatabase, tabKey_Sql, tabKey_All }; } foreach (string usertype in userTypes) { _ultraTabControl_Users.Tabs.Add(usertype, usertype); } //End-SQLsecure 3.1 (Tushar)--Adding support for Azure SQL Database. _ultraTabControl_Users.ResumeLayout(); // Initialize the grids initDataSource(); // Hide the focus rectangles on tabs and grids _ultraTabControl_Users.DrawFilter = new HideFocusRectangleDrawFilter(); _grid_Users.DrawFilter = new HideFocusRectangleDrawFilter(); }
public Form_WizardCreatePolicy() { InitializeComponent(); // Set the intro text in the wizard. _rtb_Introduction.Rtf = WizardIntroText; // Select the intro page. _wizard.SelectedPage = _page_Introduction; m_policy = new Policy(); m_policy.IsDynamic = true; m_policy.DynamicSelection = string.Empty; radioButtonCreateNew.Checked = true; // load value lists for listview display ValueList radioButtonValueList = new ValueList(); radioButtonValueList.Key = "RadioButton"; radioButtonValueList.DisplayStyle = ValueListDisplayStyle.Picture; ValueListItem listItem; radioButtonValueList.ValueListItems.Clear(); listItem = new ValueListItem(CheckState.Checked); listItem.DisplayText = "Checked"; listItem.Appearance.Image = AppIcons.AppImage16(AppIcons.Enum.RadioButtonChecked); radioButtonValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(CheckState.Unchecked); listItem.DisplayText = "UnChecked"; listItem.Appearance.Image = AppIcons.AppImage16(AppIcons.Enum.RadioButtonUnChecked); radioButtonValueList.ValueListItems.Add(listItem); _ultraListViewStandardPolicies.SubItemColumns["CheckState"].ValueList = radioButtonValueList; // Load builtin standard Policies string path = System.IO.Path.GetDirectoryName(Application.ExecutablePath); path = path.Substring(0, path.LastIndexOf(Path.DirectorySeparatorChar)); string policyPath = path + @"\" + Utility.Constants.Policy_Install_Folder; if (Directory.Exists(policyPath)) { string[] files = Directory.GetFiles(policyPath); foreach (string f in files) { Policy p = new Policy(); p.ImportPolicyFromXMLFile(f, false); UltraListViewItem li = _ultraListViewStandardPolicies.Items.Add(p.PolicyName, p.PolicyName); li.Tag = f; li.SubItems["CheckState"].Value = CheckState.Unchecked; li.SubItems["Count"].Value = p.MetricCount; //save the policy for displaying the description m_Templates.Add(f, p); } if (_ultraListViewStandardPolicies.Items.Count > 0) { _ultraListViewStandardPolicies.Items[0].SubItems["CheckState"].Value = CheckState.Checked; } _ultraListViewStandardPolicies.Enabled = false; } setTemplateDescription(); }
public static bool TryCreateValue(string typeString, string valueString, out Value value) { value = null; var isNull = valueString.Equals("NULL") || valueString.Equals("null") || valueString.Equals(""); switch (typeString) { case "integer": if (isNull) { value = new ValueInt(null); return(true); } if (!long.TryParse(valueString, out var intResult)) { return(false); } value = new ValueInt(intResult); return(true); case "string": if (isNull) { value = new ValueString(null); return(true); } value = new ValueString(valueString.Trim('\"')); return(true); case "time": if (isNull) { value = new ValueTime(null as RefStruct <long>); return(true); } value = new ValueTime(valueString); return(true); case "double": if (isNull) { value = new ValueDouble(null); return(true); } if (!double.TryParse(valueString, NumberStyles.Any, CultureInfo.InvariantCulture, out var doubleResult)) { return(false); } value = new ValueDouble(doubleResult); return(true); case "boolean": if (isNull) { value = new ValueBoolean(null); return(true); } if (!bool.TryParse(valueString, out var booleanResult)) { return(false); } value = new ValueBoolean(booleanResult); return(true); case "duration": if (isNull) { value = new ValueDuration(null as RefStruct <long>); return(true); } value = new ValueDuration(valueString); return(true); case "contact": if (isNull) { value = new ValueContact(null, null); return(true); } var split = valueString.Split(' '); if (split.Length != 2 && split.Length != 3) { return(false); } if (!IPAddress.TryParse(split[1], out var address)) { return(false); } var port = 555; if (split.Length == 3 && !int.TryParse(split[2], out port)) { return(false); } if (!split[0].StartsWith("/")) { split[0] = '/' + split[0]; } value = new ValueContact(new PathName(split[0]), address, port); return(true); } var splitByOf = typeString.Split(" of ", 2); if (splitByOf.Length != 2) { return(false); } var splitBySpace = splitByOf[1].Split(' ', 2); if (splitBySpace.Length != 2) { return(false); } if (!int.TryParse(splitBySpace[0], out var count)) { return(false); } // based on StackOverflow answer: https://stackoverflow.com/a/3147901 var collectionStrings = Regex.Split(valueString.Trim('{', '}', '[', ']'), ",(?=(?:[^']*'[^']*')*[^']*$)") .Select(s => s.Trim(' ')).ToList(); if (collectionStrings.Count != count) { if (count != 0 && (collectionStrings.Count != 1 || !string.IsNullOrEmpty(collectionStrings[0]))) { return(false); } collectionStrings = new List <string>(count); } var elements = new List <Value>(count); var elementTypeString = splitBySpace[1]; foreach (var element in collectionStrings) { if (!TryCreateValue(elementTypeString, element, out var elementVal)) { return(false); } elements.Add(elementVal); } if (!TryGetPrimitiveAttributeType(elementTypeString, out var elementType)) { return(false); } switch (splitByOf[0]) { case "set": value = new ValueSet(elements.ToHashSet(), elementType); return(true); case "list": value = new ValueList(elements, elementType); return(true); } return(false); }
public static string mysql_field_flags(PhpResource resultHandle, int fieldIndex) { var result = MySqlResultResource.ValidResult(resultHandle); if (result == null || !result.CheckFieldIndex(fieldIndex)) { return(null); } var col = result.GetColumnSchema(fieldIndex); //ColumnFlags flags = result.GetFieldFlags(fieldIndex); var flags = new ValueList <string>(); if (col.AllowDBNull.GetValueOrDefault() == false) { flags.Add("not_null"); } if (col.IsKey.GetValueOrDefault()) { flags.Add("primary_key"); } if (col.IsUnique.GetValueOrDefault()) { flags.Add("unique_key"); } //if ((flags & ColumnFlags.MULTIPLE_KEY) != 0) // flags.Add("multiple_key"); if (col.IsBlob()) { flags.Add("blob"); } if (col.IsUnsigned()) { flags.Add("unsigned"); } //if ((flags & ColumnFlags.ZERO_FILL) != 0) // flags.Add("zerofill"); if (col.ProviderType == MySqlDbType.Binary || col.ProviderType == MySqlDbType.VarBinary) { flags.Add("binary"); } if (col.ProviderType == MySqlDbType.Enum) { flags.Add("enum"); } if (col.ProviderType == MySqlDbType.Set) { flags.Add("set"); } if (col.IsAutoIncrement.GetValueOrDefault()) { flags.Add("auto_increment"); } if (col.ProviderType == MySqlDbType.Timestamp) { flags.Add("timestamp"); } // return(flags.Join(" ")); }
/// <summary> /// Using the static method <see cref="ValueList{T}.QuickRead"/> falls back /// to the default properties for colors, bullet, spaces, etc. /// </summary> private static IEnumerable <string> ReadBeveragesQuick() { return(ValueList <string> .QuickRead("What are your prefered beverages?")); }
public bool Add(Ext.Net.Component wrapperComponent, string tableName, string[] parameters, string [] values) { try { string sql = "insert into " + tableName + "({0}) values({1})"; for (int i = 0; i < parameters.Count(); i++) { if (!string.IsNullOrEmpty(parameters[i])) { ColumnName += "[" + parameters[i] + "],"; ValueList += "N'" + values[i] + "',"; UpdateQuery += "[" + parameters[i] + "] = N'" + values[i] + "',"; } } GetChildControl(wrapperComponent); // sql = string.Format(sql, ColumnName.Remove(ColumnName.LastIndexOf(",")), ValueList.Remove(ValueList.LastIndexOf(","))); return(DataController.DataHandler.GetInstance().ExecuteNonQuery(string.Format(sql, ColumnName.Remove(ColumnName.LastIndexOf(",")), ValueList.Remove(ValueList.LastIndexOf(",")))) > 0); } catch (Exception ex) { throw ex; } }
/// <summary> /// Tiến hành insert một bản ghi vào CSDL /// </summary> /// <param name="wrapperComponent">container chứa các control</param> /// <param name="tableName">Tên bảng muốn insert</param> /// <returns></returns> /// public bool Add(Ext.Net.Component wrapperComponent, string tableName) { try { string sql = "insert into " + tableName + "({0}) values({1})"; GetChildControl(wrapperComponent); // sql = string.Format(sql, ColumnName.Remove(ColumnName.LastIndexOf(",")), ValueList.Remove(ValueList.LastIndexOf(","))); return(DataController.DataHandler.GetInstance().ExecuteNonQuery(string.Format(sql, ColumnName.Remove(ColumnName.LastIndexOf(",")), ValueList.Remove(ValueList.LastIndexOf(",")))) > 0); } catch (Exception ex) { throw ex; } }
void ISimpleDoubleStepTemplate.Initialize() => values = ValueList.Split(separators, StringSplitOptions.RemoveEmptyEntries).Select(double.Parse).ToArray();
internal controlConfigureMetricCriteria(ConfigurePolicyControlType controlType) { // SQLsecure 3.1 (Anshul Aggarwal) - Represents current state of control - 'Configure Security Check' or 'Export/Import Policy'. m_ControlType = controlType; InitializeComponent(); // Hide all radio buttons for single selection group box radioButton1.Visible = false; radioButton2.Visible = false; radioButton3.Visible = false; radioButton4.Visible = false; radioButton5.Visible = false; radioButton6.Visible = false; radioButton7.Visible = false; radioButton8.Visible = false; // Hide single selectin group box groupBox_TriggerSingle.Visible = groupBox_TriggerSingle.Enabled = false; // Hide all checkboxes for multiple selection group box checkBox1.Visible = false; checkBox2.Visible = false; checkBox3.Visible = false; checkBox4.Visible = false; checkBox5.Visible = false; checkBox6.Visible = false; checkBox7.Visible = false; checkBox8.Visible = false; // Hide multiple selection group box groupBox_CriteriaMultiple.Visible = groupBox_CriteriaMultiple.Enabled = false; // Hide User Entered Multiple Selection group box groupBox_CriteriaUserEnterMultiple.Visible = groupBox_CriteriaUserEnterMultiple.Enabled = false; // Hide User Entered Single Selection group box groupBox_CriteriaUserEnterSingle.Visible = groupBox_CriteriaUserEnterSingle.Enabled = false; // Hide Enabled Disabled Only group box groupBox_TriggerDisabledEnabledOnly.Visible = groupBox_TriggerDisabledEnabledOnly.Enabled = false; radioButton_SeverityCritical.Text = Utility.DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.High); radioButton_SeverityMedium.Text = Utility.DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Medium); radioButton_SeverityLow.Text = Utility.DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Low); // load value lists for grid display ValueListItem listItem; ValueList severityValueList = new ValueList(); severityValueList.Key = valueListSeverity; severityValueList.DisplayStyle = ValueListDisplayStyle.DisplayText; severityValueList.ValueListItems.Clear(); listItem = new ValueListItem(Utility.Policy.Severity.Ok, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Ok)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.check_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.Low, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Low)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.LowRisk_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.Medium, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Medium)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.MediumRisk_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.High, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.High)); listItem.Appearance.Image = global::Idera.SQLsecure.UI.Console.Properties.Resources.HighRisk_16; listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(Utility.Policy.Severity.Undetermined, DescriptionHelper.GetEnumDescription(Utility.Policy.Severity.Undetermined)); listItem.Appearance.Image = AppIcons.AppImage16(AppIcons.Enum.Unknown); listItem.Appearance.ImageVAlign = VAlign.Top; severityValueList.ValueListItems.Add(listItem); ValueList enabledValueList = new ValueList(); enabledValueList.Key = valueListEnabled; enabledValueList.DisplayStyle = ValueListDisplayStyle.DisplayText; listItem = new ValueListItem(true, "Yes"); enabledValueList.ValueListItems.Add(listItem); listItem = new ValueListItem(false, "No"); enabledValueList.ValueListItems.Add(listItem); // SQLsecure 3.1 (Anshul Aggarwal) - Change control state based on current control usage type. RefreshState(); }
public void Add(KeyValuePair <string, float> data) { ValueList.Add(data); }
private void loadForms() { ulvForms.Reset(); ulvForms.Width = 410; ulvForms.Height = 381; ulvForms.View = UltraListViewStyle.Details; ulvForms.ItemSettings.Appearance.Image = imageList1.Images[0]; ulvForms.ViewSettingsDetails.SubItemColumnsVisibleByDefault = true; ulvForms.ViewSettingsDetails.AutoFitColumns = AutoFitColumns.ResizeAllColumns; ulvForms.ItemSettings.SubItemsVisibleInToolTipByDefault = false; ulvForms.ItemSettings.SelectionType = SelectionType.Single; UltraListViewMainColumn mainColumn = ulvForms.MainColumn; mainColumn.Text = "Form Name"; mainColumn.Width = 120; mainColumn.DataType = typeof(System.Int32); UltraListViewSubItemColumn cDocType = new UltraListViewSubItemColumn(); cDocType.Text = "Type"; cDocType.Width = 50; cDocType.VisibleInDetailsView = DefaultableBoolean.True; cDocType.DataType = typeof(String); UltraListViewSubItemColumn cLastPrinted = new UltraListViewSubItemColumn(); cLastPrinted.Text = "Last Printed"; cLastPrinted.Width = 100; cLastPrinted.VisibleInDetailsView = DefaultableBoolean.True; cLastPrinted.DataType = typeof(String); UltraListViewSubItemColumn cDataEntryTemplate = new UltraListViewSubItemColumn(); cDataEntryTemplate.Text = "Data Entry Template"; cDataEntryTemplate.Width = 150; cDataEntryTemplate.VisibleInDetailsView = DefaultableBoolean.True; cDataEntryTemplate.DataType = typeof(Int32); ulvForms.SubItemColumns.Add(cDocType); ulvForms.SubItemColumns.Add(cLastPrinted); ulvForms.SubItemColumns.Add(cDataEntryTemplate); ValueList docType = new ValueList(); ValueList lastPrinted = new ValueList(); ValueList dataEntryTemplate = new ValueList(); foreach (VWA4Common.DataObject.Formx f in FormDAO.DAO.GetAll()) { docType.ValueListItems.Add(f.DocumentType, f.DocumentType); lastPrinted.ValueListItems.Add(f.LastPrintedDate, f.LastPrintedDate); if (f.DataEntryTemplateId > 0) { dataEntryTemplate.ValueListItems.Add(f.DataEntryTemplateId, VWA4Common.DB.Retrieve(string.Format("select DETName from DataEntryTemplates where ID={0}", f.DataEntryTemplateId)).Rows[0]["DETName"].ToString()); } UltraListViewItem i = ulvForms.Items.Add(f.Id.ToString(), f.Name); i.SubItems[0].Value = f.DocumentType; i.SubItems[1].Value = f.LastPrintedDate; i.SubItems[2].Value = f.DataEntryTemplateId > 0 ? f.DataEntryTemplateId.ToString() : ""; } ulvForms.SubItemColumns[0].ValueList = docType; ulvForms.SubItemColumns[1].ValueList = lastPrinted; ulvForms.SubItemColumns[2].ValueList = dataEntryTemplate; this.pnlForms.Controls.Add(ulvForms); }
/// <summary> /// Public Interface Function to Set Content Keyword Information into a ValueList /// </summary> /// <param name="ckw">ValueList Object That Will Be Used in the ContentKeyword element of a Content Object</param> /// <returns>String Representing The Item for use elsewhere in processing</returns> public string SetContentKeywords(ValueList ckw) { ckw.ValueListURN = EDXLConstants.ContentKeywordListName; ckw.Value.Add("MEXL-TEP"); return("Emergency eXchange Language Tracking of Emergency Patients"); }
private void prcInitializeRibbon() { string strCaption = "Initializing Ribbon"; try { //Configure Ribbon this.toolMan.Ribbon.Visible = true; this.toolMan.DockWithinContainer = this; this.toolMan.DockWithinContainerBaseType = typeof(System.Windows.Forms.Form); //Setup Style Of Ribbon toolMan.Style = Infragistics.Win.UltraWinToolbars.ToolbarStyle.Office2010; toolMan.Ribbon.FileMenuStyle = Infragistics.Win.UltraWinToolbars.FileMenuStyle.ApplicationMenu2010; //ImageList this.toolMan.ImageListLarge = ilLarge; this.toolMan.ImageListSmall = ilSmall; // Create Basic Ribbon Tab foreach (DataRow dr in dsMaster.Tables["Module"].Rows) { strCaption = "Creating Tab"; RibbonTab rt = new RibbonTab(dr["moduleId"].ToString(), dr["moduleCaption"].ToString()); this.toolMan.Ribbon.Tabs.Add(rt); } //Creating Ribbon Group foreach (DataRow dr in dsMaster.Tables["Group"].Rows) { strCaption = "Creating Group"; RibbonGroup rg = new RibbonGroup(dr["mMenuGroupId"].ToString(), dr["mMenuGroupCaption"].ToString()); this.toolMan.Ribbon.Tabs[dr["moduleId"].ToString()].Groups.Add(rg); } #region Creating Button //Creating Button foreach (DataRow dr in dsMaster.Tables["Menu"].Rows) { strCaption = "Creating Button : " + dr["MenuCaption"].ToString(); #region Form Based Button if (Int16.Parse(dr["isFormBased"].ToString()) != 0) { ButtonTool btn = new ButtonTool(dr["menuId"].ToString()); btn.SharedProps.Caption = dr["menuCaption"].ToString(); if (Int16.Parse(dr["menuImageExist"].ToString()) == 0) { //Picture does not Exist for menu this.toolMan.Tools.Add(btn); this.toolMan.Ribbon.Tabs[dr["moduleId"].ToString()].Groups[dr["mMenuGroupId"].ToString()].Tools.Add(btn); } else { //Picture Exist for menu alMenuImage.Add(dr["menuId"].ToString()); //Picture Exist for menu prcFillImageList(dr["menuImageName"].ToString(), Int16.Parse(dr["menuImageSize"].ToString())); Common.Classes.clsMain.alMnuFrmName.Add(dr["frmName"].ToString()); if (Int16.Parse(dr["menuImageSize"].ToString()) != 2) { //Small Image btn.SharedProps.AppearancesSmall.Appearance.Image = alMenuImage.Count - 1;//Common.Classes.clsMain.alMnuFrmName.Count - 1; } else { //Large Image btn.SharedProps.AppearancesLarge.Appearance.Image = alMenuImage.Count - 1; } btn.SharedProps.DisplayStyle = ToolDisplayStyle.TextOnlyInMenus; #region Normal Menu [No DropDown Menu] if (Int16.Parse(dr["IsDropDown"].ToString()) == 0) { this.toolMan.Tools.Add(btn); //Set Large Image for tool ToolBase tb = this.toolMan.Ribbon.Tabs[dr["moduleId"].ToString()].Groups[dr["mMenuGroupId"].ToString()].Tools.AddTool(dr["MenuId"].ToString()); tb.CustomizedCaption = dr["menuCaption"].ToString(); if (Int16.Parse(dr["menuImageSize"].ToString()) == 2) { tb.InstanceProps.PreferredSizeOnRibbon = RibbonToolSize.Large; } } #endregion Normal Menu [No DropDown Menu] #region DropDown Menu if (Int16.Parse(dr["IsDropDown"].ToString()) == 1) { if (Int16.Parse(dr["DropDownParentId"].ToString()) == 0) { Infragistics.Win.Appearance ap1 = new Infragistics.Win.Appearance(); ap1.Image = alMenuImage.Count - 1; PopupMenuTool pmt = new PopupMenuTool(dr["menuId"].ToString()); pmt.DropDownArrowStyle = DropDownArrowStyle.Segmented; pmt.SharedPropsInternal.Caption = dr["menuCaption"].ToString(); pmt.SharedPropsInternal.Category = "DROPDOWNPARENT"; //Used to stop working when click on the main menu pmt.SharedPropsInternal.ToolTipText = "Select menu from list"; pmt.InstanceProps.PreferredSizeOnRibbon = RibbonToolSize.Large; //Setup Appearance pmt.SharedPropsInternal.AppearancesSmall.Appearance = ap1; toolMan.Tools.Add(pmt); toolMan.Ribbon.Tabs[dr["moduleId"].ToString()].Groups[dr["mMenuGroupId"].ToString()].Tools.AddTool(pmt.Key.ToString()); } else { StateButtonTool sbt = new StateButtonTool(dr["menuId"].ToString()); sbt.SharedPropsInternal.Caption = dr["menuCaption"].ToString(); sbt.CustomizedImage = ilSmall.Images[alMenuImage.Count - 1]; toolMan.Tools.Add(sbt); ((PopupMenuTool)(this.toolMan.Ribbon.Tabs[dr["moduleId"].ToString()].Groups[dr["mMenuGroupId"].ToString()].Tools[dr["DropdownParentId"].ToString()])).Tools.AddRange(new ToolBase[] { sbt }); } } #endregion DropDown Menu } } #endregion Form Based Button #region Combo Button if ((dr["ContainerType"]).ToString() == "Combo") { //Crate Combobox tool ComboBoxTool cbo = new ComboBoxTool("cbo" + dr["menuName"].ToString()); //Create ValueList For Loading Combo Data ValueList valueList1 = new ValueList(0); valueList1.DisplayStyle = Infragistics.Win.ValueListDisplayStyle.DisplayText; valueList1.PreferredDropDownSize = new System.Drawing.Size(0, 0); string strDefault = ""; foreach (DataRow dr3 in dsMaster.Tables["Company"].Rows) { if (Int16.Parse(dr3["isDefault"].ToString()) != 0) { strDefault = dr3["comId"].ToString(); } ValueListItem v1 = new ValueListItem(); v1.DataValue = dr3["comId"].ToString(); v1.DisplayText = dr3["comName"].ToString(); valueList1.ValueListItems.Add(v1); } cbo.ValueList = valueList1; this.toolMan.Tools.AddRange(new ToolBase[] { cbo }); ToolBase tbCompany = this.toolMan.Ribbon.Tabs[dr["moduleId"].ToString()].Groups[dr["mMenuGroupId"].ToString()].Tools.AddTool(cbo.Key); //ToolBase tbCompany = ((RibbonGroup)dr["mMenuGroupId"]).Tools.AddTool(cbo.Key); //Set Default Value if (strDefault.Length > 0) { ((ComboBoxTool)toolMan.Tools[cbo.Key]).Value = Int16.Parse(strDefault); } } #endregion Combo Button } #endregion Creating Button } catch (Exception ex) { MessageBox.Show(ex.Message, strCaption); } }
private ValueList GetValueListHelper() { return(valueList ?? (valueList = new ValueList(this))); }
public virtual int IndexOf(T value) => ValueList.IndexOf(value);
internal ItemsEnumerator(ValuePool <T> pool) { _enumerator = pool._items.GetEnumerator(); }
private void signalTest(string fileFormat, DataType dataType) { string[] Channelnames = { "CH1", "CH2" }; UnisensFactory uf = UnisensFactoryBuilder.createFactory(); Unisens u = uf.createUnisens(path); string fileName = "signal_" + dataType.ToString() + "_" + fileFormat + "." + fileFormat.Substring(0, 3); string fileName1 = "value_" + dataType.ToString() + "_" + fileFormat + "." + fileFormat.Substring(0, 3); ValuesEntry ve = u.createValuesEntry(fileName1, new String[] { "A", "B" }, dataType, 250); SignalEntry se = u.createSignalEntry(fileName, new String[] { "A", "B" }, dataType, 250); switch (fileFormat) { case "bin_LITTLE": // BIN BinFileFormat bffsili = se.createBinFileFormat(); bffsili.setEndianess(Endianess.LITTLE); se.setFileFormat(bffsili); BinFileFormat bffva = ve.createBinFileFormat(); bffva.setEndianess(Endianess.LITTLE); ve.setFileFormat(bffva); break; case "bin_BIG": // BIN BinFileFormat bffsibi = se.createBinFileFormat(); bffsibi.setEndianess(Endianess.BIG); se.setFileFormat(bffsibi); BinFileFormat bffvabi = ve.createBinFileFormat(); bffvabi.setEndianess(Endianess.BIG); ve.setFileFormat(bffvabi); break; case "xml": // XML XmlFileFormat xffsi = se.createXmlFileFormat(); se.setFileFormat(xffsi); XmlFileFormat xffva = ve.createXmlFileFormat(); ve.setFileFormat(xffva); break; case "csv": // CSV CsvFileFormat cffsi = se.createCsvFileFormat(); cffsi.setSeparator("\t"); cffsi.setDecimalSeparator(","); se.setFileFormat(cffsi); CsvFileFormat cffva = ve.createCsvFileFormat(); cffva.setComment("csv , 2 channel "); cffva.setSeparator(";"); cffva.setDecimalSeparator("."); ve.setFileFormat(cffva); break; } var samplestamp = new long[3] { 1320, 22968, 30232 }; switch (dataType) { case DataType.INT8: var A = new sbyte[][] { new sbyte[] { -128, 127 }, new sbyte[] { 2, 5 }, new sbyte[] { 3, 6 } }; se.append(A); ValueList valueList = new ValueList(samplestamp, A); ve.appendValuesList(valueList); break; case DataType.UINT8: var B = new byte[][] { new byte[] { 255, 4 }, new byte[] { 2, 5 }, new byte[] { 3, 6 } }; se.append(B); ValueList valueList1 = new ValueList(samplestamp, B); ve.appendValuesList(valueList1); break; case DataType.INT16: var C = new short[][] { new short[] { -32768, 32767 }, new short[] { 2, 5 }, new short[] { 3, 6 } }; se.append(C); ValueList valueList2 = new ValueList(samplestamp, C); ve.appendValuesList(valueList2); break; case DataType.UINT16: var D = new UInt16[][] { new UInt16[] { 65535, 4 }, new UInt16[] { 2, 5 }, new UInt16[] { 3, 6 } }; se.append(D); ValueList valueList3 = new ValueList(samplestamp, D); ve.appendValuesList(valueList3); break; case DataType.INT32: var E = new int[][] { new int[] { -2147483648, 2147483647 }, new int[] { 2, 5 }, new int[] { 3, 6 } }; se.append(E); ValueList valueList4 = new ValueList(samplestamp, E); ve.appendValuesList(valueList4); break; case DataType.UINT32: var F = new UInt32[][] { new UInt32[] { 4294967295, 4 }, new UInt32[] { 2, 5 }, new UInt32[] { 3, 6 } }; se.append(F); ValueList valueList5 = new ValueList(samplestamp, F); ve.appendValuesList(valueList5); break; case DataType.FLOAT: var G = new float[][] { new float[] { 123.4567F, 4 }, new float[] { 2, 5 }, new float[] { 3, 6 } }; se.append(G); ValueList valueList6 = new ValueList(samplestamp, G); ve.appendValuesList(valueList6); break; case DataType.DOUBLE: var H = new double[][] { new double[] { 123.4567D, 4 }, new double[] { 2, 5 }, new double[] { 3, 6 } }; se.append(H); ValueList valueList7 = new ValueList(samplestamp, H); ve.appendValuesList(valueList7); break; } u.save(); //Console.WriteLine("hallo"); //Console.WriteLine(uf.ToString()); //Console.ReadKey(); }
public static ValueList GetValuelistLength() { ValueList vlist = new ValueList(); try { vlist.ValueListItems.Add(9, "9"); vlist.ValueListItems.Add(11, "11"); vlist.ValueListItems.Add(12, "12"); } catch { } return vlist; }
public override string GetFormula() { return(ValueList.Replace("\r\n", ",")); }
// ================================================================================================================ // STATIC INTERFACE ----------------------------------------------------------------------------------------------- private static void addInstance(ValueList instance) { instances.Add(instance.name, instance); }
private void SurfaceInspectionRecord_Load(object sender, EventArgs e) { this.dtp_Begin.Value = DateTime.Today; this.dtp_End.Value = DateTime.Today.AddDays(1).AddSeconds(-1); this._VLSizePrecision = new ValueList(); BindToSizePrecision(); this.ultraGrid1.DisplayLayout.Bands[0].Columns["FS_SIZEPRECISION"].ValueList = this._VLSizePrecision; this._VLProductSurfaceDefects = new ValueList(); BindToProductSurfaceDefects(); this.ultraGrid1.DisplayLayout.Bands[0].Columns["FS_WASTEPRODUCTTYPE"].ValueList = this._VLProductSurfaceDefects; this._VLTestResults = new ValueList(); BindToTestResults(); this.ultraGrid1.DisplayLayout.Bands[0].Columns["FS_TESTRESULTS"].ValueList = this._VLTestResults; this._VLSteelType = new ValueList(); this._VLSpec = new ValueList(); strIP = m_BaseInfo.getIPAddress(); strMAC = m_BaseInfo.getMACAddress(); saveHeadInfo(); this.txtBeginBatch.Enabled = false; this.txtEndBatch.Enabled = false; this.cbBatchNo.Checked = false; }
private void listaContiInitializeLayout(object sender, InitializeLayoutEventArgs e) { var vl = new ValueList(); e.Layout.Bands[0].Columns["IdSottoConto"].ValueList = vl; e.Layout.Bands[0].Columns["IdFornitore"].ValueList = vl; }
private static ValueList CalculateSpaceList(ExpressionNode[] nodes) { var result = new ValueList(); var skip = 0; for (var i = 1; i < nodes.Length; i++) { var filter = nodes[i]; if (filter.Operator == ' ') { var a = CalculateList(nodes.Skip(skip).Take(i - skip).ToArray()); result.Add(a); skip = i; } } result.Add(CalculateList(nodes.Skip(skip).ToArray())); return result; }
public static ValueList GetValuelistBanci() { ValueList vlist = new ValueList(); try { vlist.ValueListItems.Add("0", "常白班"); vlist.ValueListItems.Add("1", "早"); vlist.ValueListItems.Add("2", "中"); vlist.ValueListItems.Add("3", "晚"); } catch { } return vlist; }
public void AgregarUnidades(UltraGridRow Row) { ItemPlantillaServicio Item = (ItemPlantillaServicio)Row.Tag; ValueList List = new ValueList(); if (Item.Servicio != null) { Item.Unidad = Item.Servicio.UnidadBase; } foreach (ExistenciaUnidad Unidad in Item.Servicio.Unidades) { if (Item.Unidad == null & Unidad.EsUnidadBase) { Item.Unidad = Unidad; } List.ValueListItems.Add(Unidad, Unidad.Unidad.Codigo); } Row.Cells[colUnidad].ValueList = List; }
/// **************************************************************************** /// <summary> /// 帮定类型数据 /// </summary> /// <param name="ValueListCase">帮定对象</param> /// **************************************************************************** private void RoleTypeBound(ValueList ValueListCase) { RoleTypeBoundProcess(ValueListCase, "ValueList"); }
private ValueList GetValuelistWeightPoint() { ValueList vlist = new ValueList(); try { vlist.ValueListItems.Add(CNST_BC_STATION_A, "A��"); vlist.ValueListItems.Add(CNST_BC_STATION_B, "B��"); vlist.ValueListItems.Add("", ""); } catch { } return vlist; }
private void SpeedTest() { Debug.Log("Value List:"); ValueList <int> a = new ValueList <int>(); Debug.Log("Add " + Quantity + " elements: " + TimeFunction(() => { for (int i = 0; i < Quantity; i++) { a.Add(i); } }) + "ms"); Debug.Log("Enumerate and sum " + Quantity + " elements: " + TimeFunction(() => { IRefEnumerator <int> e = a.GetEnumerator(); int v = 0, sum = 0; e.Reset(); while (e.MoveNext(ref v)) { sum += v; } e.Dispose(); Debug.Log("Sum: " + sum); }) + "ms"); Debug.Log("Array:"); int[] b = new int[Quantity]; Debug.Log("Add " + Quantity + " elements: " + TimeFunction(() => { for (int i = 0; i < Quantity; i++) { b[i] = i; } }) + "ms"); Debug.Log("Enumerate and sum " + Quantity + " elements: " + TimeFunction(() => { IEnumerator e = b.GetEnumerator(); int sum = 0; e.Reset(); while (e.MoveNext()) { sum += (int)e.Current; } Debug.Log("Sum: " + sum); }) + "ms"); Debug.Log("Array without enumerator:"); b = new int[Quantity]; Debug.Log("Add " + Quantity + " elements: " + TimeFunction(() => { for (int i = 0; i < Quantity; i++) { b[i] = i; } }) + "ms"); Debug.Log("For and sum " + Quantity + " elements: " + TimeFunction(() => { int sum = 0; for (int i = 0; i < Quantity; i++) { sum += b[i]; } Debug.Log("Sum: " + sum); }) + "ms"); Debug.Log("List:"); List <int> c = new List <int>(); Debug.Log("Add " + Quantity + " elements: " + TimeFunction(() => { for (int i = 0; i < Quantity; i++) { c.Add(i); } }) + "ms"); Debug.Log("Enumerate and sum " + Quantity + " elements: " + TimeFunction(() => { IEnumerator <int> e = c.GetEnumerator(); int sum = 0; e.Reset(); while (e.MoveNext()) { sum += e.Current; } e.Dispose(); Debug.Log("Sum: " + sum); }) + "ms"); }
public ElseNode(ValueList condition) { _condition = condition; }
public static void assertValueList(ValueList expected, ValueList actual) { assertArrayEquals(expected.getSamplestamps(), actual.getSamplestamps()); var eData = expected.getData(); var aData = actual.getData(); if (eData is byte[]) { if (aData is byte[][]) { var data = (aData as byte[][]); var dim = new byte[data.Length]; for (var i = 0; i < data.Length; i++) { dim[i] = data[i][0]; } assertArrayEquals(eData as byte[], dim); } else { assertArrayEquals(eData as byte[], aData as byte[]); } } else if (eData is short[]) { if (aData is short[][]) { var data = (aData as short[][]); var dim = new short[data.Length]; for (var i = 0; i < data.Length; i++) { dim[i] = data[i][0]; } assertArrayEquals(eData as short[], dim); } else { assertArrayEquals(eData as short[], aData as short[]); } } else if (eData is long[]) { if (aData is long[][]) { var data = (aData as long[][]); var dim = new long[data.Length]; for (var i = 0; i < data.Length; i++) { dim[i] = data[i][0]; } assertArrayEquals(eData as long[], dim); } else { assertArrayEquals(eData as long[], aData as long[]); } } else if (eData is float[]) { if (aData is float[][]) { var data = (aData as float[][]); var dim = new float[data.Length]; for (var i = 0; i < data.Length; i++) { dim[i] = data[i][0]; } assertArrayEquals(eData as float[], dim); } else { assertArrayEquals(eData as float[], aData as float[]); } } else if (eData is int[]) { if (aData is int[][]) { var data = (aData as int[][]); var dim = new int[data.Length]; for (var i = 0; i < data.Length; i++) { dim[i] = data[i][0]; } assertArrayEquals(eData as int[], dim); } else { assertArrayEquals(eData as int[], aData as int[]); } } }
public void DispatchValues(ValueList vl) { Pipeline.Current.Process(vl); }
/// <summary> /// Override of IContentObject Interface Function /// </summary> /// <param name="ckw">ValueList Object for Content Keywords</param> internal override void SetContentKeywords(ValueList ckw) { ckw.Value.Add("MEXL-SitRep SituationInformation"); }
public static ValueList GetValuelistBanzu() { ValueList vlist = new ValueList(); try { vlist.ValueListItems.Add("0", "常白班"); vlist.ValueListItems.Add("1", "甲"); vlist.ValueListItems.Add("2", "乙"); vlist.ValueListItems.Add("3", "丙"); vlist.ValueListItems.Add("4", "丁"); } catch { } return vlist; }
/// **************************************************************************** /// <summary> /// 流程属性帮定 /// </summary> /// <param name="ValueListCase">帮定对象</param> /// <param name="ProcedureCase">流程实体</param> /// **************************************************************************** public static void PropertyBound(ValueList ValueListCase, Procedure ProcedureCase) { PropertyBoundProcess(ValueListCase, "ValueList", ProcedureCase); }
// Returns an IList representing the values of this sorted list. The // returned list is an alias for the values of this sorted list, so // modifications made to the returned list are directly reflected in the // underlying sorted list, and vice versa. The elements of the returned // list are ordered in the same way as the elements of the sorted list. The // returned list does not support adding or inserting elements (the // Add, AddRange, Insert and InsertRange // methods throw exceptions), but it does allow modification and removal of // elements (through the Remove, RemoveRange, Set and // SetRange methods or through an enumerator). // public virtual IList GetValueList() { if (valueList == null) valueList = new ValueList(this); return valueList; }
public FieldValueViewModel( CustomFieldsViewModel model, [NotNull] FieldWithValue ch, ILinkRenderer renderer) { if (ch == null) { throw new ArgumentNullException(nameof(ch)); } Value = ch.Value; DisplayString = ch.Field.SupportsMarkdown() ? new MarkdownString(ch.DisplayString).ToHtmlString(renderer) : ch.DisplayString.SanitizeHtml(); FieldViewType = (ProjectFieldViewType)ch.Field.FieldType; FieldName = ch.Field.FieldName; HasMasterAccess = model.AccessArguments.MasterAccess; Description = ch.Field.Description.ToHtmlString(); MasterDescription = HasMasterAccess ? ch.Field.MasterDescription.ToHtmlString() : "".MarkAsHtmlString(); IsPlayerVisible = ch.Field.CanPlayerView; IsDeleted = !ch.Field.IsActive; HasValue = ch.HasViewableValue; CanView = ch.HasViewableValue && ch.HasViewAccess(model.AccessArguments) && (ch.HasEditableValue || ch.Field.IsAvailableForTarget(model.Target)); CanEdit = model.EditAllowed && ch.HasEditAccess(model.AccessArguments) && (ch.HasEditableValue || ch.Field.IsAvailableForTarget(model.Target)); // Detecting if field (or its values) has a price or not HasPrice = ch.SupportsPricing(); //if not "HasValues" types, will be empty ValueList = ch.GetDropdownValues() .Select(v => new FieldPossibleValueViewModel(v, HasPrice, true)).ToList(); PossibleValueList = ch.GetPossibleValues(model.AccessArguments).Select(v => new FieldPossibleValueViewModel(v, HasPrice, ValueList.Any(sv => sv.ProjectFieldDropdownValueId == v.ProjectFieldDropdownValueId))) .ToArray(); if (HasPrice) { if (FieldViewType.SupportsPricingOnField()) { Price = ch.Field.Price; } Fee = ch.GetCurrentFee(); } ShowPrice = HasPrice && model.AccessArguments.AnyAccessToClaim; ProjectFieldId = ch.Field.ProjectFieldId; FieldBound = (FieldBoundToViewModel)ch.Field.FieldBoundTo; MandatoryStatus = IsDeleted ? MandatoryStatusViewType.Optional : (MandatoryStatusViewType)ch.Field.MandatoryStatus; ProjectId = ch.Field.ProjectId; SetFieldLabels(ch); }
public IncludeNode(string mixinName, ValueList args) { MixinName = mixinName; Arguments = args; }
/// <summary> /// Reads an XML From An Existing DOM /// </summary> /// <param name="rootnode">Node Containing the Situation Information</param> internal override void ReadXML(XmlNode rootnode) { GeoOASISWhere whereTemp = new GeoOASISWhere(); foreach (XmlNode childnode in rootnode.ChildNodes) { if (string.IsNullOrEmpty(childnode.InnerText)) { continue; } switch (childnode.LocalName) { case "IncidentName": if (this.incidentName == null) { this.incidentName = new List <string>(); } this.incidentName.Add(childnode.InnerText); break; case "IncidentCause": this.incidentCause = childnode.InnerText; break; case "IncidentComplexity": this.incidentComplexity = (ComplexityType)Enum.Parse(typeof(ComplexityType), childnode.InnerText); break; case "IncidentSize": this.incidentSize = childnode.InnerText; break; case "Severity": this.severity = new ValueList(); this.severity.ReadXML(childnode); break; case "IncidentType": this.incidentType = childnode.InnerText; break; case "IncidentStartDateTime": this.incidentStartDateTime = Convert.ToDateTime(childnode.InnerText); break; case "IncidentLocation": this.incidentLocation = new GeoOASISWhere(); this.incidentLocation.ReadXML(childnode.FirstChild); break; case "IncidentStagingArea": if (this.incidentStagingArea == null) { this.incidentStagingArea = new List <string>(); } this.incidentStagingArea.Add(childnode.InnerText); break; case "MapSketch": this.mapSketch = childnode.InnerText; break; case "DisasterDeclarationDateTime": this.disasterDeclarationDateTime = Convert.ToDateTime(childnode.InnerText); break; case "DisasterDeclarationAuthority": this.disasterDeclarationAuthority = childnode.InnerText; break; case "Jurisdiction": if (this.jurisdicition == null) { this.jurisdicition = new List <GeoOASISWhere>(); } whereTemp.ReadXML(childnode.FirstChild); this.jurisdicition.Add(whereTemp); break; case "Remarks": this.remarks = childnode.InnerText; break; case "#comment": break; default: throw new ArgumentException("Unexpected Child Node Name: " + childnode.Name + " in SituationInformation"); } } }