/// <summary> /// Compares two IP address ranges. /// </summary> /// <returns> /// <see langword="true" /> if the two address ranges are equal; otherwise, <see langword="false" />. /// </returns> /// <param name="other">An <see cref="IPRange" /> instance to compare to the current instance. </param> public bool Equals(IPRange other) { if (other == null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(StartAddress.Equals(other.StartAddress) && EndAddress.Equals(other.EndAddress)); }
public override bool Equals(Object obj) { MemorySection <T> personObj = obj as MemorySection <T>; if (personObj == null) { return(false); } else { return(Name.Equals(personObj.Name) && StartAddress.Equals(personObj.StartAddress) && EndAddress.Equals(personObj.EndAddress) && IsSymbol.Equals(personObj.IsSymbol)); } }
public StatusObject GetMemoryAddresses() { StatusObject SO = new StatusObject(); try { Console.WriteLine(StartAddress); Console.WriteLine(EndAddress); Console.WriteLine(EndAddress.ToInt64() - StartAddress.ToInt64()); } catch (Exception e) { SO = new StatusObject(e, "PROCESS_GETMEMORYADDRESSES"); } return(SO); }
/// <summary> /// Prints information about the Section /// </summary> public void ShowSection() { Console.WriteLine("Name: " + Name); Console.WriteLine("Start: " + StartAddress.ToString()); Console.WriteLine("End: " + EndAddress.ToString()); }
/// <summary> /// Compares two IP address ranges. /// </summary> /// <returns> /// <see langword="true" /> if the two address ranges are equal; otherwise, <see langword="false" />. /// </returns> /// <param name="comparand">An <see cref="IPRange" /> instance to compare to the current instance. </param> private bool Equals(IPRange comparand) { return(StartAddress.Equals(comparand.StartAddress) && EndAddress.Equals(comparand.EndAddress)); }
internal DHCP_IP_RANGE ToNativeIpRange() => new DHCP_IP_RANGE(StartAddress.ToNativeAsNetwork(), EndAddress.ToNativeAsNetwork());
internal DHCP_BOOTP_IP_RANGE ToNativeBootpIpRange() => new DHCP_BOOTP_IP_RANGE(StartAddress.ToNativeAsNetwork(), EndAddress.ToNativeAsNetwork(), BootpClientsAllocated, MaxBootpAllowed);
public Fsm(long chatId, Message msg, TelegramBotClient bot, Context db) { User state; lock (Locker) { state = db.Users.FirstOrDefault(x => x.ChatId == chatId); } if (state == null) { User user = new User { ChatId = chatId, State = StateChatEnum.StartMain }; db.Users.Add(user); db.SaveChanges(); } if (state != null) { IUpdateState updateState; switch (state.State) { case StateChatEnum.StartMain: var uid = db.Users.FirstOrDefault(x => x.ChatId == chatId); if (uid == null) { User user = new User { ChatId = chatId, State = StateChatEnum.StartText }; db.Users.Add(user); db.SaveChanges(); } updateState = new StartMain(); break; case StateChatEnum.EndAddress: updateState = new EndAddress(); break; case StateChatEnum.StartText: updateState = new StartText(); break; case StateChatEnum.SendingTime: updateState = new SendingTime(); break; case StateChatEnum.SendingNumberPhone: updateState = new SendingNumberPhone(); break; case StateChatEnum.PaymentMethod: updateState = new PaymentMethod(); break; case StateChatEnum.CarSearch: updateState = new CarSearch(); break; //case StateChatEnum.CarSearch: // updateState = new CarSearch(); // break; default: throw new AggregateException(); } updateState.UpdateAsync(msg, bot, chatId, db); } }