public static string GenerateID(string ConfigKey, int MaxValue, string Header, int MasterIDLenght) { AutoID autoid; if (!IDBuilders.TryGetValue(ConfigKey, out autoid)) { autoid = new AutoID(ConfigKey, MaxValue, Header, MasterIDLenght); IDBuilders[ConfigKey] = autoid; autoid.OnCountReset += new EventHandler(autoid_OnCountReset); autoid.MasterID = GenerateMasterID(ConfigKey, MasterIDLenght); } return(autoid.Get()); }
static void autoid_OnCountReset(object sender, EventArgs e) { AutoID autoid = sender as AutoID; autoid.MasterID = GenerateMasterID(autoid.Key, autoid.MasterIDLenght); }
public static string GenerateID(string ConfigKey, int MaxValue, string Header, int MasterIDLenght) { AutoID autoid; if (!IDBuilders.TryGetValue(ConfigKey, out autoid)) { autoid = new AutoID(ConfigKey, MaxValue, Header, MasterIDLenght); IDBuilders[ConfigKey] = autoid; autoid.OnCountReset += new EventHandler(autoid_OnCountReset); autoid.MasterID = GenerateMasterID(ConfigKey, MasterIDLenght); } return autoid.Get(); }