static SentinelNativeStrategy() { if (TypeType.isUnmanaged <T>() == false) { throw new DBC.Common.PreconditionException("Only unmanaged data can be stored natively"); } }
public TypeDef(QualifiedClassName name, TypeDef baseType, TypeType typeType, Type type) { _baseType = baseType; Name = name; TypeType = typeType; Type = type; }
private string TypeToString(TypeType t) { if (t == TypeType.Other) { // This value requires no additional processing return(t.ToString()); } // 1) Just convert to string var raw = t.ToString(); // 2 A) Remove suffix of XML types if (raw.EndsWith(SuffixXml)) { return(RemoveSuffix(raw, SuffixXml)); } // 2 B) Remove suffix of UN/CEFACT types else if (raw.EndsWith(SuffixUnCefact)) { return(RemoveSuffix(raw, SuffixUnCefact)); } else { // If this happens, there is a bug somewhere throw new InvalidOperationException("Unexpected datatype value \"" + t.ToString() + "\""); } }
public static TypeType GetComboTypeType(TypeType newTypeType, TypeType oldTypeType) { if (newTypeType == TypeType.Fire) { if (oldTypeType == TypeType.Fire) { return(TypeType.Inferno); } else if (oldTypeType == TypeType.Water) { return(TypeType.Steam); } } else if (newTypeType == TypeType.Water) { if (oldTypeType == TypeType.Water) { return(TypeType.Ocean); } else if (oldTypeType == TypeType.Fire) { return(TypeType.Steam); } } return(newTypeType); }
/// <summary> /// Note: static constructors are NOT compiled by burst as long as there are no static fields in the struct /// </summary> static NB() { #if ENABLE_DEBUG_CHECKS if (TypeType.isUnmanaged <T>() == false) { throw new Exception("NativeBuffer (NB) supports only unmanaged types"); } #endif }
public void setType(TypeTypeKnownValues new_value) { TypeType new_full_value = new TypeType(); Debug.Assert(new_value != TypeTypeKnownValues.Type__none); new_full_value.in_known_list = true; new_full_value.list_value = new_value; setType(new_full_value); }
protected TypeInfoBase(IMetadataProvider metadataProvider, Type native) { MetadataProvider = metadataProvider; Native = native; Name = native.Name; TypeType = Native.IsValueType ? TypeType.Value : TypeType.Reference; }
private static bool _isEquip2(TypeType type) { switch (type) { case TypeType.Ammo: case TypeType.Armor: case TypeType.Weapon: return(true); } return(false); }
static IEnumerable <SLFunc> MetaWrapperForFunc(PlatformName platform, IEnumerable <TypeDefinition> types, TypeType entityType, List <string> namespaces) { foreach (var type in types) { if (!IncludeType(type, namespaces, platform)) { continue; } yield return(MetadataFuncForType(platform, type, entityType)); } }
public string getTypeAsString() { TypeType result = getType(); if (result.in_known_list) { return(stringFromType(result.list_value)); } else { return(result.string_value); } }
private static bool _isStackable2(TypeType type) { switch (type) { case TypeType.PetEgg: case TypeType.PetEquip: case TypeType.Armor: case TypeType.Weapon: return(false); } return(true); }
public static Mon MonFromID(int ID) { if (ID < 0 || ID > MaxID) { return(new Mon(TypeType.Invalid, Attack1Type.Invalid, Attack2Type.Invalid)); } Attack2Type attack2Type = (Attack2Type)(ID / (TypeTypeLength * Attack1TypeLength)); Attack1Type attack1Type = (Attack1Type)((ID / TypeTypeLength) % Attack1TypeLength); TypeType typeType = (TypeType)(ID % TypeTypeLength); return(new Mon(typeType, attack1Type, attack2Type)); }
protected virtual TypeType ConvertTypeType(TypeType typeType) { switch (typeType) { default: case TypeType.Class: case TypeType.Enum: case TypeType.Struct: return(TypeType.Class); case TypeType.Interface: return(TypeType.Interface); } }
private object ConvertAnonymousType(object source, Type sourceType, Type targetType) { Func <object, object> func; TypeType key = new TypeType { SourceType = sourceType, TargetType = targetType }; if (!this._shredders.TryGetValue(key, out func)) { this._shredders[key] = func = this.CreateAnonymousShredder(sourceType, targetType); } return(func(source)); }
public void setType(string chars) { TypeTypeKnownValues known = stringToType(chars); TypeType new_value = new TypeType(); if (known == TypeTypeKnownValues.Type__none) { new_value.in_known_list = false; new_value.string_value = chars; } else { new_value.in_known_list = true; new_value.list_value = known; } setType(new_value); }
string FormatTypeType(TypeType typeType) { switch (typeType) { case TypeType.Command: return("Domain commands"); case TypeType.Other: return("Domain primitives"); case TypeType.Primitive: return("Built-in primitives"); default: return(typeType.ToString()); } }
protected override void handle_result(string result) { TypeTypeKnownValues known = stringToType(result); TypeType new_value = new TypeType(); if (known == TypeTypeKnownValues.Type__none) { new_value.in_known_list = false; new_value.string_value = result; } else { new_value.in_known_list = true; new_value.list_value = known; } handle_result(new_value); }
public static TypeType GetComboTypeType( TypeType newTypeType, TypeType oldTypeType ) { if( newTypeType == TypeType.Fire ) { if( oldTypeType == TypeType.Fire ) return TypeType.Inferno; else if( oldTypeType == TypeType.Water ) return TypeType.Steam; } else if( newTypeType == TypeType.Water ) { if( oldTypeType == TypeType.Water ) return TypeType.Ocean; else if( oldTypeType == TypeType.Fire ) return TypeType.Steam; } return newTypeType; }
public NType(IWorker worker) { /* xxx if candowncast(worker, Bridge.stdn_Type) worker = downcast(worker, Bridge.stdn_Type) else throw face = worker.face if face == Bridge.stdn_Interface ... elif face == Bridge.stdn_Nullable ... elif face == ManualType ... ... */ //xxx for now, worker must be an interface _type = TypeType.INTERFACE; _face = Bridge.toNativeInterface(worker); }
static IEnumerable <SLFunc> MetaWrapperForFunc(PlatformName platform, IEnumerable <TypeDefinition> types, TypeType entityType, List <string> namespaces) { foreach (var type in types) { if (namespaces.Count > 0 && !namespaces.Contains(type.Namespace)) { continue; } if (type.HasGenericParameters) { continue; } var moduleName = type.Namespace; var name = type.Name; if (TypeAggregator.FilterModuleAndName(platform, moduleName, ref name)) { yield return(MetadataFuncForType(platform, type, entityType)); } } }
private void fromJSONType(JSONValue json_value, bool ignore_extras) { Debug.Assert(json_value != null); JSONStringValue json_string = json_value.string_value(); if (json_string == null) { throw new Exception("The value for field Type of CurrencyConversionErrorJSON is not a string."); } TypeType the_open_enum = new TypeType(); switch (json_string.getData()[0]) { case 'B': if ((String.Compare(json_string.getData(), 1, "adResponse", 0, 10, false) == 0) && (json_string.getData().Length == 11)) { the_open_enum.in_known_list = true; the_open_enum.list_value = TypeTypeKnownValues.Type_BadResponse; goto open_enum_is_done; } break; case 'C': if ((String.Compare(json_string.getData(), 1, "odeNotFound", 0, 11, false) == 0) && (json_string.getData().Length == 12)) { the_open_enum.in_known_list = true; the_open_enum.list_value = TypeTypeKnownValues.Type_CodeNotFound; goto open_enum_is_done; } break; default: break; } the_open_enum.in_known_list = false; the_open_enum.string_value = json_string.getData(); open_enum_is_done :; setType(the_open_enum); }
static ComponentBuilder() { ENTITY_COMPONENT_TYPE = typeof(T); DEFAULT_IT = default; IS_ENTITY_VIEW_COMPONENT = typeof(IEntityViewComponent).IsAssignableFrom(ENTITY_COMPONENT_TYPE); #if SLOW_SVELTO_SUBMISSION HAS_EGID = typeof(INeedEGID).IsAssignableFrom(ENTITY_COMPONENT_TYPE); HAS_REFERENCE = typeof(INeedEntityReference).IsAssignableFrom(ENTITY_COMPONENT_TYPE); SetEGIDWithoutBoxing <T> .Warmup(); #endif ComponentID <T> .Init(); ENTITY_COMPONENT_NAME = ENTITY_COMPONENT_TYPE.ToString(); IS_UNMANAGED = TypeType.isUnmanaged <T>(); //attention this is important as it serves as warm up for Type<T> #if UNITY_NATIVE if (IS_UNMANAGED) { EntityComponentIDMap.Register <T>(new Filler <T>()); } #endif ComponentBuilderUtilities.CheckFields(ENTITY_COMPONENT_TYPE, IS_ENTITY_VIEW_COMPONENT); if (IS_ENTITY_VIEW_COMPONENT) { EntityViewComponentCache.InitCache(); } else { if (ENTITY_COMPONENT_TYPE != ComponentBuilderUtilities.ENTITY_INFO_COMPONENT && ENTITY_COMPONENT_TYPE.IsUnmanagedEx() == false) { throw new Exception( $"Entity Component check failed, unexpected struct type (must be unmanaged) {ENTITY_COMPONENT_TYPE}"); } } }
public TypeDef(QualifiedClassName name, TypeType typeType) { Name = name; TypeType = typeType; }
public static void RemapModuleAndName(PlatformName platform, ref string moduleName, ref string name, TypeType type) { if (moduleName == "UIKit" && name == "UIControlEvent") { name = "UIControlEvents"; } if (moduleName == "AudioToolboc") { moduleName = "CoreAudio"; } else if (moduleName == "PdfKit") { moduleName = "PDFKit"; } // TODO: https://github.com/xamarin/maccore/issues/1281 // There is the cases where a protocol name conflicts with a class name // and swift has a different name for the protocol if (name == "NFCReaderSession" && type == TypeType.Interface) { name = "NFCReaderSessionProtocol"; } else if (name == "SCNAnimation" && type == TypeType.Interface) { name = "SCNAnimationProtocol"; } else if (name == "NSObject" && type == TypeType.Interface) { name = "NSObjectProtocol"; } else if (name == "FIFinderSync" && type == TypeType.Interface) { name = "FIFinderSyncProtocol"; } else if (name == "NSAccessibilityElement" && type == TypeType.Interface) { name = "NSAccessibilityElementProtocol"; } else { string result; if (TypeMapForPlatform(platform).TryGetValue($"{moduleName}.{name}", out result)) { name = result; } } }
public GroupCommand <TKey, ReadableTuple <TKey> > Generate <TKey>(ReadableTuple <TKey> item, ReadableTuple <int> tupleSource, AbstractDb <int> mobDb1, AbstractDb <int> mobDb2, AbstractDb <int> pet1, AbstractDb <int> pet2) { var description = item.GetValue <ParameterHolder>(ClientItemAttributes.Parameters).Values[ParameterHolderKeys.Description] ?? ""; description = ParameterHolder.ClearDescription(description); ParameterHolder holder = new ParameterHolder(); GroupCommand <TKey, ReadableTuple <TKey> > commands = GroupCommand <TKey, ReadableTuple <TKey> > .Make(); int numSlotC = _getInt(ClientItemAttributes.NumberOfSlots, item); int numSlotS = _getInt(ServerItemAttributes.NumberOfSlots, tupleSource); if (ProjectConfiguration.AutocompleteViewId) { int viewIdC = _getInt(ClientItemAttributes.ClassNumber, item); int viewIdS = _getInt(ServerItemAttributes.ClassNumber, tupleSource); if (viewIdC != viewIdS) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, ClientItemAttributes.ClassNumber, viewIdS)); } } if (ProjectConfiguration.AutocompleteNumberOfSlot) { if (numSlotC != numSlotS) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, ClientItemAttributes.NumberOfSlots, numSlotS)); } } if ((TypeType)tupleSource.GetValue <int>(ServerItemAttributes.Type) != TypeType.Card) { if (item.GetValue <bool>(ClientItemAttributes.IsCard)) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, ClientItemAttributes.IsCard, false)); } } string idDisplayName = tupleSource.GetValue <string>(ServerItemAttributes.Name); if (_emptyFill(ClientItemAttributes.IdentifiedDisplayName, item) && ProjectConfiguration.AutocompleteIdDisplayName && _isNotNullDifferent(idDisplayName, ClientItemAttributes.IdentifiedDisplayName, item)) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, ClientItemAttributes.IdentifiedDisplayName, idDisplayName)); } DbAttribute attribute; TypeType itemType = (TypeType)tupleSource.GetValue <int>(ServerItemAttributes.Type); if (itemType == TypeType.Weapon || itemType == TypeType.Armor) { if (itemType == TypeType.Armor && !ItemParser.IsArmorType(tupleSource)) { if (itemType == TypeType.Armor) { itemType = TypeType.Weapon; } else { itemType = TypeType.Armor; } } } // Weight: //holder = item.GetValue<ParameterHolder>(ClientItemAttributes.Parameters); // //switch (itemType) { // case TypeType.Weapon: // case TypeType.Ammo: // case TypeType.Armor: // case TypeType.Card: // case TypeType.PetEgg: // case TypeType.PetEquip: // case TypeType.UsableItem: // case TypeType.EtcItem: // case TypeType.HealingItem: // case TypeType.ShadowEquip: // case TypeType.UsableWithDelayed: // case TypeType.UsableWithDelayed2: // _autoAddWeight(tupleSource, holder); // break; //} DbAttribute equipLevelAttribute = ServerItemAttributes.EquipLevel; if (tupleSource.GetIntNoThrow(ServerItemAttributes.EquipLevelMin) > tupleSource.GetIntNoThrow(ServerItemAttributes.EquipLevel)) { equipLevelAttribute = ServerItemAttributes.EquipLevelMin; } switch (itemType) { case TypeType.Weapon: string type = _findWeaponType(tupleSource) ?? "Weapon"; holder.Values[ParameterHolderKeys.Class] = type; string unidentifiedResourceName = EncodingService.FromAnyToDisplayEncoding(_findWeaponUnidentifiedResource(tupleSource) ?? ""); attribute = ClientItemAttributes.UnidentifiedResourceName; if (_emptyFill(attribute, item) && ProjectConfiguration.AutocompleteUnResourceName && _isNotNullDifferent(unidentifiedResourceName, attribute, item)) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, attribute, unidentifiedResourceName)); } string identifiedResourceName = item.GetStringValue(ClientItemAttributes.IdentifiedResourceName.Index); attribute = ClientItemAttributes.IdentifiedResourceName; if (String.IsNullOrEmpty(identifiedResourceName) && ProjectConfiguration.AutocompleteIdResourceName && _isNotNullDifferent(unidentifiedResourceName, attribute, item)) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, attribute, unidentifiedResourceName)); } attribute = ClientItemAttributes.UnidentifiedDisplayName; if (_emptyFill(attribute, item) && ProjectConfiguration.AutocompleteUnDisplayName && _isNotNullDifferent(type, attribute, item)) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, attribute, type)); } if (!tupleSource.GetValue <bool>(ServerItemAttributes.Refineable)) { if (!description.Contains("Impossible to refine") && !description.Contains("Cannot be upgraded") && !description.ToLower().Contains("rental item")) { description += "\r\nImpossible to refine this item."; } } if (tupleSource.GetValue <bool>(ServerItemAttributes.Refineable)) { if (description.Contains("Impossible to refine")) { description = description.Replace("Impossible to refine this item.", "").Trim('\r', '\n'); } } _autoAdd(ServerItemAttributes.Attack, ParameterHolderKeys.Attack, tupleSource, holder); _autoAddWeight(tupleSource, holder); _autoAdd(ServerItemAttributes.WeaponLevel, ParameterHolderKeys.WeaponLevel, tupleSource, holder); _autoAddJob(tupleSource, holder, _getInt(equipLevelAttribute, tupleSource)); _autoAddElement(tupleSource, holder); break; case TypeType.Ammo: type = _findAmmoType(tupleSource.GetStringValue(ServerItemAttributes.ApplicableJob.Index)) ?? "Ammunition"; holder.Values[ParameterHolderKeys.Class] = type; _autoAdd(ServerItemAttributes.Attack, ParameterHolderKeys.Attack, tupleSource, holder, -1); _autoAddWeight(tupleSource, holder); _autoAddElement(tupleSource, holder); break; case TypeType.Armor: int location = _getInt(ServerItemAttributes.Location, tupleSource); type = _findArmorType(location) ?? "Armor"; holder.Values[ParameterHolderKeys.Class] = type; unidentifiedResourceName = EncodingService.FromAnyToDisplayEncoding(_findArmorUnidentifiedResource(tupleSource, item) ?? ""); attribute = ClientItemAttributes.UnidentifiedResourceName; if (_emptyFill(attribute, item) && ProjectConfiguration.AutocompleteUnResourceName && _isNotNullDifferent(unidentifiedResourceName, attribute, item)) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, attribute, unidentifiedResourceName)); } else { unidentifiedResourceName = item.GetValue <string>(ClientItemAttributes.UnidentifiedResourceName); } identifiedResourceName = item.GetStringValue(ClientItemAttributes.IdentifiedResourceName.Index); attribute = ClientItemAttributes.IdentifiedResourceName; if (String.IsNullOrEmpty(identifiedResourceName) && ProjectConfiguration.AutocompleteIdResourceName && _isNotNullDifferent(unidentifiedResourceName, attribute, item)) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, attribute, unidentifiedResourceName)); } string unDisplayName = _findArmorUnidentifiedDisplayName(unidentifiedResourceName); attribute = ClientItemAttributes.UnidentifiedDisplayName; if (_emptyFill(attribute, item) && ProjectConfiguration.AutocompleteUnDisplayName && _isNotNullDifferent(unDisplayName, attribute, item)) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, attribute, unDisplayName)); } if ((_getInt(ServerItemAttributes.Location, tupleSource) & 374) != 0) { if (!tupleSource.GetValue <bool>(ServerItemAttributes.Refineable)) { if (!description.Contains("Impossible to refine")) { description += "\r\nImpossible to refine this item."; } } if (tupleSource.GetValue <bool>(ServerItemAttributes.Refineable)) { if (description.Contains("Impossible to refine")) { description = description.Replace("Impossible to refine this item.", "").Trim('\r', '\n'); } } } _autoAdd(ServerItemAttributes.Defense, ParameterHolderKeys.Defense, tupleSource, holder); _autoAddEquippedOn(ServerItemAttributes.Location, ParameterHolderKeys.Location, tupleSource, holder); _autoAddWeight(tupleSource, holder); _autoAddJob(tupleSource, holder, _getInt(equipLevelAttribute, tupleSource)); break; case TypeType.Card: holder.Values[ParameterHolderKeys.Class] = "Card"; _autoAddCompound(ServerItemAttributes.Location, ParameterHolderKeys.CompoundOn, tupleSource, holder); _autoAdd(equipLevelAttribute, ParameterHolderKeys.RequiredLevel, tupleSource, holder, 1); _autoAddWeight(tupleSource, holder); if (!item.GetValue <bool>(ClientItemAttributes.IsCard)) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, ClientItemAttributes.IsCard, true)); } if (String.IsNullOrEmpty(item.GetValue <string>(ClientItemAttributes.Illustration))) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, ClientItemAttributes.Illustration, "sorry")); } if (String.IsNullOrEmpty(item.GetValue <string>(ClientItemAttributes.Affix))) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, ClientItemAttributes.Affix, tupleSource.GetValue <string>(ServerItemAttributes.Name))); } const string CardResource = "À̸§¾ø´ÂÄ«µå"; unDisplayName = tupleSource.GetValue <string>(ServerItemAttributes.Name); attribute = ClientItemAttributes.UnidentifiedDisplayName; if (_emptyFill(attribute, item) && ProjectConfiguration.AutocompleteUnDisplayName && _isNotNullDifferent(unDisplayName, attribute, item)) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, attribute, unDisplayName)); } unidentifiedResourceName = EncodingService.FromAnyToDisplayEncoding(CardResource); attribute = ClientItemAttributes.UnidentifiedResourceName; if (_emptyFill(attribute, item) && ProjectConfiguration.AutocompleteUnResourceName && _isNotNullDifferent(unidentifiedResourceName, attribute, item)) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, attribute, unidentifiedResourceName)); } attribute = ClientItemAttributes.IdentifiedResourceName; if (_emptyFill(attribute, item) && ProjectConfiguration.AutocompleteIdResourceName && _isNotNullDifferent(unidentifiedResourceName, attribute, item)) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, attribute, unidentifiedResourceName)); } break; case TypeType.PetEgg: holder.Values[ParameterHolderKeys.Class] = "Monster Egg"; _autoAddWeight(tupleSource, holder); break; case TypeType.PetEquip: holder.Values[ParameterHolderKeys.Class] = "Cute Pet Armor"; _autoAddWeight(tupleSource, holder); int id = item.GetKey <int>(); List <ReadableTuple <int> > tuples = pet1.Table.Tuples.Where(p => p.Value.GetValue <int>(ServerPetAttributes.EquipId) == id).Select(p => p.Value).Concat( pet2.Table.Tuples.Where(p => p.Value.GetValue <int>(ServerPetAttributes.EquipId) == id).Select(p => p.Value) ).ToList(); if (tuples.Count > 0) { // Try to retrieve the names List <string> values = new List <string>(); foreach (ReadableTuple <int> tuple in tuples) { var pid = tuple.GetKey <int>(); var pTuple = mobDb2.Table.TryGetTuple(pid) ?? mobDb1.Table.TryGetTuple(pid); if (pTuple != null) { values.Add(pTuple.GetValue <string>(ServerMobAttributes.KRoName)); } } if (values.Count > 0) { holder.Values[ParameterHolderKeys.ApplicablePet] = String.Join(", ", values.ToArray()); } } break; case TypeType.UsableItem: _autoAddPet(tupleSource, holder); _autoAddWeight(tupleSource, holder); _autoAddJobIfRestricted(tupleSource, holder); break; case TypeType.EtcItem: case TypeType.HealingItem: case TypeType.ShadowEquip: case TypeType.UsableWithDelayed: case TypeType.UsableWithDelayed2: _autoAddWeight(tupleSource, holder); _autoAddJobIfRestricted(tupleSource, holder); break; } _autoAdd(equipLevelAttribute, ParameterHolderKeys.RequiredLevel, tupleSource, holder, 1); holder.Values[ParameterHolderKeys.Description] = description == "" ? ProjectConfiguration.AutocompleteDescNotSet : description; var idDescription = holder.GenerateDescription(); if (ProjectConfiguration.AutocompleteIdDescription) { if (idDescription != item.GetValue <string>(ClientItemAttributes.IdentifiedDescription)) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, ClientItemAttributes.IdentifiedDescription, idDescription)); } } var unDescription = item.GetValue <string>(ClientItemAttributes.UnidentifiedDescription); // unidentified switch (tupleSource.GetValue <TypeType>(ServerItemAttributes.Type)) { case TypeType.Ammo: case TypeType.EtcItem: case TypeType.HealingItem: case TypeType.PetEgg: case TypeType.UsableItem: case TypeType.UsableWithDelayed: case TypeType.UsableWithDelayed2: if (ProjectConfiguration.AutocompleteUnDescription && unDescription != idDescription) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, ClientItemAttributes.UnidentifiedDescription, idDescription)); } string unDisplayName = tupleSource.GetValue <string>(ServerItemAttributes.Name); attribute = ClientItemAttributes.UnidentifiedDisplayName; if (_emptyFill(attribute, item) && ProjectConfiguration.AutocompleteUnDisplayName && _isNotNullDifferent(unDisplayName, attribute, item)) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, attribute, unDisplayName)); } string unidentifiedResourceName = item.GetValue <string>(ClientItemAttributes.IdentifiedResourceName); if (String.IsNullOrEmpty(unidentifiedResourceName)) { unidentifiedResourceName = EncodingService.FromAnyToDisplayEncoding("Á¶°¢ÄÉÀÌÅ©"); // Cake } attribute = ClientItemAttributes.UnidentifiedResourceName; if (_emptyFill(attribute, item) && ProjectConfiguration.AutocompleteUnResourceName && _isNotNullDifferent(unidentifiedResourceName, attribute, item)) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, attribute, unidentifiedResourceName)); } attribute = ClientItemAttributes.IdentifiedResourceName; if (_emptyFill(attribute, item) && ProjectConfiguration.AutocompleteIdResourceName && _isNotNullDifferent(unidentifiedResourceName, attribute, item)) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, attribute, unidentifiedResourceName)); } break; case TypeType.Card: if (ProjectConfiguration.AutocompleteUnDescription && unDescription != idDescription) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, ClientItemAttributes.UnidentifiedDescription, idDescription)); } break; default: if (ProjectConfiguration.AutocompleteUnDescription && unDescription != ProjectConfiguration.AutocompleteUnDescriptionFormat) { commands.Add(new ChangeTupleProperty <TKey, ReadableTuple <TKey> >(item, ClientItemAttributes.UnidentifiedDescription, ProjectConfiguration.AutocompleteUnDescriptionFormat)); } break; } if (commands.Commands.Count == 0) { return(null); } return(commands); }
private bool Similar(MethodInfo method, params Type[] TypeType) { Dictionary <string, string> NullableD = null; return(Similar(method, true, ref NullableD, TypeType.Select(x => x.ToString()).ToArray())); }
public Mon(TypeType newTypeType, Attack1Type newAttack1Type, Attack2Type newAttack2Type) { currentTypeType = newTypeType; currentAttack1Type = newAttack1Type; currentAttack2Type = newAttack2Type; }
//used by Bridge.stdn_any public NType() { //xxx should I use BUILTIN instead? _type = TypeType.MANUAL; }
public NType(IInterface face) { _type = TypeType.INTERFACE; _face = face; }
private void UpdateContext(Solution solution, Project project, Compilation compilation, ReflectionCache reflectionCache) { Solution = solution; Project = project; Compilation = compilation; SymbolNames = new SymbolNameMap(new Dictionary <ISymbol, string>());//SymbolNameCompiler.CompileSymbolNames(project, compilation); ReflectionCache = reflectionCache; // var diagnostics = compilation.GetDiagnostics(); // var mscorlib = compilation.GetReferencedAssemblySymbol(project.MetadataReferences.First()); // var typeNames = mscorlib.TypeNames.OrderBy(x => x).ToArray(); ObjectToString = compilation.ObjectType.GetMembers("ToString").OfType <IMethodSymbol>().Single(); String = compilation.FindType("System.String"); SpecialFunctions = compilation.FindType("System.Runtime.WootzJs.SpecialFunctions"); DefaultOf = SpecialFunctions.GetMethod("DefaultOf"); Char = compilation.FindType("System.Char"); Byte = compilation.FindType("System.Byte"); Int16 = compilation.FindType("System.Int16"); Int32 = compilation.FindType("System.Int32"); Int64 = compilation.FindType("System.Int64"); SByte = compilation.FindType("System.SByte"); UInt16 = compilation.FindType("System.UInt16"); UInt32 = compilation.FindType("System.UInt32"); UInt64 = compilation.FindType("System.UInt64"); Single = compilation.FindType("System.Single"); Double = compilation.FindType("System.Double"); Decimal = compilation.FindType("System.Decimal"); Exception = compilation.FindType("System.Exception"); InternalInit = Exception.GetMethodByName("InternalInit"); Assembly = compilation.FindType("System.Reflection.Assembly"); AssemblyConstructor = Assembly.InstanceConstructors.Single(); JsAttributeType = compilation.FindType("System.Runtime.WootzJs.JsAttribute"); PrecedesAttribute = compilation.FindType("System.Runtime.WootzJs.DependsOnAttribute"); ObjectType = compilation.FindType("System.Object"); GetType = ObjectType.GetMethod("GetType"); ObjectReferenceEquals = (IMethodSymbol)ObjectType.GetMembers("ReferenceEquals").Single(); ObjectCast = (IMethodSymbol)SpecialFunctions.GetMembers("ObjectCast").Single(); ObjectCreateDelegate = (IMethodSymbol)SpecialFunctions.GetMembers("CreateDelegate").Single(); TypeType = compilation.FindType("System.Type"); TypeArray = compilation.CreateArrayTypeSymbol(TypeType); TypeConstructor = TypeType.InstanceConstructors.Single(); TypeInit = (IMethodSymbol)TypeType.GetMembers("Init").Single(); CreateTypeParameter = (IMethodSymbol)TypeType.GetMembers("CreateTypeParameter").Single(); TypeIsInstanceOfType = (IMethodSymbol)TypeType.GetMembers("IsInstanceOfType").Single(); Type_GetTypeFromTypeFunc = (IMethodSymbol)TypeType.GetMembers("_GetTypeFromTypeFunc").Single(); GetField = TypeType.GetMethod("GetField", String); GetProperty = TypeType.GetMethod("GetProperty", String); GetMethod = TypeType.GetMethod("GetMethod", String, TypeArray); GetConstructor = TypeType.GetMethod("GetConstructor", TypeArray); AsExtensionType = compilation.FindType("System.Runtime.WootzJs.AsExtension"); JsniType = compilation.FindType("System.Runtime.WootzJs.Jsni"); EnumType = compilation.FindType("System.Enum"); EnumGetValue = EnumType.GetMethod("GetValue"); EnumInternalToObject = EnumType.GetMethod("InternalToObject"); Enumerable = compilation.FindType("System.Collections.IEnumerable"); EnumerableGeneric = compilation.FindType("System.Collections.Generic.IEnumerable`1"); Enumerator = compilation.FindType("System.Collections.IEnumerator"); EnumerableGetEnumerator = (IMethodSymbol)Enumerable.GetMembers("GetEnumerator").Single(); EnumeratorCurrent = (IPropertySymbol)Enumerator.GetMembers("Current").Single(); EnumeratorMoveNext = (IMethodSymbol)Enumerator.GetMembers("MoveNext").Single(); DelegateType = compilation.FindType("System.Delegate"); DelegateTypeConstructor = DelegateType.InstanceConstructors.Single(); DelegateTarget = (IPropertySymbol)DelegateType.GetMembers("Target").Single(); DelegateCombine = DelegateType.GetMembers("Combine").OfType <IMethodSymbol>().Single(x => x.Parameters.Count() == 2 && x.Parameters.All(y => Equals(y.Type, DelegateType))); DelegateRemove = DelegateType.GetMembers("Remove").OfType <IMethodSymbol>().Single(x => x.Parameters.Count() == 2 && x.Parameters.All(y => Equals(y.Type, DelegateType))); MulticastDelegateType = compilation.FindType("System.MulticastDelegate"); MulticastDelegateConstructor = MulticastDelegateType.InstanceConstructors.Single(x => x.Parameters.Last().Type.TypeKind == TypeKind.ArrayType); NullableType = compilation.FindType("System.Nullable`1"); CharNullable = NullableType.Construct(Char); NullableHasValue = (IPropertySymbol)NullableType.GetMembers("HasValue").Single(); NullableValue = (IPropertySymbol)NullableType.GetMembers("Value").Single(); NullableGetValueOrDefault = (IMethodSymbol)NullableType.GetMembers("GetValueOrDefault").Single(); FieldInfo = compilation.FindType("System.Reflection.FieldInfo"); MethodInfo = compilation.FindType("System.Reflection.MethodInfo"); MemberInfo = compilation.FindType("System.Reflection.MemberInfo"); PropertyInfo = compilation.FindType("System.Reflection.PropertyInfo"); EventInfo = compilation.FindType("System.Reflection.EventInfo"); ConstructorInfo = compilation.FindType("System.Reflection.ConstructorInfo"); Attribute = compilation.FindType("System.Attribute"); FieldInfoConstructor = FieldInfo.InstanceConstructors.Single(); MethodInfoConstructor = MethodInfo.InstanceConstructors.Single(); ParameterInfo = compilation.FindType("System.Reflection.ParameterInfo"); ParameterInfoConstructor = ParameterInfo.InstanceConstructors.Single(); PropertyInfoConstructor = PropertyInfo.InstanceConstructors.Single(); EventInfoConstructor = EventInfo.InstanceConstructors.Single(); ConstructorInfoConstructor = ConstructorInfo.InstanceConstructors.Single(); TypeAttributes = compilation.FindType("System.Reflection.TypeAttributes"); TypeAttributesPublic = (IFieldSymbol)TypeAttributes.GetMembers("Public").Single(); TypeAttributesNotPublic = (IFieldSymbol)TypeAttributes.GetMembers("NotPublic").Single(); TypeAttributesNestedPublic = (IFieldSymbol)TypeAttributes.GetMembers("NestedPublic").Single(); TypeAttributesNestedPrivate = (IFieldSymbol)TypeAttributes.GetMembers("NestedPrivate").Single(); TypeAttributesNestedFamily = (IFieldSymbol)TypeAttributes.GetMembers("NestedFamily").Single(); TypeAttributesNestedAssembly = (IFieldSymbol)TypeAttributes.GetMembers("NestedAssembly").Single(); TypeAttributesNestedFamANDAssem = (IFieldSymbol)TypeAttributes.GetMembers("NestedFamANDAssem").Single(); TypeAttributesNestedFamORAssem = (IFieldSymbol)TypeAttributes.GetMembers("NestedFamORAssem").Single(); TypeAttributesAbstract = (IFieldSymbol)TypeAttributes.GetMembers("Abstract").Single(); TypeAttributesSealed = (IFieldSymbol)TypeAttributes.GetMembers("Sealed").Single(); TypeAttributesClass = (IFieldSymbol)TypeAttributes.GetMembers("Class").Single(); TypeAttributesInterface = (IFieldSymbol)TypeAttributes.GetMembers("Interface").Single(); FieldAttributes = compilation.FindType("System.Reflection.FieldAttributes"); FieldAttributesPublic = (IFieldSymbol)FieldAttributes.GetMembers("Public").Single(); FieldAttributesPrivate = (IFieldSymbol)FieldAttributes.GetMembers("Private").Single(); FieldAttributesFamily = (IFieldSymbol)FieldAttributes.GetMembers("Family").Single(); FieldAttributesAssembly = (IFieldSymbol)FieldAttributes.GetMembers("Assembly").Single(); FieldAttributesFamORAssem = (IFieldSymbol)FieldAttributes.GetMembers("FamORAssem").Single(); FieldAttributesStatic = (IFieldSymbol)FieldAttributes.GetMembers("Static").Single(); FieldAttributesInitOnly = (IFieldSymbol)FieldAttributes.GetMembers("InitOnly").Single(); FieldAttributesLiteral = (IFieldSymbol)FieldAttributes.GetMembers("Literal").Single(); MethodAttributes = compilation.FindType("System.Reflection.MethodAttributes"); MethodAttributesPublic = (IFieldSymbol)MethodAttributes.GetMembers("Public").Single(); MethodAttributesPrivate = (IFieldSymbol)MethodAttributes.GetMembers("Private").Single(); MethodAttributesFamily = (IFieldSymbol)MethodAttributes.GetMembers("Family").Single(); MethodAttributesAssembly = (IFieldSymbol)MethodAttributes.GetMembers("Assembly").Single(); MethodAttributesFamORAssem = (IFieldSymbol)MethodAttributes.GetMembers("FamORAssem").Single(); MethodAttributesStatic = (IFieldSymbol)MethodAttributes.GetMembers("Static").Single(); ParameterAttributes = compilation.FindType("System.Reflection.ParameterAttributes"); ParameterAttributesOut = (IFieldSymbol)ParameterAttributes.GetMembers("Out").Single(); ParameterAttributesHasDefault = (IFieldSymbol)ParameterAttributes.GetMembers("HasDefault").Single(); ParameterAttributesNone = (IFieldSymbol)ParameterAttributes.GetMembers("None").Single(); JsFunction = compilation.FindType("System.Runtime.WootzJs.JsFunction"); IDisposable = compilation.FindType("System.IDisposable"); IDisposableDispose = (IMethodSymbol)IDisposable.GetMembers("Dispose").Single(); Expression = compilation.FindType("System.Linq.Expressions.Expression"); ExpressionGeneric = compilation.FindType("System.Linq.Expressions.Expression`1"); ExpressionArray = compilation.CreateArrayTypeSymbol(Expression); ExpressionType = compilation.FindType("System.Linq.Expressions.ExpressionType"); ExpressionLambda = compilation.FindType("System.Linq.Expressions.Expression`1"); ParameterExpression = compilation.FindType("System.Linq.Expressions.ParameterExpression"); ParameterExpressionArray = compilation.CreateArrayTypeSymbol(ParameterExpression); NewExpression = compilation.FindType("System.Linq.Expressions.NewExpression"); MemberBinding = compilation.FindType("System.Linq.Expressions.MemberBinding"); MemberBindingArray = compilation.CreateArrayTypeSymbol(MemberBinding); ElementInit = compilation.FindType("System.Linq.Expressions.ElementInit"); ElementInitArray = compilation.CreateArrayTypeSymbol(ElementInit); Constant = compilation.FindType("System.Linq.Expressions.ConstantExpression"); Action = compilation.FindType("System.Action"); ActionT = compilation.FindType("System.Action`1"); Func = compilation.FindType("System.Func`1"); JsObject = compilation.FindType("System.Runtime.WootzJs.JsObject"); JsString = compilation.FindType("System.Runtime.WootzJs.JsString"); SafeToString = SpecialFunctions.GetMembers("SafeToString").OfType <IMethodSymbol>().Single(); Array = compilation.FindType("System.Array"); INotifyPropertyChanged = compilation.FindType("System.ComponentModel.INotifyPropertyChanged"); Task = compilation.FindType("System.Threading.Tasks.Task"); TaskT = compilation.FindType("System.Threading.Tasks.Task`1"); TaskAwaiter = compilation.FindType("System.Runtime.CompilerServices.TaskAwaiter"); TaskAwaiterT = compilation.FindType("System.Runtime.CompilerServices.TaskAwaiter`1"); Nop = compilation.FindType("System.Runtime.CompilerServices.Op").GetMethod("Nothing"); AsyncVoidMethodBuilder = compilation.FindType("System.Runtime.CompilerServices.AsyncVoidMethodBuilder"); AsyncVoidMethodBuilderCreate = AsyncVoidMethodBuilder.GetMethod("Create"); AsyncVoidMethodBuilderStart = AsyncVoidMethodBuilder.GetMethod("Start"); AsyncTaskMethodBuilder = compilation.FindType("System.Runtime.CompilerServices.AsyncTaskMethodBuilder"); AsyncTaskMethodBuilderCreate = AsyncTaskMethodBuilder.GetMethod("Create"); AsyncTaskMethodBuilderStart = AsyncTaskMethodBuilder.GetMethod("Start"); AsyncTaskTMethodBuilder = compilation.FindType("System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1"); AsyncTaskTMethodBuilderCreate = AsyncTaskTMethodBuilder.GetMethod("Create"); AsyncTaskTMethodBuilderStart = AsyncTaskTMethodBuilder.GetMethod("Start"); CallerMemberNameAttribute = compilation.FindType("System.Runtime.CompilerServices.CallerMemberNameAttribute"); CultureInfo = compilation.FindType("System.Globalization.CultureInfo"); InvalidOperationException = compilation.FindType("System.InvalidOperationException"); InvalidOperationExceptionStringConstructor = InvalidOperationException.Constructors.Single(x => x.Parameters.Count() == 1 && x.Parameters.First().Type == String); IAsyncStateMachine = compilation.FindType("System.Runtime.CompilerServices.IAsyncStateMachine"); IAsyncStateMachineMoveNext = IAsyncStateMachine.GetMethodByName("MoveNext"); IAsyncStateMachineSetStateMachine = IAsyncStateMachine.GetMethodByName("SetStateMachine"); IEnumerator = compilation.FindType("System.Collections.IEnumerator"); IEnumerable = compilation.FindType("System.Collections.IEnumerable"); IEnumeratorT = compilation.FindType("System.Collections.Generic.IEnumerator`1"); IEnumerableT = compilation.FindType("System.Collections.Generic.IEnumerable`1"); IEnumeratorCurrent = (IPropertySymbol)IEnumerator.GetMembers("Current").Single(); IEnumeratorMoveNext = (IMethodSymbol)IEnumerator.GetMembers("MoveNext").Single(); IEnumeratorReset = (IMethodSymbol)IEnumerator.GetMembers("Reset").Single(); IEnumerableGetEnumerator = (IMethodSymbol)IEnumerable.GetMembers("GetEnumerator").Single(); IEnumeratorTCurrent = (IPropertySymbol)IEnumeratorT.GetMembers("Current").Single(); IEnumerableTGetEnumerator = (IMethodSymbol)IEnumerableT.GetMembers("GetEnumerator").Single(); YieldIterator = compilation.FindType("System.YieldIterator`1"); YieldIteratorClone = YieldIterator.GetMethodByName("Clone"); YieldIteratorDoMoveNext = YieldIterator.GetMethodByName("DoMoveNext"); // IAutoNotifyPropertyChanged = compilation.FindType("System.Runtime.WootzJs.IAutoNotifyPropertyChanged"); // NotifyPropertyChanged = IAutoNotifyPropertyChanged.GetMethod("NotifyPropertyChanged"); }
static Filler() { DBC.ECS.Check.Require(TypeType.isUnmanaged <T>() == true, "invalid type used"); }
public Mon( TypeType newTypeType, Attack1Type newAttack1Type, Attack2Type newAttack2Type ) { currentTypeType = newTypeType; currentAttack1Type = newAttack1Type; currentAttack2Type = newAttack2Type; }
string FormatTypeType(TypeType typeType) { switch (typeType) { case TypeType.Command: return "Domain commands"; case TypeType.Other: return "Domain primitives"; case TypeType.Primitive: return "Built-in primitives"; default: return typeType.ToString(); } }
static SLFunc MetadataFuncForType(PlatformName platform, TypeDefinition type, TypeType entityType) { var name = type.Name; var moduleName = type.Namespace; // typename based on C# type name, not remapped name var funcID = new SLIdentifier(FuncIDForTypeDefinition(type)); TypeAggregator.RemapModuleAndName(platform, ref moduleName, ref name, entityType); var value = new SLIdentifier($"{name}.self"); var returnLine = SLReturn.ReturnLine(value); var body = new SLCodeBlock(null); body.Add(returnLine); var func = new SLFunc(Visibility.Public, new SLSimpleType("Any.Type"), funcID, null, body); new SLComment(type.FullName, true).AttachBefore(func); var attr = AvailableAttributeForType(platform, type); if (attr != null) { attr.AttachBefore(func); } return(func); }
public JobState(TypeType type, UserActionCauseObject user_action_cause, DeviceStateCauseObject device_state_cause, DeviceActionCauseObject device_action_cause, ServiceActionCauseObject service_action_cause) { }
protected override void handle_result(TypeType result) { top.value.Add(result); }
protected override void handle_result(TypeType result) { //@@@ Debug.Assert(!have_value); have_value = true; value = result; }