//public static PosixTz InvertedForm(PosixTz posixTz) { // if ((object)posixTz == null || (object)posixTz.dst == null) { // return null; // } // return new PosixTz( // posixTz.dst.name, posixTz.dst.offset, // new PosixTz.Dst( // posixTz.name, posixTz.offset, // posixTz.dst.end, posixTz.dst.start // ) // ); //} public static bool LogicallyEquals(PosixTz left, PosixTz right) { return(Object.ReferenceEquals(left, right) || ( !Object.ReferenceEquals(left, null) && !Object.ReferenceEquals(right, null) && left.offset == right.offset && Dst.LogicallyEquals(left.dst, right.dst) )); }
public override string ToString() { return (_Value == None._Value ? "(none)" : _Value == Null._Value ? "(null)" : Ok?Org.ToString() + Dst.ToString() + (Type == MoveType.PROMOTE ? Promote.Notation : "") : "(no move)"); }
static PosixTz UnnamedForm(PosixTz posixTz) { if ((object)posixTz == null) { return(null); } return(new PosixTz(null, posixTz.offset, Dst.UnnamedForm(posixTz.dst))); }
public bool Equals(Dst other) { return !Object.ReferenceEquals(other, null) && offset == other.offset && start == other.start && end == other.end && name == other.name; }
public static Dst UnnamedForm(Dst dst) { if ((object)dst == null) { return(null); } return(new Dst(null, dst.offset, dst.start, dst.end)); }
public static int GetLogicalHashCode(Dst dst) { if ((object)dst == null) { return 0; } return HashCode.Combine( dst.offset, dst.start.GetHashCode(), dst.end.GetHashCode() ); }
public bool Equals(Dst other) { return (!Object.ReferenceEquals(other, null) && offset == other.offset && start == other.start && end == other.end && name == other.name); }
public static bool LogicallyEquals(Dst left, Dst right) { return Object.ReferenceEquals(left, right) || ( !Object.ReferenceEquals(left, null) && !Object.ReferenceEquals(right, null) && left.offset == right.offset && left.start == right.start && left.end == right.end ); }
public void TestEx6WithInvalidPropertyName() { Dst dst = new Dst(); Src src = new Src(); bool res = Ficha1.SetPropertyFromField(dst, "NonExistingProperty", src, "item"); Assert.That(res, Is.EqualTo(false)); }
public static int GetLogicalHashCode(PosixTz posixTz) { if ((object)posixTz == null) { return(0); } return(HashCode.Combine( posixTz.offset, Dst.GetLogicalHashCode(posixTz.dst) )); }
public static int GetLogicalHashCode(Dst dst) { if ((object)dst == null) { return(0); } return(HashCode.Combine( dst.offset, dst.start.GetHashCode(), dst.end.GetHashCode() )); }
public static bool LogicallyEquals(Dst left, Dst right) { return(Object.ReferenceEquals(left, right) || ( !Object.ReferenceEquals(left, null) && !Object.ReferenceEquals(right, null) && left.offset == right.offset && left.start == right.start && left.end == right.end )); }
public bool Search(string str) { if (Dst.ToString().Contains(str) || DstType.ToString().Contains(str) || Src1.ToString().Contains(str) || Src1Type.ToString().Contains(str) || Op.ToString().Contains(str) || Src2.ToString().Contains(str) || Src2Type.ToString().Contains(str)) { return(true); } else { return(false); } }
public PosixTz(string name, int offset, Dst dst) { //if (dst != null && dst.offset > offset) { // var new_dst = new Dst( // name, offset, dst.end, dst.start // ); // name = dst.name; // offset = dst.offset; // dst = new_dst; //} this.name = name; this.offset = offset; this.dst = dst; }
public override int GetHashCode() { unchecked { var hashCode = (SwVersion != null ? SwVersion.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Api != null ? Api.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Date.GetHashCode(); hashCode = (hashCode * 397) ^ (Language != null ? Language.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Currency != null ? Currency.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Units != null ? Units.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Dst != null ? Dst.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Tz != null ? Tz.GetHashCode() : 0); hashCode = (hashCode * 397) ^ LastEnergyErase.GetHashCode(); hashCode = (hashCode * 397) ^ LastConfig.GetHashCode(); return(hashCode); } }
public bool LogicallyEquals(Dst other) { return LogicallyEquals(this, other); }
public bool LogicallyEquals(Dst other) { return(LogicallyEquals(this, other)); }
private Travel GetTravelObject() { Travel travel = new Travel(); try { XmlNode element = this.document.GetElementsByTagName("travel").Item(0); string departureDate = ""; string arrivalDate = ""; foreach (XmlNode item in element.ChildNodes) { if (item.Name == "dep_date" || item.Name == "src_dep") { departureDate += item.InnerText + " "; } else if (item.Name == "arr_date" || item.Name == "dst_arr") { arrivalDate += item.InnerText + " "; } switch (item.Name) { case "guididx": { travel.GuidIdx = Guid.Parse(item.InnerText); break; } case "src": { Src src = new Src(); foreach (XmlNode srcNodes in item.ChildNodes) { if (srcNodes.Name == "idx") { src.Idx = srcNodes.InnerText; } else if (srcNodes.Name == "name") { src.Name = srcNodes.InnerText; } } travel.Src = src; break; } case "dst": { Dst dst = new Dst(); foreach (XmlNode dstNodes in item.ChildNodes) { if (dstNodes.Name == "idx") { dst.Idx = dstNodes.InnerText; } else if (dstNodes.Name == "name") { dst.Name = dstNodes.InnerText; } } travel.Dst = dst; break; } case "transport_type": { travel.TransportType = Int32.Parse(item.InnerText); break; } case "duration": { travel.Duration = item.InnerText; break; } case "trip": { Trip trip = new Trip(); foreach (XmlNode tripNodes in item.ChildNodes) { if (tripNodes.Name == "id") { trip.TripId = tripNodes.InnerText; } else if (tripNodes.Name == "src") { Src src = new Src(); foreach (XmlNode srcNodes in item.ChildNodes) { if (srcNodes.Name == "idx") { src.Idx = srcNodes.InnerText; } else if (srcNodes.Name == "name") { src.Name = srcNodes.InnerText; } } trip.Src = src; } else if (tripNodes.Name == "dst") { Dst dst = new Dst(); foreach (XmlNode dstNodes in item.ChildNodes) { if (dstNodes.Name == "idx") { dst.Idx = dstNodes.InnerText; } else if (dstNodes.Name == "name") { dst.Name = dstNodes.InnerText; } } trip.Dst = dst; } else if (tripNodes.Name == "transporter") { trip.Transporter = tripNodes.InnerText; } else if (tripNodes.Name == "state") { trip.State = Int32.Parse(tripNodes.InnerText); } else if (tripNodes.Name == "el") { trip.El = Int32.Parse(tripNodes.InnerText); } else if (tripNodes.Name == "boarding_pass") { trip.BoardingPass = Int32.Parse(tripNodes.InnerText); } } break; } } } travel.ArrivalDateTime = DateTime.Parse(arrivalDate); travel.DepartureDateTime = DateTime.Parse(departureDate); } catch (Exception ex) { Console.WriteLine($"Произошла ошибка при парсинге элемента Travel."); throw ex; } return(travel); }
public static Dst UnnamedForm(Dst dst) { if ((object)dst == null) { return null; } return new Dst(null, dst.offset, dst.start, dst.end); }