Example #1
0
        public void GenerateNumber()
        {
            Debug.Assert(User != null, "User has not been set!");

            var frm = new AutoNumberOptions(User, AutoNumberCategory, AutoNumberTable, AutoNumberField);
            frm.Owner = this.FindParentWindow();
            if (frm.GenerateNumber()) {
                txt.Text = frm.AutoNumber;
            }
        }
Example #2
0
        public AutoNumberGenerator(string connectionString, string containerName, int batchSize, int maxWriteAttempts)
        {
            var blobStorageAccount = CloudStorageAccount.Parse(connectionString);

            var blobOptimisticDataStore = new BlobOptimisticDataStore(blobStorageAccount, containerName);
            var options = new AutoNumberOptions
            {
                BatchSize        = batchSize,
                MaxWriteAttempts = maxWriteAttempts
            };
            IOptions <AutoNumberOptions> optionsProvider = new OptionsWrapper <AutoNumberOptions>(options);

            generator = new UniqueIdGenerator(blobOptimisticDataStore, optionsProvider);
        }
Example #3
0
        private void ShowAutoNumber()
        {
            Debug.Assert(User != null, "User has not been set!");

            var frm = new AutoNumberOptions(User, AutoNumberCategory, AutoNumberTable, AutoNumberField);
            frm.Owner = this.FindParentWindow();
            if (frm.ShowDialog().ValueOrFalse()) {
                txt.Text = frm.AutoNumber;
            }
        }