public ID3v1Tag(byte[] bytes) { if (bytes.Length < TagLength || Encoding.ASCII.GetString(bytes, bytes.Length - TagLength, 3) != "TAG") throw new InvalidDataException("No ID3 tag found"); ArraySegment<byte> tag = new ArraySegment<byte>(bytes, bytes.Length - TagLength, TagLength); _title = Encoding.ASCII.GetString(tag.Array, tag.Offset + TitleOffset, MaxFieldLength).TrimEnd('\0'); _artist = Encoding.ASCII.GetString(tag.Array, tag.Offset + ArtistOffset, MaxFieldLength).TrimEnd('\0'); _album = Encoding.ASCII.GetString(tag.Array, tag.Offset + AlbumOffset, MaxFieldLength).TrimEnd('\0'); short year; if (short.TryParse(Encoding.ASCII.GetString(tag.Array, tag.Offset + YearOffset, 4), out year)) _year = year; if (tag.Array[tag.Offset + TrackOffset - 1] == 0) { _comment = Encoding.ASCII.GetString(tag.Array, tag.Offset + CommentOffset, MaxFieldLength - 2).TrimEnd('\0'); _track = tag.Array[tag.Offset + TrackOffset]; } else { _comment = Encoding.ASCII.GetString(tag.Array, tag.Offset + CommentOffset, MaxFieldLength).TrimEnd('\0'); } Genre = (Genre)tag.Array[tag.Offset + GenreOffset]; }
public void Read(TProtocol iprot) { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.I16) { MVal = iprot.ReadI16(); } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); }
public Reproduce(string children = null, double densityRadius = 10, int densityMax = 5, Cooldown coolDown = new Cooldown()) { this.children = children == null ? null : (short?)XmlDatas.IdToType[children]; this.densityRadius = densityRadius; this.densityMax = densityMax; this.coolDown = coolDown.Normalize(60000); }
public void Load(IVisio.Application app) { var app_settings = app.Settings; this.LiveDynamics = app.LiveDynamics; this.EnableAutoConnect = app_settings.EnableAutoConnect; this.DeferRecalc = app.DeferRecalc; this.ScreenUpdating = app.ScreenUpdating; }
public static void CheckUnaryDecrementNullableShortTest(bool useInterpreter) { short?[] values = new short?[] { null, 0, 1, -1, short.MinValue, short.MaxValue }; for (int i = 0; i < values.Length; i++) { VerifyDecrementNullableShort(values[i], useInterpreter); } }
public static void CheckUnaryIncrementNullableShortTest() { short?[] values = new short?[] { null, 0, 1, -1, short.MinValue, short.MaxValue }; for (int i = 0; i < values.Length; i++) { VerifyIncrementNullableShort(values[i]); } }
internal V_SXAB(SeamlessViewsContext Context, SXAB SXAB) : base(Context) { _SXAB_ID = SXAB.SXAB_ID; _ABSENCE_DATE = SXAB.ABSENCE_DATE; _STKEY = SXAB.STKEY; _AM_ACT_TYPE = SXAB.AM_ACT_TYPE; _PM_ACT_TYPE = SXAB.PM_ACT_TYPE; }
internal V_SCL(SeamlessViewsContext Context, SCL SCL) : base(Context) { _SCLKEY = SCL.SCLKEY; _SUBJECT = SCL.SUBJECT; _CLASS = SCL.CLASS; _TEACHER01 = SCL.TEACHER01; _ROOM01 = SCL.ROOM01; }
internal V_SM(SeamlessViewsContext Context, SM SM) : base(Context) { _ROOM = SM.ROOM; _TITLE = SM.TITLE; _DESCRIPTION = SM.DESCRIPTION; _SEATING = SM.SEATING; _FACULTY = SM.FACULTY; }
internal V_STMA(SeamlessViewsContext Context, STMA STMA) : base(Context) { _SKEY = STMA.SKEY; _MKEY = STMA.MKEY; _CLASS = STMA.CLASS; _FULLNAME = STMA.FULLNAME; _TEACHER_NAME = STMA.TEACHER_NAME; _TTPERIOD = STMA.TTPERIOD; }
public Orbit(double speed, double radius, double acquireRange = 10, string target = null, double? speedVariance = null, double? radiusVariance = null) { this.speed = (float)speed; this.radius = (float)radius; this.acquireRange = (float)acquireRange; this.target = target == null ? null : (short?)XmlDatas.IdToType[target]; this.speedVariance = (float)(speedVariance ?? speed * 0.1); this.radiusVariance = (float)(radiusVariance ?? speed * 0.1); }
public ID3v1Tag() { _title = String.Empty; _artist = String.Empty; _album = String.Empty; _year = null; _comment = String.Empty; _track = null; Genre = Genre.None; }
public static void CheckNullableShortAndTest(bool useInterpreter) { short?[] array = new short?[] { null, 0, 1, -1, short.MinValue, short.MaxValue }; for (int i = 0; i < array.Length; i++) { for (int j = 0; j < array.Length; j++) { VerifyNullableShortAnd(array[i], array[j], useInterpreter); } } }
protected override void ReadFromReader(MarkingBinaryReader reader) { if (EndArchiveFlags_HasFlag( EndArchiveFlags.EARC_DATACRC)) { ArchiveCRC = reader.ReadInt32(); } if (EndArchiveFlags_HasFlag(EndArchiveFlags.EARC_VOLNUMBER)) { VolumeNumber = reader.ReadInt16(); } }
public static void LambdaModuloNullableShortTest() { short?[] values = new short?[] { null, 0, 1, -1, short.MinValue, short.MaxValue }; for (int i = 0; i < values.Length; i++) { for (int j = 0; j < values.Length; j++) { VerifyModuloNullableShort(values[i], values[j]); } } }
public static void CheckLiftedBitwiseExclusiveOrNullableShortTest(bool useInterpreter) { short?[] values = new short?[] { null, 0, 1, -1, short.MinValue, short.MaxValue }; for (int i = 0; i < values.Length; i++) { for (int j = 0; j < values.Length; j++) { VerifyBitwiseExclusiveOrNullableShort(values[i], values[j], useInterpreter); } } }
public static void CheckNullableShortPowerTest() { short?[] array = new short?[] { null, 0, 1, -1, short.MinValue, short.MaxValue }; for (int i = 0; i < array.Length; i++) { for (int j = 0; j < array.Length; j++) { VerifyNullableShortPower(array[i], array[j]); } } }
internal V_TXAS(SeamlessViewsContext Context, TXAS TXAS) : base(Context) { _CLASS = TXAS.CLASS; _DAY_NO = TXAS.DAY_NO; _LOCATION = TXAS.LOCATION; _PERIOD_NO = TXAS.PERIOD_NO; _SESSION_DATE = TXAS.SESSION_DATE; _SUBJECT = TXAS.SUBJECT; _TEACHER = TXAS.TEACHER; }
/// <summary> /// default constructor /// </summary> public ProductImage() { _imageid = 0; _productid = null; _imageurl = null; _width = 0; _height = 0; _alttext = null; _imagetype = 0; _inserttimestamp = DateTime.Now; _updatetimestamp = DateTime.Now; }
public static void LambdaSubtractNullableShortTest(bool useInterpreter) { short?[] values = new short?[] { null, 0, 1, -1, short.MinValue, short.MaxValue }; for (int i = 0; i < values.Length; i++) { for (int j = 0; j < values.Length; j++) { VerifySubtractNullableShort(values[i], values[j], useInterpreter); } } }
public static void CheckLiftedBitwiseAndNullableShortTest() { short?[] values = new short?[] { null, 0, 1, -1, short.MinValue, short.MaxValue }; for (int i = 0; i < values.Length; i++) { for (int j = 0; j < values.Length; j++) { VerifyBitwiseAndNullableShort(values[i], values[j]); } } }
public DlmCellData(short id) { Id = id; LosMov = 3; m_rawFloor = 0; m_floor = 0; Speed = 0; MapChangeData = 0; MoveZone = 0; _arrow = 0; }
public RecipeBrief(Recipe r) { this.Id = r.Id; this.OwnerId = r.OwnerId; this.Title = r.Title; this.Description = r.Description; this.ImageUrl = r.ImageUrl; this.Author = r.OwnerAlias; this.PrepTime = r.PrepTime; this.CookTime = r.CookTime; this.AvgRating = r.AvgRating; }
public void ReadPacket(IMinecraftStream stream) { X = stream.ReadInt32(); Y = stream.ReadInt8(); Z = stream.ReadInt32(); Face = (BlockFace)stream.ReadInt8(); ItemID = stream.ReadInt16(); if (ItemID != -1) { Amount = stream.ReadInt8(); Metadata = stream.ReadInt16(); } }
internal V_SU(SeamlessViewsContext Context, SU SU) : base(Context) { var KCY = SU.SUBJECT_ACADEMIC_YEAR_KCY; _SUKEY = SU.SUKEY; _SHORTNAME = SU.SHORTNAME; _FULLNAME = SU.FULLNAME; _OVERVIEW = SU.OVERVIEW; _FACULTY = SU.FACULTY; _SEMESTER = SU.SEMESTER; _SUBJECT_ACADEMIC_YEAR = SU.SUBJECT_ACADEMIC_YEAR; _DESCRIPTION = KCY.DESCRIPTION; }
public void ReadPacket(IMinecraftStream stream) { EntityID = stream.ReadInt32(); EntityType = stream.ReadInt8(); X = stream.ReadInt32(); Y = stream.ReadInt32(); Z = stream.ReadInt32(); Data = stream.ReadInt32(); if (Data > 0) { XVelocity = stream.ReadInt16(); YVelocity = stream.ReadInt16(); ZVelocity = stream.ReadInt16(); } }
/// <summary> /// default constructor /// </summary> public Category() { _categoryid = 0; _categoryname = null; _categorydescription = null; _parentcategoryid = null; _ispublished = true; _imageurl = null; _width = null; _height = null; _alttext = null; _cssClass = null; _inserttimestamp = DateTime.Now; _updatetimestamp = DateTime.Now; }
public CatLabRecord(RecordInputStream in1) { rt = in1.ReadShort(); grbitFrt = in1.ReadShort(); wOffset = in1.ReadShort(); at = in1.ReadShort(); grbit = in1.ReadShort(); // Often, but not always has an unused short at the end if (in1.Available() == 0) { unused = null; } else { unused = in1.ReadShort(); } }
private void button1_Click_2(object sender, EventArgs e) { string identifiant = txtIdentifiant.Text; string mp = txtMotDePasse.Text; int? nbUtil = 0; try { if (rdbEmploye.Checked == true) { nbUtil = queriesTableAdapter1.connectionUtilisateur(identifiant, mp); if (nbUtil != 0) { numUtilisateur = queriesTableAdapter1.getCodeUtilisateur(identifiant, mp); Frm_menuEmployer fd = new Frm_menuEmployer(numUtilisateur); fd.ShowDialog(); } } else { if (rdbAdministrateur.Checked) { nbUtil = queriesTableAdapter1.connectionAdmin(identifiant, mp); if (nbUtil != 0) { numUtilisateur = (short)queriesTableAdapter1.getCodeAdmin(identifiant, mp); Frm_AdminAcceuil fr = new Frm_AdminAcceuil(this.numUtilisateur); fr.ShowDialog(); } } } } catch (Exception ex) { MessageBox.Show(ex.Message); } if (nbUtil == 0) { labelER.Visible = true; labelER.Text = "Informations incorrectes.Veuillez recommencer."; labelER.ForeColor = Color.Red; } }
// stupid f*****g C# public Vertex(ABinaryReader binaryReader, bool useNBT, int uvCount, BatchAttributes attributes) : this() { MatrixIndex = null; PositionIndex = null; NormalIndex = null; BinormalIndex = null; TangentIndex = null; ColorIndex = new short?[2]; UVIndex = new short?[8]; if (attributes.HasFlag(BatchAttributes.Position)) { PositionIndex = binaryReader.ReadS16(); } if (attributes.HasFlag(BatchAttributes.Normal)) { NormalIndex = binaryReader.ReadS16(); if (useNBT) { BinormalIndex = binaryReader.ReadS16(); TangentIndex = binaryReader.ReadS16(); } } if (attributes.HasFlag(BatchAttributes.Color0)) { ColorIndex[0] = binaryReader.ReadS16(); } if (attributes.HasFlag(BatchAttributes.Color1)) { ColorIndex[1] = binaryReader.ReadS16(); } for (int texCoord = 0; texCoord < uvCount; texCoord++) { if (attributes.HasFlag((BatchAttributes)(1 << (13 + texCoord)))) { UVIndex[texCoord] = binaryReader.ReadS16(); } } }
public Product(short?deci, long?barcode, short?subsubcategoryId, int?brandId, float?commission, short?warrantyPeriod, WarrantyTypes?warrantyType, int?ıd, float?vatRate, short?expiry, string name, string[] properties, string cargoCorporation, string description) { Deci = deci; Barcode = barcode; SubsubcategoryId = subsubcategoryId; BrandId = brandId; Commission = commission; WarrantyPeriod = warrantyPeriod; WarrantyType = warrantyType; Id = ıd; VatRate = vatRate; Expiry = expiry; Name = name; Properties = properties; CargoCorporation = cargoCorporation; Description = description; }
internal static object NullCheck(short?value) { return(value ?? (object)DBNull.Value); }
internal override void vmethod_10(DxfModel model) { base.vmethod_10(model); DxfExtendedData extendedData; if (this.HasExtendedData && this.ExtendedDataCollection.TryGetValue(this.Model, "AcCmTransparency", out extendedData)) { IEnumerator <IExtendedDataValue> enumerator = (IEnumerator <IExtendedDataValue>) new DxfExtendedData.RecursiveEnumerator((IEnumerator <IExtendedDataValue>)extendedData.Values.GetEnumerator()); while (enumerator.MoveNext()) { DxfExtendedData.Int32 current = enumerator.Current as DxfExtendedData.Int32; if (current != null) { this.transparency_0 = new Transparency((uint)current.Value); if (this.transparency_0.TransparencyType != TransparencyType.ByValue) { this.transparency_0 = Transparency.Opaque; break; } break; } } } if (this.ExtensionDictionary == null) { return; } DxfXRecord valueByName1 = this.ExtensionDictionary.GetValueByName("ADSK_XREC_LAYER_COLOR_OVR") as DxfXRecord; if (valueByName1 != null) { List <DxfXRecordValue> .Enumerator enumerator = valueByName1.Values.GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.Current.Code == (short)102 && enumerator.Current.Value as string == "{ADSK_LYR_COLOR_OVERRIDE") { DxfViewport key = (DxfViewport)null; uint? nullable = new uint?(); while (enumerator.MoveNext() && (enumerator.Current.Code != (short)102 || !(enumerator.Current.Value as string == "}"))) { switch (enumerator.Current.Code) { case 335: key = enumerator.Current.Value as DxfViewport; continue; case 420: nullable = new uint?((uint)Convert.ToInt32(enumerator.Current.Value)); continue; default: continue; } } if (key != null && nullable.HasValue) { this.ViewportLayerOverridesNotNull.ViewportColorOverridesNotNull.Add(key, Color.smethod_0(nullable.Value)); } } } } DxfXRecord valueByName2 = this.ExtensionDictionary.GetValueByName("ADSK_XREC_LAYER_LINETYPE_OVR") as DxfXRecord; if (valueByName2 != null) { List <DxfXRecordValue> .Enumerator enumerator = valueByName2.Values.GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.Current.Code == (short)102 && enumerator.Current.Value as string == "{ADSK_LYR_LINETYPE_OVERRIDE") { DxfViewport key = (DxfViewport)null; DxfLineType dxfLineType = (DxfLineType)null; while (enumerator.MoveNext() && (enumerator.Current.Code != (short)102 || !(enumerator.Current.Value as string == "}"))) { switch (enumerator.Current.Code) { case 335: key = enumerator.Current.Value as DxfViewport; continue; case 343: dxfLineType = enumerator.Current.Value as DxfLineType; continue; default: continue; } } if (key != null && dxfLineType != null) { this.ViewportLayerOverridesNotNull.ViewportLineTypeOverridesNotNull.Add(key, dxfLineType); } } } } DxfXRecord valueByName3 = this.ExtensionDictionary.GetValueByName("ADSK_XREC_LAYER_LINEWT_OVR") as DxfXRecord; if (valueByName3 != null) { List <DxfXRecordValue> .Enumerator enumerator = valueByName3.Values.GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.Current.Code == (short)102 && enumerator.Current.Value as string == "{ADSK_LYR_LINEWT_OVERRIDE") { DxfViewport key = (DxfViewport)null; short? nullable = new short?(); while (enumerator.MoveNext() && (enumerator.Current.Code != (short)102 || !(enumerator.Current.Value as string == "}"))) { switch (enumerator.Current.Code) { case 91: nullable = new short?(Convert.ToInt16(enumerator.Current.Value)); continue; case 335: key = enumerator.Current.Value as DxfViewport; continue; default: continue; } } if (key != null && nullable.HasValue) { this.ViewportLayerOverridesNotNull.ViewportLineWeightOverridesNotNull.Add(key, nullable.Value); } } } } DxfXRecord valueByName4 = this.ExtensionDictionary.GetValueByName("ADSK_XREC_LAYER_ALPHA_OVR") as DxfXRecord; if (valueByName4 == null) { return; } List <DxfXRecordValue> .Enumerator enumerator1 = valueByName4.Values.GetEnumerator(); while (enumerator1.MoveNext()) { if (enumerator1.Current.Code == (short)102 && enumerator1.Current.Value as string == "{ADSK_LYR_ALPHA_OVERRIDE") { DxfViewport key = (DxfViewport)null; uint? nullable = new uint?(); while (enumerator1.MoveNext() && (enumerator1.Current.Code != (short)102 || !(enumerator1.Current.Value as string == "}"))) { switch (enumerator1.Current.Code) { case 335: key = enumerator1.Current.Value as DxfViewport; continue; case 440: nullable = new uint?((uint)Convert.ToInt32(enumerator1.Current.Value)); continue; default: continue; } } if (key != null && nullable.HasValue) { this.ViewportLayerOverridesNotNull.ViewportTransparencyOverridesNotNull.Add(key, new Transparency(nullable.Value)); } } } }
static void FromInt16() { Console.WriteLine("--- FromInt16"); short?[] a = new short?[] { new short?(), new short?(20), new short?(30) }; TestCore(a); }
internal short?NumberProperty(string propertyName, ref short?output) => output = this.NullableProperty <JsonNumber>(propertyName)?.ToShort() ?? null;
public static bool IsNotEmpty(this short?value, bool allowZero = false) { return(!IsEmpty(value, allowZero)); }
public IColumnValueAppender AddColumnValue(short? value) { _columnValues.Add(ResolveValueFor(value.HasValue ? Convert.ToString(value.Value, _formatProvider) : null)); return this; }
public short?CanConvertSmallIntsToNullableShort(short?x, short?y) { return((short)(x + y)); }
public void CanConvertIntToNullableShort(short?x) { Assert.That(x.HasValue); Assert.That(x.Value, Is.EqualTo(1)); }