Пример #1
0
 public void AddDynamicEnum(DynamicEnumerationData typeData)
 {
     m_hidden[typeData.TypeId] = false;
     m_dynamicEnums.Add(typeData.TypeId, typeData);
     m_types.Add(typeData.TypeId, new TypeData((a, b, c, document) => typeData.Make(a, b, c, GetDynamicEnumSource(typeData.TypeId)), typeData.Name));
     Modified.Execute(typeData.TypeId);
 }
Пример #2
0
 public void RenameType(ParameterType guid, string name)
 {
     m_types[guid].Name = name;
     if (IsInteger(guid))
     {
         IntegerData data = m_integers[guid];
         data             = new IntegerData(name, data.TypeId, data.Max, data.Min);
         m_integers[guid] = data;
     }
     else if (IsDecimal(guid))
     {
         DecimalData data = m_decimals[guid];
         data             = new DecimalData(name, data.TypeId, data.Max, data.Min);
         m_decimals[guid] = data;
     }
     else if (IsLocalizedString(guid))
     {
         LocalizedStringData data = m_localizedStrings[guid];
         data = new LocalizedStringData(name, data.TypeId /*, data.File*/);
         m_localizedStrings[guid] = data;
     }
     else if (IsEnum(guid))
     {
         var data = m_enums[guid];
         m_enums[guid] = Tuple.Create(name, data.Item2);
     }
     else if (IsDynamicEnum(guid))
     {
         DynamicEnumerationData data = m_dynamicEnums[guid];
         data = new DynamicEnumerationData(name, data.TypeId);
         m_dynamicEnums[guid] = data;
     }
     else if (IsLocalDynamicEnum(guid))
     {
         LocalDynamicEnumerationData data = m_localDynamicEnums[guid];
         data = new LocalDynamicEnumerationData(name, data.TypeId);
         m_localDynamicEnums[guid] = data;
     }
     Modified.Execute(guid);
 }