예제 #1
0
        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());
        }
예제 #2
0
        static void autoid_OnCountReset(object sender, EventArgs e)
        {
            AutoID autoid = sender as AutoID;

            autoid.MasterID = GenerateMasterID(autoid.Key, autoid.MasterIDLenght);
        }
예제 #3
0
파일: IDGenerator.cs 프로젝트: bzure/BCF
 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();
 }