예제 #1
0
        void addNewMatrix(Token token)
        {
            string tokenName = "m" + nextIndex;

            while (vars.Contains(tokenName))
            {
                nextIndex++;
                tokenName = "m" + nextIndex;
            }
            DataGridView dataGridView = new DataGridView();

            dataGridView.BackgroundColor    = Color.White;
            dataGridView.AllowUserToAddRows = false;
            matrixGrids.Add(dataGridView);
            matrixTab.TabPages.Add(tokenName);
            token.TokenName = tokenName;
            vars.AddToken(token);
            matrixTokens.Add(token);
            dataGridView.Location = new Point(15, 75);
            dataGridView.Size     = new Size(520, 435);
            SetupDataGridView(dataGridView, token);
            this.Controls.Add(dataGridView);
            matrixTab.SelectedIndex = matrixGrids.Count - 1;
            nextIndex++;
            DataGridViewEventRegistrar(dataGridView, true);
        }
 private void ExpandVariables(IEngineConfig config, Encoding encoding)
 {
     foreach (string key in config.Variables.Keys)
     {
         string formattedKey = string.Format(config.VariableFormatString, key);
         byte[] keyBytes     = encoding.GetBytes(formattedKey);
         _variableKeys.Add(keyBytes);
         _values[Variables.AddToken(keyBytes)] = () => config.Variables[key];
     }
 }