private void CMB_BlockType_SelectedIndexChanged(object sender, EventArgs e)
 {
     CMB_BlockSubType.BeginUpdate();
     CMB_BlockSubType.Items.Clear();
     foreach (MyCubeBlockDefinition cubeBlockDefinition in Enumerable.OfType <MyCubeBlockDefinition>((IEnumerable)MyDefinitionManager.Static.GetAllDefinitions()))
     {
         if (cubeBlockDefinition.Id.TypeId == SelectedType.Key)
         {
             CMB_BlockSubType.Items.Add(cubeBlockDefinition.Id.SubtypeName);
         }
     }
     CMB_BlockSubType.EndUpdate();
 }
Beispiel #2
0
        private void CMB_BlockType_SelectedIndexChanged(object sender, EventArgs e)
        {
            CMB_BlockSubType.BeginUpdate();
            CMB_BlockSubType.Items.Clear();
            DictionaryValuesReader <MyDefinitionId, MyDefinitionBase> allDefinitions = MyDefinitionManager.Static.GetAllDefinitions( );

            foreach (MyDefinitionBase o in allDefinitions)
            {
                MyCubeBlockDefinition cubeBlockDefinition = o as MyCubeBlockDefinition;
                if (cubeBlockDefinition == null)
                {
                    continue;
                }
                if (cubeBlockDefinition.Id.TypeId == SelectedType.Key)
                {
                    CMB_BlockSubType.Items.Add(cubeBlockDefinition.Id.SubtypeName);
                }
            }
            CMB_BlockSubType.EndUpdate();
        }