示例#1
0
        public void Remove_T()
        {
            var td = new TypeList <IServiceCollection> {
                typeof(ServiceCollection)
            };

            td.Count.ShouldBe(1);
            td.ShouldContain(typeof(ServiceCollection));
            Should.NotThrow(() => td.Remove <IServiceCollection>()).ShouldBeFalse();
            td.Count.ShouldBe(1);
            td.ShouldContain(typeof(ServiceCollection));
            Should.NotThrow(() => td.Remove <ServiceCollection>()).ShouldBeTrue();
            td.Count.ShouldBe(0);
            td.ShouldNotContain(typeof(ServiceCollection));
        }
示例#2
0
 public void UpdateLabel(Label JobLabel, int player)
 {
     if (player <= Players)
     {
         int    loop = 0, r = 0;
         string Job = null, Type = null, Rarity = null, RareType = null, Attribute = null;
         if (EnableAccuracyMenu.Checked)
         {
             while (loop < 10000)
             {
                 Job = ChooseJob(); Type = ChooseType(); Rarity = ChooseRarity(); RareType = ChooseRareType(); Attribute = ChooseAttribute();
                 CharaCmd.CommandText = "SELECT count(Name) FROM CharacterList where " + sql;
                 sql = "";
                 loop++;
                 if ((long)CharaCmd.ExecuteScalar() > 0)
                 {
                     r = 1;
                     break;
                 }
             }
             if (r == 1)
             {
                 if (JobExistFalse.Checked)
                 {
                     JobList.Remove(Job);
                 }
                 if (TypeExistFalse.Checked)
                 {
                     TypeList.Remove(Type);
                 }
             }
         }
         else
         {
             r        = 1;
             RareType = ChooseRareType(); Type = ChooseType(); Rarity = ChooseRarity(); Job = ChooseJob(); Attribute = ChooseAttribute();
         }
         if (RarityEnabled.Checked && !UseTotalRarity.Checked)
         {
             Rarity = Rarity.Insert(0, "☆");
         }
         if (r == 1)
         {
             JobLabel.Text = RareType + " " + Rarity + Job + "\r\n" + Type + " " + Attribute;
             set_back(JobLabel, Job);
         }
         else
         {
             JobLabel.Text = "生成失敗";
         }
     }
     if (player == Players)
     {
         Timerfor4.Stop();
         Timer4cnt = 0;
         str       = null;
         LoadCnt   = 0;
         SettingStatus(true);
     }
 }
示例#3
0
 public string ChooseType()
 {
     if (TypeEnabled.Checked)
     {
         if (!OneTypeOnly.Checked)
         {
             type = Convert.ToString((string)TypeList[random.Next(0, TypeList.Count)]);
             if (TypeExistFalse.Checked && !EnableAccuracyMenu.Checked)
             {
                 TypeList.Remove(type);
             }
         }
         if (EnableAccuracyMenu.Checked)
         {
             if (sql != "")
             {
                 sql += "and Type='" + type + "' ";
             }
             else
             {
                 sql += "Type='" + type + "' ";
             }
         }
     }
     else
     {
         type = "";
     }
     return(type);
 }
示例#4
0
        public void Remove()
        {
            var td = new TypeList <IServiceCollection> {
                typeof(ServiceCollection)
            };

            td.Count.ShouldBe(1);
            td.ShouldContain(typeof(ServiceCollection));
            Should.Throw <ArgumentNullException>(() => td.Remove(null));
            Should.Throw <ArgumentException>(() => td.Remove(typeof(ServiceProvider)));
            Should.NotThrow(() => td.Remove(typeof(IServiceCollection))).ShouldBeFalse();
            td.Count.ShouldBe(1);
            td.ShouldContain(typeof(ServiceCollection));
            Should.NotThrow(() => td.Remove(typeof(ServiceCollection))).ShouldBeTrue();
            td.Count.ShouldBe(0);
            td.ShouldNotContain(typeof(ServiceCollection));
        }
示例#5
0
 protected void RemoveObj(String indexName)
 {
     TypeList.Remove(indexName);
     ObjectList.Remove(indexName);
 }