void CrateUngrab(Interactor interactor, EventTime eventTime) { if (interactor.grabbedHandle) { interactor.grabbedHandle.item = Item.list[0]; } }
/// <summary> /// Called when the event is raised. /// </summary> /// <remarks></remarks> public override void Raise() { msgRaised = String.Format("Event raised at: {0}", EventTime.ToString()); //Store your custom event information etc. here. base.Raise(); }
public string GetErrorItemText(ErrorItemViewKind errorViewKind) { StringBuilder sb = new StringBuilder(""); if ((errorViewKind & ErrorItemViewKind.DBId) != 0) { sb.Append($"[{Id.ToString()}]"); } if ((errorViewKind & ErrorItemViewKind.LogTime) != 0) { sb.AppendSeparated(LogTime.ToString()); } if ((errorViewKind & ErrorItemViewKind.EventTime) != 0) { sb.AppendSeparated(EventTime.ToString()); } if ((errorViewKind & ErrorItemViewKind.ErrorMessage) != 0) { sb.AppendSeparated(ErrorMessage); } return(sb.ToString()); }
public string GetMeasurementItemText(MeasurementItemViewKind viewKind) { StringBuilder sb = new StringBuilder(""); if ((viewKind & MeasurementItemViewKind.DBId) != 0) { sb.Append($"[{Id.ToString()}]"); } if ((viewKind & MeasurementItemViewKind.LogTime) != 0) { sb.AppendSeparated(LogTime.ToString()); } if ((viewKind & MeasurementItemViewKind.EventTime) != 0) { sb.AppendSeparated(EventTime.ToString()); } if ((viewKind & MeasurementItemViewKind.Value) != 0) { sb.AppendSeparated(MeasuredValue.ToString()); } if ((viewKind & MeasurementItemViewKind.Unit) != 0) { sb.AppendSeparated(MeasuredUnit.ToString()); } return(sb.ToString()); }
public async void ShowItem(TelegramBotClient BotClient, System.Object message, InlineButtonCalendar inlineButton, DataBaseContext baseContext) { CallbackQuery _message = message as CallbackQuery; Name = _message.Data; System.String[] words = Name.Split(new System.Char[] { ' ' }, System.StringSplitOptions.RemoveEmptyEntries); System.Int32 temp = System.Convert.ToInt32(words[0]); Reminder reminder = baseContext._Reminders.Where(p => p.ID == temp).FirstOrDefault(); EventTime eventTime = baseContext._EventTimes.Where(p => p.reminder == reminder).FirstOrDefault(); reminder.Work = true; baseContext.SaveChanges(); try { await BotClient.EditMessageTextAsync ( _message.From.Id, _message.Message.MessageId, "Название: " + reminder.Name + "\nОписание: " + reminder.Note + "\nВремя: " + eventTime.dateTime.TimeOfDay, replyMarkup : inlineButton.ChangeReminder ); } catch (System.Exception ex) { System.Console.WriteLine("Exception: ReminderCal : IEventCal - " + ex); } }
public async Task Execute(IJobExecutionContext context) { DataBaseContext BaseContext = new DataBaseContext(); foreach (Purpose reminder in BaseContext._Purposes.Include("user")) { EventTime eventTime = BaseContext._EventTimes.Where(p => p.purpose == reminder).FirstOrDefault(); if (eventTime != null) { if (eventTime.dateTime != null) { if (eventTime.dateTime.Date == System.DateTime.Today && eventTime.dateTime.Hour == System.DateTime.Now.Hour && eventTime.dateTime.Minute == System.DateTime.Now.Minute) { if (reminder.user.SendMessageTelegram == true) { TelegramBotClient BotClient = new TelegramBotClient("779815529:AAEQVsHABl-V1rNhxX3vDnCo_r1xQjYczNU"); System.String name = "Название: " + reminder.Name + "\n"; name += "Описание: " + reminder.Note + "\n"; name += "Продолжительность: " + reminder.Duration; await BotClient.SendTextMessageAsync(reminder.user.ID, name); } } } } } BaseContext.Dispose(); }
public override int GetHashCode() { int hash = 1; if (eventTime_ != null) { hash ^= EventTime.GetHashCode(); } if (serviceContext_ != null) { hash ^= ServiceContext.GetHashCode(); } if (Message.Length != 0) { hash ^= Message.GetHashCode(); } if (context_ != null) { hash ^= Context.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public void OnMainGripGrabbed(RagdollHand interactor, Handle handle, EventTime eventTime) { if (interactor.playerHand == Player.local.handRight) { gunGripHeldRight = true; } if (interactor.playerHand == Player.local.handLeft) { gunGripHeldLeft = true; } if (!gunGripHeldLeft && !gunGripHeldRight) { if (isEmpty) { ReloadWeapon(); } thisNPC = interactor.ragdoll.creature; thisNPCBrain = thisNPC.brain.instance; BrainBow = thisNPCBrain.GetModule <BrainModuleBow>(); BrainMelee = thisNPCBrain.GetModule <BrainModuleMelee>(); BrainParry = thisNPCBrain.GetModule <BrainModuleParry>(); thisNPC.brain.currentTarget = Player.local.creature; thisNPC.brain.isParrying = true; BrainMelee.meleeEnabled = module.npcMeleeEnableOverride; } }
public override int GetHashCode() { int hash = 1; if (Artifact.Length != 0) { hash ^= Artifact.GetHashCode(); } if (Execution.Length != 0) { hash ^= Execution.GetHashCode(); } if (eventTime_ != null) { hash ^= EventTime.GetHashCode(); } if (Type != global::Google.Cloud.AIPlatform.V1.Event.Types.Type.Unspecified) { hash ^= Type.GetHashCode(); } hash ^= Labels.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public void MergeFrom(Event other) { if (other == null) { return; } if (other.Artifact.Length != 0) { Artifact = other.Artifact; } if (other.Execution.Length != 0) { Execution = other.Execution; } if (other.eventTime_ != null) { if (eventTime_ == null) { EventTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } EventTime.MergeFrom(other.EventTime); } if (other.Type != global::Google.Cloud.AIPlatform.V1.Event.Types.Type.Unspecified) { Type = other.Type; } labels_.Add(other.labels_); _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); }
private void EventManagerOnonLevelLoad(LevelData leveldata, EventTime eventtime) { if (_lightAndDarknessSpellController != null) { _lightAndDarknessSpellController.darknessSpellController.isTimeStopped = false; } }
public void MergeFrom(LockEvent other) { if (other == null) { return; } if (other.LockDeviceId.Length != 0) { LockDeviceId = other.LockDeviceId; } if (other.eventTime_ != null) { if (eventTime_ == null) { eventTime_ = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } EventTime.MergeFrom(other.EventTime); } if (other.DeviceEvent != 0) { DeviceEvent = other.DeviceEvent; } if (other.RequestReferenceNumber.Length != 0) { RequestReferenceNumber = other.RequestReferenceNumber; } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); }
// Constructor public ItemEvent(int item, EventTime time, double mass, String note) { this.itemID = item; this.time = time; this.startMass = mass; this.note = note; }
public void MergeFrom(ReportedErrorEvent other) { if (other == null) { return; } if (other.eventTime_ != null) { if (eventTime_ == null) { eventTime_ = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } EventTime.MergeFrom(other.EventTime); } if (other.serviceContext_ != null) { if (serviceContext_ == null) { serviceContext_ = new global::Google.Cloud.ErrorReporting.V1Beta1.ServiceContext(); } ServiceContext.MergeFrom(other.ServiceContext); } if (other.Message.Length != 0) { Message = other.Message; } if (other.context_ != null) { if (context_ == null) { context_ = new global::Google.Cloud.ErrorReporting.V1Beta1.ErrorContext(); } Context.MergeFrom(other.Context); } }
public IActionResult Search([Bind("CityName,Date,Action")] EventTime eventTime) { if (String.IsNullOrEmpty(eventTime.Date)) { eventTime.Date = "today"; } string response = GetDataByDateAndCityNames(eventTime.Date, eventTime.CityName).Result; Console.WriteLine("Response: {0}", response); CityInfo cityInfo = JsonSerializer.Deserialize <CityInfoResponse>(response).results; Console.WriteLine("CityInfo sunset= {0}, sunrise= {1}", cityInfo.sunset, cityInfo.sunrise); switch (eventTime.Action) { case "sunset": eventTime.Sunset = cityInfo.sunset; break; case "sunrise": eventTime.Sunrise = cityInfo.sunrise; break; default: eventTime.Sunset = cityInfo.sunset; eventTime.Sunrise = cityInfo.sunrise; break; } return(View(eventTime)); }
public async Task Execute(IJobExecutionContext context) { DataBaseContext BaseContext = new DataBaseContext(); foreach (Event reminder in BaseContext._Events.Include("user")) { EventTime eventTime = BaseContext._EventTimes.Where(p => p._event == reminder).FirstOrDefault(); if (eventTime != null) { if (eventTime.dateTime != null) { if (eventTime.dateTime.Date == System.DateTime.Today && eventTime.dateTime.Hour == System.DateTime.Now.Hour && eventTime.dateTime.Minute == System.DateTime.Now.Minute) { if (reminder.user.SendMessageE_Mail == true && reminder.user.EmailAdress != null) { // отправитель - устанавливаем адрес и отображаемое в письме имя MailAddress from = new MailAddress("*****@*****.**", "CalendarBot"); // кому отправляем MailAddress to = new MailAddress(reminder.user.EmailAdress); // создаем объект сообщения MailMessage m = new MailMessage(from, to); // тема письма m.Subject = "Мероприятие"; // текст письма System.String busy = ""; if (reminder.Busy == true) { busy = "Занят"; } else { busy = "Не занят"; } m.Body = "<h2>" + "Название: " + reminder.Name + "<br>"; m.Body += "Описание: " + reminder.Note + "<br>"; m.Body += "Локация: " + reminder.Location + "<br>"; m.Body += "Занятость: " + busy + "<br>"; m.Body += "</h2>"; // письмо представляет код html m.IsBodyHtml = true; //m.Attachments.Add(@"Путь к файлу!"); // адрес smtp-сервера и порт, с которого будем отправлять письмо SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587); // логин и пароль smtp.Credentials = new NetworkCredential("*****@*****.**", "123456qweASD123456"); smtp.EnableSsl = true; await smtp.SendMailAsync(m); System.Console.WriteLine("Сообщение отправлено!"); } } } } } BaseContext.Dispose(); }
// Override public int CompareTo(System.Object o) { if (o == null) { return(1); } EventTime t = o as EventTime; if (o != null) { int hourCheck = hours.CompareTo(t.GetHours()); if (hourCheck != 0) { return(hourCheck); } else { return(minutes.CompareTo(t.GetMinutes())); } } else { throw new ArgumentException("Object is not a Time"); } }
public void Integrate() { max = maxi(); Parallel.For( 0, parts, new Action <int>(Generate) ); Stopwatch sw = new Stopwatch(); sw.Start(); Parallel.For( 0, parts, new Action <int>(_Integrate) ); double I = Result / (double)(quantity) * Math.Abs(b - a) * 2; sw.Stop(); if (donePercent != quantity) { EventProgress?.Invoke(quantity); } EventFinish?.Invoke(I); EventTime?.Invoke(sw.ElapsedMilliseconds); }
public override int GetHashCode() { int hash = 1; if (LockDeviceId.Length != 0) { hash ^= LockDeviceId.GetHashCode(); } if (eventTime_ != null) { hash ^= EventTime.GetHashCode(); } if (DeviceEvent != 0) { hash ^= DeviceEvent.GetHashCode(); } if (RequestReferenceNumber.Length != 0) { hash ^= RequestReferenceNumber.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
private void EventManager_onPossessEvent(Creature creature, EventTime eventTime) { if (creature.player != null && creature.player.creature != null) { initialized = true; Initialize(creature.player.creature); } }
private void Ragdoll_OnSliceEvent(RagdollPart ragdollPart, EventTime eventTime) { if (eventTime == EventTime.OnStart) { ragdollPart.ragdoll.OnSliceEvent -= Ragdoll_OnSliceEvent; UpdateProgress(1); } }
private void OnReloadJson(EventTime eventTime) { if (eventTime == EventTime.OnEnd) { SetJsonValues(); SetupHelmets(); } }
// Raises the SampleWebRequestErrorEvent. public override void Raise() { // Perform custom processing. eventInfo.Append(string.Format( "Event raised at: ", EventTime.ToString())); // Raise the event. base.Raise(); }
private void StartThreadEachYearEvent() { foreach (Event ev in BaseContext._Events.Include("user")) { if (ev.user.ID == _user.ID) { _eventTime = BaseContext._EventTimes.Where(p => p._event == ev).FirstOrDefault(p => p.DoWork == 4); if (_eventTime != null) { if (CheckDate(_eventTime)) { if (_eventTime.dateTime.Day == _tempDate.date.Day && _eventTime.dateTime.Month == _tempDate.date.Month) { System.DateTime dt = _tempDate.date; EventTime eventTime = BaseContext._EventTimes.Where(p => p._event == ev).FirstOrDefault(p => p.dateTime.DayOfYear == _tempDate.date.DayOfYear); if (eventTime == null) { System.TimeSpan timeSpan = _eventTime.dateTime.TimeOfDay; dt += timeSpan; BaseContext._Events.Add ( new Event() { Name = ev.Name, Note = ev.Note, Location = ev.Location, user = _user, Busy = ev.Busy, Count = ev.Count, Work = false } ); BaseContext._EventTimes.Add ( new EventTime() { _event = ev, DoWork = _eventTime.DoWork, dateTime = dt, Work = _eventTime.Work, } ); } else { break; } } } } } } BaseContext.SaveChanges(); System.Console.WriteLine("Поток StartThreadEachYearEvent завершен"); }
public override string ToString() { string result = Title + " by " + Performer + " on " + EventTime.ToShortDateString(); result += " at " + EventTime.ToShortTimeString() + ". Concessions: "; result += ConcessionSales ? "Yes. " : "No. "; result += "Tickets available: " + NumTickets; return(result); }
// </Snippet2> // <Snippet3> // Invoked in case of events identified by their // event code.and related event detailed code. public SampleWebBaseEvent(string msg, object eventSource, int eventCode, int eventDetailCode) : base(msg, eventSource, eventCode, eventDetailCode) { // Perform custom initialization. customCreatedMsg = string.Format("Event created at: {0}", EventTime.ToString()); }
public void MergeFrom(Finding other) { if (other == null) { return; } if (other.Name.Length != 0) { Name = other.Name; } if (other.Parent.Length != 0) { Parent = other.Parent; } if (other.ResourceName.Length != 0) { ResourceName = other.ResourceName; } if (other.State != 0) { State = other.State; } if (other.Category.Length != 0) { Category = other.Category; } if (other.ExternalUri.Length != 0) { ExternalUri = other.ExternalUri; } sourceProperties_.Add(other.sourceProperties_); if (other.securityMarks_ != null) { if (securityMarks_ == null) { SecurityMarks = new global::Google.Cloud.SecurityCenter.V1.SecurityMarks(); } SecurityMarks.MergeFrom(other.SecurityMarks); } if (other.eventTime_ != null) { if (eventTime_ == null) { EventTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } EventTime.MergeFrom(other.EventTime); } if (other.createTime_ != null) { if (createTime_ == null) { CreateTime = new global::Google.Protobuf.WellKnownTypes.Timestamp(); } CreateTime.MergeFrom(other.CreateTime); } _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); }
private void StartThreadEachMouthPurpose() { foreach (Purpose ev in BaseContext._Purposes.Include("user")) { if (ev.user.ID == _user.ID) { _eventTime = BaseContext._EventTimes.Where(p => p.purpose == ev).FirstOrDefault(p => p.DoWork == 3); if (_eventTime != null) { if (CheckDate(_eventTime)) { if (_eventTime.dateTime.Day == _tempDate.date.Day) { System.DateTime dt = _tempDate.date; EventTime eventTime = BaseContext._EventTimes.Where(p => p.purpose == ev).FirstOrDefault(p => p.dateTime.DayOfYear == _tempDate.date.DayOfYear); if (eventTime == null) { System.TimeSpan timeSpan = _eventTime.dateTime.TimeOfDay; dt += timeSpan; BaseContext._Purposes.Add ( new Purpose() { Name = ev.Name, Note = ev.Note, user = _user, Duration = ev.Duration, IDFrequency = ev.IDFrequency, Work = false } ); BaseContext._EventTimes.Add ( new EventTime() { purpose = ev, DoWork = _eventTime.DoWork, dateTime = dt, Work = _eventTime.Work, } ); } else { break; } } } } } } BaseContext.SaveChanges(); System.Console.WriteLine("Поток StartThreadEachMouthPurpose завершен"); }
public virtual int _GetUniqueIdentifier() { var hashCode = 399326290; hashCode = hashCode * -1521134295 + (EventID?.GetHashCode() ?? 0); hashCode = hashCode * -1521134295 + (EventDesc?.GetHashCode() ?? 0); hashCode = hashCode * -1521134295 + (EventTime?.GetHashCode() ?? 0); return(hashCode); }
private void EventManager_onPossess(Creature creature, EventTime eventTime) { if (creature.container.contents.Where(c => c.itemData.id == "SpellIceItem").Count() <= 0) { creature.container.AddContent(Catalog.GetData <ItemData>("SpellIceItem")); } IceManager.LoadFromSave(creature); }
public void CanParseLocalizedUtcTimeString() { const string json = @"{ ""event_time"": { ""time"": ""2014-09-13T20:00:00Z"", ""tzid"": ""Etc/UTC"" } }"; var result = JsonConvert.DeserializeObject<EventTimeHolder>(json, new JsonSerializerSettings { DateParseHandling = DateParseHandling.None }); var expected = new EventTime(new DateTimeOffset(new DateTime(2014, 9, 13, 20, 0, 0), new TimeSpan(0)), "Etc/UTC"); Assert.AreEqual(expected, result.EventTime); }
public void CanParseLocalizedDateString() { const string json = @"{ ""event_time"": { ""time"": ""2014-09-13"", ""tzid"": ""Europe/London"" } }"; var result = JsonConvert.DeserializeObject<EventTimeHolder>(json, new JsonSerializerSettings { DateParseHandling = DateParseHandling.None }); var expected = new EventTime(new Date(2014, 9, 13), "Europe/London"); Assert.AreEqual(expected, result.EventTime); }
public void CanParseBasicTimeString() { const string json = @"{ ""event_time"": ""2015-09-19T12:30:45Z"" }"; var result = JsonConvert.DeserializeObject<EventTimeHolder>(json, new JsonSerializerSettings { DateParseHandling = DateParseHandling.None }); var expected = new EventTime(new DateTimeOffset(new DateTime(2015, 9, 19, 12, 30, 45), new TimeSpan(0)), "Etc/UTC"); Assert.AreEqual(expected, result.EventTime); }
/// <summary> /// intializes a simple scheduled time element from a pair of strings. /// Here are the supported formats /// /// BySecond - single integer representing the offset in ms /// ByMinute - A comma seperate list of integers representing the number of seconds and ms /// Hourly - A comma seperated list of integers representing the number of minutes, seconds and ms /// Daily - A time in hh:mm:ss AM/PM format /// Weekly - n, time where n represents an integer and time is a time in the Daily format /// Monthly - the same format as weekly. /// /// </summary> /// <param name="eventTime">A String representing the base enumeration for the scheduled time</param> /// <param name="offset">A String representing the offset for the time.</param> public ScheduledTime(String eventTime, String offset) { //TODO:Create an IScheduled time factory method. _eventTime = (EventTime) Enum.Parse(typeof(EventTime), eventTime, true); Init(offset); }
public ScheduledTime(EventTime eventTime, TimeSpan offset) { _eventTime = eventTime; _Offset = offset; }