internal Symbol(AdsSymbolEntry entry, ISymbol parent, ISymbolFactoryServices factoryServices) { this.accessRights = SymbolAccessRights.All; if (entry == null) { throw new ArgumentNullException("entry"); } if (factoryServices == null) { throw new ArgumentNullException("factoryServices"); } this.factoryServices = factoryServices; this.indexGroup = entry.indexGroup; this.indexOffset = entry.indexOffset; base.comment = entry.comment; base.dataTypeId = (AdsDatatypeId)entry.dataType; base.category = DataTypeCategory.Unknown; this.parent = parent; base.instanceName = this.getInstanceName(entry.name); this.instancePath = this.getInstancePath(entry.name); base.size = (int)entry.size; base.typeName = entry.type; base.resolvedDataType = null; base.flags = entry.flags; if (entry.attributeCount > 0) { base.attributes = new TypeAttributeCollection(entry.attributes); } }
internal Instance(AdsSymbolEntry symbol) { this.comment = symbol.comment; this.instanceName = symbol.name; this.size = (int)symbol.size; this.typeName = AlignTypeName(symbol.type); this.dataTypeId = (AdsDatatypeId)symbol.dataType; this.flags = symbol.flags; if ((symbol.attributeCount > 0) && (symbol.attributes != null)) { this.attributes = new TypeAttributeCollection(symbol.attributes); } }
internal Symbol(AdsSymbolEntry entry, IDataType type, ISymbol parent, ISymbolFactoryServices factoryServices) : this(entry, parent, factoryServices) { base.category = type.Category; base.resolvedDataType = type; if ((base.attributes != null) && (base.attributes.Count >= 2)) { ISubRangeType subRange = null; if (TryParseSubRange(type, base.attributes, factoryServices.Binder, out subRange)) { base.category = subRange.Category; base.resolvedDataType = subRange; } } }
internal ReferenceInstance(AdsSymbolEntry entry, IReferenceType type, ISymbol parent, ISymbolFactoryServices factoryServices) : base(entry, type, parent, factoryServices) { base.category = DataTypeCategory.Reference; }
internal StructInstance(AdsSymbolEntry entry, IStructType type, ISymbol parent, ISymbolFactoryServices factoryServices) : base(entry, type, parent, factoryServices) { base.category = DataTypeCategory.Struct; }
internal PointerInstance(AdsSymbolEntry entry, IPointerType type, ISymbol parent, ISymbolFactoryServices factoryServices) : base(entry, type, parent, factoryServices) { base.category = DataTypeCategory.Pointer; }
internal TcAdsSymbolInfo(AdsParseSymbols symbolParser, TcAdsSymbolInfo parent, int subIndex, AdsSymbolEntry symbolEntry, TcAdsDataType typeEntry) : this(symbolParser, parent, subIndex) { if (symbolEntry == null) { throw new ArgumentNullException("symbolEntry"); } this.indexGroup = symbolEntry.indexGroup; this.indexOffset = symbolEntry.indexOffset; this.size = symbolEntry.size; this.dataTypeId = (AdsDatatypeId)symbolEntry.dataType; if (typeEntry != null) { this.typeEntryFlags = typeEntry.Flags; } if (this.typeEntryFlags.HasFlag(AdsDataTypeFlags.None | AdsDataTypeFlags.Static)) { this.indexGroup = 0xf019; this.indexOffset = 0; } this.flags = symbolEntry.flags; this.instancePath = symbolEntry.name; this.shortName = symbolEntry.name; this.typeName = symbolEntry.type; this.comment = symbolEntry.comment; this.dataType = typeEntry; if (((symbolEntry.array != null) || (typeEntry == null)) || !typeEntry.IsArray) { this.arrayInfo = symbolEntry.array; } else { this.arrayInfo = typeEntry.Dimensions.ToArray(); if (typeEntry.Size != this.size) { this.size = (uint)typeEntry.Size; } } if (symbolEntry.attributes != null) { this.attributes = new TypeAttributeCollection(symbolEntry.attributes).AsReadOnly(); } else { this.attributes = null; } }
internal ArrayInstance(AdsSymbolEntry entry, IArrayType type, ISymbol parent, ISymbolFactoryServices factoryServices) : base(entry, type, parent, factoryServices) { base.category = DataTypeCategory.Array; }
internal RpcStructInstance(AdsSymbolEntry entry, RpcStructType structRpcCallable, ISymbol parent, ISymbolFactoryServices services) : base(entry, structRpcCallable, parent, services) { }
internal UnionInstance(AdsSymbolEntry entry, IUnionType type, ISymbol parent, ISymbolFactoryServices factoryServices) : base(entry, type, parent, factoryServices) { base.category = DataTypeCategory.Union; }
private static ISymbol ParseSymbol(AdsBinaryReader symbolReader, Encoding encoding, ISymbolFactoryServices factoryServices) { AdsSymbolEntry entry = new AdsSymbolEntry(-1L, encoding, symbolReader); return(factoryServices.SymbolFactory.CreateInstance(entry, null)); }