ZicoresTradingPostNotifier.Helper.ColumnHelper.Update C# (CSharp) Méthode

Update() private méthode

private Update ( String identifier, int index, int width ) : void
identifier String
index int
width int
Résultat void
        private void Update(String identifier, int index, int width)
        {
            if (width > 1200)
            {
                width = 140;
            }

            var newCol = Config.Columns[key].FirstOrDefault(x => x.Identifier == identifier);
            if (newCol != null)
            {
                if (width != 0)
                {
                    newCol.Width = width;
                }
                newCol.NewIndex = index;
            }
            else
            {
                if (width != 0)
                {
                    newCol = new ColumnInfo() { Identifier = identifier, Width = width, NewIndex = index };
                }
                else
                {
                    newCol = new ColumnInfo() { Identifier = identifier, NewIndex = index };
                }

                Config.Columns[key].Add(newCol);
            }
        }