Beispiel #1
0
        public virtual void OnGenerating(RandomGenerateEventArgs e)
        {
            MyRandomEventHandler handler = Generating;

            if (handler != null)
            {
                Generating(this, e);
            }
        }
Beispiel #2
0
        public void GenerateRecords(int number)
        {
            StringBuilder           builder = new StringBuilder();
            RandomGenerateEventArgs args;

            for (int i = 0; i < number / 100; i++)
            {
                for (int j = 0; j < 100; j++)
                {
                    builder.AppendLine(string.Format(format, randomValues.Generate()));
                }
                args = new RandomGenerateEventArgs(builder.ToString());
                OnGenerating(args);
                builder.Remove(0, builder.ToString().Length);
            }

            for (int num = 0; num < number % 100; num++)
            {
                builder.AppendLine(string.Format(format, randomValues.Generate()));
            }
            args = new RandomGenerateEventArgs(builder.ToString());
            OnGenerating(args);
            OnGenerated(new EventArgs());
        }