public bool Run(string pathToParameter) { bool result = false; Navigation navigationArea = new Navigation(); result = navigationArea.SearchAndSelectParameter(pathToParameter); Application applicationArea = new Application(); Unknown element = applicationArea.SearchAndSelectParameter(pathToParameter); result &= applicationArea.IsParameterReadOnly(element); if (element != null) { if (result) { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "The parameter: " + " '" + pathToParameter + "' is read only."); } else { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "The parameter: " + " '" + pathToParameter + "' is not read only."); } } else { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "The parameter: " + " '" + pathToParameter + "' could not be found."); } return(result); }
public override string ToString() { var sb = new StringBuilder(); if (Unknown.Any()) { sb.Append(string.Join(", ", Unknown.Select(x => x.Name))); } if (Incoming.Any()) { if (sb.Length > 0) { sb.Append("; "); } sb.Append("Incoming: "); sb.Append(string.Join(", ", Incoming.Select(x => x.Name))); } if (Outgoing.Any()) { if (sb.Length > 0) { sb.Append("; "); } sb.Append("Outgoing: "); sb.Append(string.Join(", ", Outgoing.Select(x => x.Name))); } return(sb.ToString()); }
/// <summary> /// Метод для сбора файлов со Steam директории /// </summary> /// <param name="exp">Сбор файлов без расширений ( *." )</param> /// <param name="congfiles">Сбор файлов с config директории</param> /// <param name="name">Именная папка Config</param> /// <param name="proc">Имя процесса Стим</param> public static void Inizialize(string exp, string congfiles, string name, string proc) { // Проверяем путь к папке стим if (CombineEx.ExistsDir(SteamPath.GetLocationSteam())) { CombineEx.CreateOrDeleteDirectoryEx(true, CombineEx.CombinePath(GlobalPath.Steam_Dir, name), FileAttributes.Normal); CombineEx.CreateFile(false, GlobalPath.SteamID, SteamProfiles.GetSteamID()); // Закрываем процесс чтобы можно было скопировать файлы. ProcessControl.Closing(proc); try { // Проходимся циклом по файлам без расширения foreach (var Unknown in Directory.EnumerateFiles(SteamPath.GetLocationSteam(), exp).Where( // Проверяем файл Unknown => File.Exists(Unknown)).Where( // Обходим файл .crash Unknown => !Unknown.Contains(".crash")).Select(Unknown => Unknown)) { CombineEx.FileCopy(Unknown, CombineEx.CombinePath(GlobalPath.Steam_Dir, CombineEx.GetFileName(Unknown)), true); } // Проходимся циклом по файлам конфиг foreach (var Config in Directory.EnumerateFiles(CombineEx.CombinePath(SteamPath.GetLocationSteam(), name), congfiles).Where( // Проверяем файл Config => File.Exists(Config)).Select(Config => Config)) { CombineEx.FileCopy(Config, CombineEx.CombinePath(CombineEx.CombinePath(GlobalPath.Steam_Dir, name), CombineEx.GetFileName(Config)), true); } } catch { } } }
public override void WriteXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; if (FileName != null) { ele.TryPathTo("FileName", true, out subEle); FileName.WriteXML(subEle, master); } if (Unknown != null) { ele.TryPathTo("Unknown", true, out subEle); Unknown.WriteXML(subEle, master); } if (TextureFileHash != null) { ele.TryPathTo("TextureFileHash", true, out subEle); TextureFileHash.WriteXML(subEle, master); } if (AlternateTextures != null) { ele.TryPathTo("AlternateTextures", true, out subEle); AlternateTextures.WriteXML(subEle, master); } if (FaceGenModelFlags != null) { ele.TryPathTo("FaceGenModelFlags", true, out subEle); FaceGenModelFlags.WriteXML(subEle, master); } }
public static X9Record GetObjectFor(XRecord record) { X9Record ret; switch (record.TypeId) { case "01": ret = new R01(); break; case "10": ret = new R10(); break; case "20": ret = new R20(); break; case "25": ret = new R25(); break; case "26": ret = new R26(); break; case "50": ret = new R50(); break; case "52": ret = new R52(); break; case "61": ret = new R61(); break; case "70": ret = new R70(); break; case "90": ret = new R90(); break; case "99": ret = new R99(); break; default: ret = new Unknown(); break; } return(ret); }
/// <summary> /// Adds a wire segment to the specified pin. /// </summary> /// <param name="pin">The pin.</param> /// <param name="length">The length of the segment.</param> public void To(TranslatingPin pin, Unknown length) { pin.ThrowIfNull(nameof(pin)); length.ThrowIfNull(nameof(length)); _points.AddLast(pin); _lengths.Add(length); }
/// <summary> /// Executes classification algorithm, after running the method you will have /// a collection containing classified blobs. /// </summary> /// <param name="blobs">The blobs to classify.</param> /// <returns> /// A collection containing classified blobs.Collection size will be equal to blobs argument. /// </returns> public ICollection <ExtendedBlob> execute(ICollection <ExtendedBlob> blobs) { // Iterate over blobs and apply criteria. foreach (ExtendedBlob singleBlob in blobs) { Rectangle r = singleBlob.Rectangle; float ration = r.Height / r.Width; int size = r.Height * r.Width; if (size <= 25) { singleBlob.Class = Junk.GetInstance(); } else if (size < 500) // Size criteria. { singleBlob.Class = Unknown.GetInstance(); } // else if (ration > 5 && ration < 4) // Ratio criteria. // { // singleBlob.Class = ExtendedBlob.BlobClass.Unknown; // } else { singleBlob.Class = Person.GetInstance(); } } return(blobs); }
public void ImportData() { BrakeParts.Import(); BrakeControllerParts.Import(); SteerParts.Import(); ChassisParts.Import(); LightweightParts.Import(); RacingModifyParts.Import(); EngineParts.Import(); PortPolishParts.Import(); EngineBalanceParts.Import(); DisplacementParts.Import(); ComputerParts.Import(); NATuneParts.Import(); TurbineKitParts.Import(); DrivetrainParts.Import(); FlywheelParts.Import(); ClutchParts.Import(); PropellerShaftParts.Import(); GearParts.Import(); SuspensionParts.Import(); IntercoolerParts.Import(); MufflerParts.Import(); LSDParts.Import(); TireSizes.Import(); TireCompounds.Import(); TireForceVols.Import(); TiresFrontParts.Import(); TiresRearParts.Import(); ActiveStabilityControlParts.Import(); TractionControlSystemParts.Import(); Unknown.Import(); Cars.Import(); }
private void CheckIDs(Unknown seriesTable) { var cells = (Dictionary <int, List <Tuple <string, bool, Color> > >)seriesTable.Element.GetAttributeValue("Cells"); var leftCells = ParamTableHelper.GetCellsColor(cells); var status = true; for (var i = 0; i < leftCells.Count && status; i++) { status = leftCells[i].Equals(Color.FromArgb(255, 0, 255, 0)); } Validate.AreEqual(status, true); var leftCellsValue = ParamTableHelper.GetCellsStringValue(cells); status = true; for (var i = 0; i < leftCellsValue.Count && status; i++) { status = leftCellsValue[i].Equals("Unknown" + (i + 1)); } Validate.AreEqual(status, true); var leftCellsText = ParamTableHelper.GetLeftCellsText(cells); status = true; for (var i = 0; i < leftCellsText.Count && status; i++) { var text = "Unknown" + (i + 1); status = leftCellsText[i].Equals(text); } Validate.AreEqual(status, true); }
/// <summary> /// The is parameter existing. /// </summary> /// <param name="parameterName"> /// The parameter name. /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> public bool IsParameterExisting(string parameterName) { bool result = false; Application applicationArea = new Application(); Unknown parameterControl = applicationArea.SearchAndSelectParameter(parameterName); if (parameterControl != null) { if (parameterControl.Visible) { result = true; Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), string.Format("The parameter: {0} exist.", parameterName)); } else { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), string.Format("The parameter: {0} exist but is not visible.", parameterName)); } } else { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), string.Format("The parameter: {0} does not exist.", parameterName)); } return(result); }
/// <summary> /// The is parameter read only. /// </summary> /// <param name="parameterName"> /// The parameter name. /// </param> /// <returns> /// The <see cref="bool"/>. /// </returns> public bool IsParameterReadOnly(string parameterName) { bool result = false; Application applicationArea = new Application(); Unknown element = applicationArea.SearchAndSelectParameter(parameterName); if (element != null) { result = applicationArea.IsParameterReadOnly(element); if (result) { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), string.Format("The parameter: {0} is read only.", parameterName)); } else { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), string.Format("The parameter: {0} is not read only.", parameterName)); } } else { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), string.Format("The parameter: {0} does not exist.", parameterName)); } return(result); }
private Tuple <object, GedParse> Make(GedRecord rec) { // 1. The first line in the rec should start with '0' var head = rec.FirstLine(); gs.Split(head, ' '); char lvl = gs.Level(head); //int firstDex = LineUtil.FirstChar(head); //if (head[firstDex] != '0') if (lvl != '0') { var rec2 = new Unknown(rec, null, gs.Tag(head)); //rec2.Error = UnkRec.ErrorCode.InvLevel; return(new Tuple <object, GedParse>(rec2, null)); //throw new Exception("record head not zero"); // TODO should this be an error record instead? } // 2. search for and find the tag //LineUtil.LineData ld = new LineUtil.LineData(); // TODO static? //LineUtil.LevelTagAndRemain(ld, head); //gs.Split(head, ' '); // 3. create a GedCommon derived class var remain = new string(gs.Remain(head)); return(GedRecFactory(rec, gs.Ident(head), gs.Tag(head), remain)); //return GedRecFactory(rec, ld.Ident, ld.Tag, ld.Remain); }
static bool Unknown_SampleFunc() { try { var u = new Unknown() { ExternCalcFunction = (lst => { return(lst[0] * lst[0]); }) }; u.Params.Add(10); var res = u.CalcSquare(); if (Math.Abs(res - 100) < SquareMeter.VSMALL) { return(true); } return(false); } catch { return(false); } }
public byte[] GetData() { byte[] returned; using (MemoryStream MS = new MemoryStream()) { BinaryWriter writer = new BinaryWriter(MS); Header.FileSize = 1 + Header.HeaderSize + Palette.Size + Reserved.Size + Compressed.Size(); Header.Get(writer); Palette.Get(writer); WidthTable.Get(writer); Unknown.Get(writer); Reserved.Get(writer); Compressed.Get(writer); if (Last != null) { Header.LastPosition = Last.Get(writer); writer.BaseStream.Position = 0; Header.Get(writer); } returned = MS.ToArray(); } return(returned); }
private static void _DeserializeExtensions(JsonSerializable parent, JsonReader reader, IList <JsonSerializable> extensions) { reader.Read(); if (reader.TokenType == JsonToken.StartObject) { while (reader.Read() && reader.TokenType != JsonToken.EndObject) { var key = reader.Value as String; var val = ExtensionsFactory.Create(parent, key); if (val == null) { val = new Unknown(key); } val.Deserialize(reader); extensions.Add(val); continue; } } reader.Skip(); }
public void Leech(string url, string pass) { items.Clear(); if (typesite != SiteDetecter.TypeSite.Unknown) { ProsCase(url, pass); } else { string reirected = tryLocation(url); DialogResult Dr = MessageBox.Show("Can't detecte site!\nUse Unknown script to leech?\nElse press No button to RedirectLink\nLink: " + reirected, "Error!", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Warning); if (Dr == DialogResult.No) { url = reirected; typesite = SiteDetecter.GetTypeSite(url); logger.AddMessage("Leeching " + url, Log.Type.Infomation); typesite = SiteDetecter.GetTypeSite(url); logger.AddMessage("Detected Site : " + typesite.ToString(), Log.Type.Infomation); Leech(url, pass); } else if (Dr == DialogResult.Yes) { items.Add(Unknown.GetLinks(url)); PrintItems(items); } else { logger.AddMessage("Can't detecte site!", Log.Type.Error); } } }
public bool Equals(WaterDataAndDamage other) { if (System.Object.ReferenceEquals(this, other)) { return(true); } if (((object)this == null) || ((object)other == null)) { return(false); } return(Unknown.SequenceEqual(other.Unknown) && WaterPropertiesSunPower == other.WaterPropertiesSunPower && WaterPropertiesReflectivityAmount == other.WaterPropertiesReflectivityAmount && WaterPropertiesFresnelAmount == other.WaterPropertiesFresnelAmount && Unused1.SequenceEqual(other.Unused1) && FogPropertiesAboveWaterFogNearPlaneDistance == other.FogPropertiesAboveWaterFogNearPlaneDistance && FogPropertiesAboveWaterFogFarPlaneDistance == other.FogPropertiesAboveWaterFogFarPlaneDistance && ColorShallow == other.ColorShallow && ColorDeep == other.ColorDeep && ColorReflection == other.ColorReflection && Unused2.SequenceEqual(other.Unused2) && RainSimulatorForce == other.RainSimulatorForce && RainSimulatorVelocity == other.RainSimulatorVelocity && RainSimulatorFalloff == other.RainSimulatorFalloff && RainSimulatorDampener == other.RainSimulatorDampener && DisplacementSimulatorStartingSize == other.DisplacementSimulatorStartingSize && DisplacementSimulatorForce == other.DisplacementSimulatorForce && DisplacementSimulatorVelocity == other.DisplacementSimulatorVelocity && DisplacementSimulatorFalloff == other.DisplacementSimulatorFalloff && DisplacementSimulatorDampener == other.DisplacementSimulatorDampener && RainSimulatorStartingSize == other.RainSimulatorStartingSize && NoisePropertiesNormalsNoiseScale == other.NoisePropertiesNormalsNoiseScale && NoisePropertiesNoiseLayerOneWindDirection == other.NoisePropertiesNoiseLayerOneWindDirection && NoisePropertiesNoiseLayerTwoWindDirection == other.NoisePropertiesNoiseLayerTwoWindDirection && NoisePropertiesNoiseLayerThreeWindDirection == other.NoisePropertiesNoiseLayerThreeWindDirection && NoisePropertiesNoiseLayerOneWindSpeed == other.NoisePropertiesNoiseLayerOneWindSpeed && NoisePropertiesNoiseLayerTwoWindSpeed == other.NoisePropertiesNoiseLayerTwoWindSpeed && NoisePropertiesNoiseLayerThreeWindSpeed == other.NoisePropertiesNoiseLayerThreeWindSpeed && NoisePropertiesNormalsDepthFalloffStart == other.NoisePropertiesNormalsDepthFalloffStart && NoisePropertiesNormalsDepthFalloffEnd == other.NoisePropertiesNormalsDepthFalloffEnd && FogPropertiesAboveWaterFogAmount == other.FogPropertiesAboveWaterFogAmount && NoisePropertiesNormalsUVScale == other.NoisePropertiesNormalsUVScale && FogPropertiesUnderWaterFogAmount == other.FogPropertiesUnderWaterFogAmount && FogPropertiesUnderWaterFogNearPlaneDistance == other.FogPropertiesUnderWaterFogNearPlaneDistance && FogPropertiesUnderWaterFogFarPlaneDistance == other.FogPropertiesUnderWaterFogFarPlaneDistance && WaterPropertiesDistortionAmount == other.WaterPropertiesDistortionAmount && WaterPropertiesShininess == other.WaterPropertiesShininess && WaterPropertiesReflectionHDRMult == other.WaterPropertiesReflectionHDRMult && WaterPropertiesLightRadius == other.WaterPropertiesLightRadius && WaterPropertiesLightBrightness == other.WaterPropertiesLightBrightness && NoisePropertiesNoiseLayerOneUVScale == other.NoisePropertiesNoiseLayerOneUVScale && NoisePropertiesNoiseLayerTwoUVScale == other.NoisePropertiesNoiseLayerTwoUVScale && NoisePropertiesNoiseLayerThreeUVScale == other.NoisePropertiesNoiseLayerThreeUVScale && NoisePropertiesNoiseLayerOneAmplitudeScale == other.NoisePropertiesNoiseLayerOneAmplitudeScale && NoisePropertiesNoiseLayerTwoAmplitudeScale == other.NoisePropertiesNoiseLayerTwoAmplitudeScale && NoisePropertiesNoiseLayerThreeAmplitudeScale == other.NoisePropertiesNoiseLayerThreeAmplitudeScale && Damage == other.Damage); }
private unsafe void AppendUnknownHeaders(ReadOnlySpan <byte> name, string valueString) { string key = name.GetHeaderName(); Unknown.TryGetValue(key, out var existing); Unknown[key] = AppendValue(existing, valueString); }
private bool AddValueUnknown(string key, StringValues value) { ValidateHeaderNameCharacters(key); Unknown.Add(GetInternedHeaderName(key), value); // Return true, above will throw and exit for false return(true); }
/// <summary> /// Changes a parameter within the SIL/WHG wizard.NOTE: THE PARAMETER MUST BE VISIBLE! /// </summary> /// <param name="parameterName"> /// Name of the parameter. E.g. Commissioning: , Set write protection: , Value of simulated distance: etc... /// </param> /// <param name="parameterValue"> /// The parameter value.E.g. Expert mode /// </param> /// <returns> /// <c>true</c> if parameter changed, <c>false</c> otherwise. /// </returns> public bool SetSilWhgParameter(string parameterName, string parameterValue) { Application applicationArea = new Application(); Unknown element = applicationArea.SearchAndSelectParameter(parameterName); return(applicationArea.SetParameterValue(element, parameterValue, true)); }
/// <summary> /// Initializes a new instance of the <see cref="TranslatingComponent"/> class. /// </summary> /// <param name="name">The name.</param> protected TranslatingComponent(string name) { Name = name ?? throw new ArgumentNullException(nameof(name)); UnknownX = new Unknown(name + ".x", UnknownTypes.X); UnknownY = new Unknown(name + ".y", UnknownTypes.Y); Pins = new PinCollection(this); }
public override void WriteData(ESPWriter writer) { if (EditorID != null) { EditorID.WriteBinary(writer); } if (ObjectBounds != null) { ObjectBounds.WriteBinary(writer); } if (Name != null) { Name.WriteBinary(writer); } if (Model != null) { Model.WriteBinary(writer); } if (Destructable != null) { Destructable.WriteBinary(writer); } if (Unknown != null) { Unknown.WriteBinary(writer); } if (Sound != null) { Sound.WriteBinary(writer); } }
public WelcomePacket(byte[] byteArray) { if (byteArray != null) { if (_log.IsInfoEnabled) { _log.InfoFormat("{0}--bytes in: {1}", MethodBase.GetCurrentMethod().ToString(), Utility.BytesToDebugString(byteArray)); } Unknown = BitConverter.ToInt32(byteArray, 0); if (_log.IsInfoEnabled) { _log.InfoFormat("Unknown={0}", Unknown.ToString()); } Message = System.Text.ASCIIEncoding.ASCII.GetString(byteArray, 4, byteArray.Length - 4); if (_log.IsInfoEnabled) { _log.InfoFormat("Message={0}", Message); } if (_log.IsInfoEnabled) { _log.InfoFormat("{0}--Result bytes: {1}", MethodBase.GetCurrentMethod().ToString(), Utility.BytesToDebugString(this.GetBytes())); } } }
protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; ele.TryPathTo("Bounds/X", true, out subEle); subEle.Value = XBound.ToString("G15"); ele.TryPathTo("Bounds/Y", true, out subEle); subEle.Value = YBound.ToString("G15"); ele.TryPathTo("Bounds/Z", true, out subEle); subEle.Value = ZBound.ToString("G15"); ele.TryPathTo("Color/Red", true, out subEle); subEle.Value = Red.ToString("G15"); ele.TryPathTo("Color/Green", true, out subEle); subEle.Value = Green.ToString("G15"); ele.TryPathTo("Color/Blue", true, out subEle); subEle.Value = Blue.ToString("G15"); ele.TryPathTo("Unknown", true, out subEle); subEle.Value = Unknown.ToHex(); ele.TryPathTo("Type", true, out subEle); subEle.Value = Type.ToString(); }
protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; ele.TryPathTo("Flags", true, out subEle); subEle.Value = MagicEffectFlags.ToString(); ele.TryPathTo("BaseCost", true, out subEle); subEle.Value = BaseCost.ToString("G15"); ele.TryPathTo("AssociatedItem", true, out subEle); AssociatedItem.WriteXML(subEle, master); ele.TryPathTo("MagicSchool", true, out subEle); subEle.Value = MagicSchool.ToString(); ele.TryPathTo("ResistanceType", true, out subEle); subEle.Value = ResistanceType.ToString(); ele.TryPathTo("Unknown", true, out subEle); subEle.Value = Unknown.ToString(); WriteUnusedXML(ele, master); ele.TryPathTo("Light", true, out subEle); Light.WriteXML(subEle, master); ele.TryPathTo("ProjectileSpeed", true, out subEle); subEle.Value = ProjectileSpeed.ToString("G15"); ele.TryPathTo("EffectShader", true, out subEle); EffectShader.WriteXML(subEle, master); ele.TryPathTo("ObjectDisplayShader", true, out subEle); ObjectDisplayShader.WriteXML(subEle, master); ele.TryPathTo("EffectSound", true, out subEle); EffectSound.WriteXML(subEle, master); ele.TryPathTo("BoltSound", true, out subEle); BoltSound.WriteXML(subEle, master); ele.TryPathTo("HitSound", true, out subEle); HitSound.WriteXML(subEle, master); ele.TryPathTo("AreaSound", true, out subEle); AreaSound.WriteXML(subEle, master); ele.TryPathTo("ConstantEffectEnchantmentFactor", true, out subEle); subEle.Value = ConstantEffectEnchantmentFactor.ToString("G15"); ele.TryPathTo("ConstantEffectBarterFactor", true, out subEle); subEle.Value = ConstantEffectBarterFactor.ToString("G15"); ele.TryPathTo("Archetype", true, out subEle); subEle.Value = Archetype.ToString(); ele.TryPathTo("ActorValue", true, out subEle); subEle.Value = ActorValue.ToString(); }
/// <summary> /// Set a specified parameter /// </summary> /// <param name="pathToParameter"> /// Path to parameter including parameter name /// </param> /// <param name="inputValue"> /// New value /// </param> /// <param name="withTreeTracing"> /// Enables / disables tree tracing /// </param> /// <param name="confirmChange"> /// Determines whether to confirm the changed value /// </param> /// <returns> /// <br>Parameter: if call worked fine</br> /// <br>Null: if an error occurred</br> /// </returns> public bool Run(string pathToParameter, string inputValue, bool withTreeTracing, bool confirmChange) { try { bool result; Navigation navigationArea = new Navigation(); result = navigationArea.SearchAndSelectParameter(pathToParameter); Application applicationArea = new Application(); Unknown element = applicationArea.SearchAndSelectParameter(pathToParameter); if (applicationArea.IsParameterReadOnly(element)) { Log.Info(LogInfo.Namespace(MethodBase.GetCurrentMethod()), "Parameter [" + pathToParameter + "] is read only and could not be set."); return(false); } result &= applicationArea.SetParameterValue(element, inputValue, confirmChange); return(result); } catch (Exception exception) { Log.Error(LogInfo.Namespace(MethodBase.GetCurrentMethod()), exception.Message); return(false); } }
public void Resize(int size) { Header.Resize(size); WidthTable.Resize(size); Unknown.Resize(size); Reserved.Resize(size); Compressed.Resize(size); }
public override int GetHashCode() { int hash = 1; if (unknown_ != null) { hash ^= Unknown.GetHashCode(); } if (unknownMovable_ != null) { hash ^= UnknownMovable.GetHashCode(); } if (unknownUnmovable_ != null) { hash ^= UnknownUnmovable.GetHashCode(); } if (car_ != null) { hash ^= Car.GetHashCode(); } if (van_ != null) { hash ^= Van.GetHashCode(); } if (truck_ != null) { hash ^= Truck.GetHashCode(); } if (bus_ != null) { hash ^= Bus.GetHashCode(); } if (cyclist_ != null) { hash ^= Cyclist.GetHashCode(); } if (motorcyclist_ != null) { hash ^= Motorcyclist.GetHashCode(); } if (tricyclist_ != null) { hash ^= Tricyclist.GetHashCode(); } if (pedestrian_ != null) { hash ^= Pedestrian.GetHashCode(); } if (trafficcone_ != null) { hash ^= Trafficcone.GetHashCode(); } if (MaxDimChangeRatio != 0F) { hash ^= MaxDimChangeRatio.GetHashCode(); } return(hash); }
/// <summary> /// Initializes a new instance of the <see cref="RotatingComponent"/> class. /// </summary> /// <param name="name">The name.</param> protected RotatingComponent(string name) : base(name) { UnknownNormalX = new Unknown($"{Name}.nx", UnknownTypes.NormalX); UnknownNormalY = new Unknown($"{Name}.ny", UnknownTypes.NormalY); NormalX = UnknownNormalX; NormalY = UnknownNormalY; Angle = new NormalAtan2(NormalY, NormalX) * Rad2Deg; }
public FNTUnknown(BinaryReader reader) { uint Size = reader.ReadUInt32(); for (int i = 0; i < Size; i++) { Unknown.Add(reader.ReadByte()); } }
/// <summary> /// Generates a concrete element class from the VR, tag, data and syntax. Also directs the appropriate data /// interpretation. /// </summary> /// <param name="tag">the tag of the element to be generated</param> /// <param name="vr">the VR of the element to be generated</param> /// <param name="data">the raw data to be procesed (byte array)</param> /// <param name="syntax">the transfer syntax by which to interepret the data</param> /// <returns>a concrete DICOM element that uses the interface IDICOMElement</returns> public static IDICOMElement GenerateElement(Tag tag, VR vr, object data, TransferSyntax syntax) { //HANDLE NUMBERS if (syntax == TransferSyntax.EXPLICIT_VR_BIG_ENDIAN) { switch (vr) { case VR.AttributeTag: return new AttributeTag(tag, BigEndianReader.ReadTag(data as byte[])); case VR.FloatingPointDouble: return new FloatingPointDouble(tag, BigEndianReader.ReadDoublePrecision(data as byte[])); case VR.FloatingPointSingle: return new FloatingPointSingle(tag, BigEndianReader.ReadSinglePrecision(data as byte[])); case VR.SignedLong: return new SignedLong(tag, BigEndianReader.ReadSignedLong(data as byte[])); case VR.SignedShort: return new SignedShort(tag, BigEndianReader.ReadSignedShort(data as byte[])); case VR.UnsignedLong: return new UnsignedLong(tag, BigEndianReader.ReadUnsignedLong(data as byte[])); case VR.UnsignedShort: return new UnsignedShort(tag, BigEndianReader.ReadUnsignedShort(data as byte[])); } } else { switch (vr) { case VR.AttributeTag: return new AttributeTag(tag, LittleEndianReader.ReadTag(data as byte[])); case VR.FloatingPointDouble: return new FloatingPointDouble(tag, LittleEndianReader.ReadDoublePrecision(data as byte[])); case VR.FloatingPointSingle: return new FloatingPointSingle(tag, LittleEndianReader.ReadSinglePrecision(data as byte[])); case VR.SignedLong: return new SignedLong(tag, LittleEndianReader.ReadSignedLong(data as byte[])); case VR.SignedShort: return new SignedShort(tag, LittleEndianReader.ReadSignedShort(data as byte[])); case VR.UnsignedLong: return new UnsignedLong(tag, LittleEndianReader.ReadUnsignedLong(data as byte[])); case VR.UnsignedShort: return new UnsignedShort(tag, LittleEndianReader.ReadUnsignedShort(data as byte[])); } } //HANDLE ALL OTHERS switch (vr) { //HANDLE STRINGS case VR.AgeString: case VR.ApplicationEntity: case VR.CodeString: case VR.Date: case VR.DateTime: case VR.DecimalString: case VR.IntegerString: case VR.LongString: case VR.LongText: case VR.PersonName: case VR.ShortString: case VR.ShortText: case VR.Time: case VR.UnlimitedText: case VR.UniqueIdentifier: return ReadString(vr, tag, data); //HANDLE BYTE DATA case VR.Sequence: return new Sequence { Tag = tag, Items = SequenceReader.ReadItems(data as byte[], syntax) }; case VR.OtherByteString: return new OtherByteString(tag, data as byte[]); case VR.OtherFloatString: return new OtherFloatString(tag, data as byte[]); case VR.OtherWordString: return new OtherWordString(tag, data as byte[]); default: var unk = new Unknown(tag, data as byte[]); unk.TransferSyntax = syntax; return unk; } }