bool MigrateAvailability(JObject x) { // determine our mode var a = new Availability(); var availableToPublic = x.Value<bool>("AvailableToPublic "); var availableToAll = x.Value<bool>("AvailableToAllUsers"); a.Mode = availableToPublic ? AvailabilityMode.AvailableToPublic : availableToAll ? AvailabilityMode.AvailableToAllUsers : AvailabilityMode.AvailableOnlyTo; // copy users & groups arrays if there's any reason to if (AvailabilityMode.AvailableOnlyTo == a.Mode) { var users = x["Users"] as JArray; if (null != users) { a.Users = users.Select(y => y.Value<string>()).ToArray(); } var groups = x["Groups"] as JArray; if (null != groups) { a.Groups = groups.Select(y => y.Value<string>()).ToArray(); } } x["Availability"] = Session.Serializer.WriteFragment(a); return true; }
public DecisionMaker(string id, Team team) { this.isHuman = false; this.id = id; this.team = team; this.color = 000000; this.availability = Availability.AVAILABLE; this.briefing = string.Empty; }
/// <summary> /// Initializes a new instance of the Status class. /// </summary> /// <param name="availability">The availability state.</param> /// <param name="messages">A dictionary of messages providing detailed /// descriptions of the availability state. The dictionary keys denote /// the languages of the messages and must be valid ISO 2 letter language /// codes.</param> /// <param name="priority">Provides a hint for stanza routing.</param> public Status(Availability availability, Dictionary<string, string> messages, sbyte priority = 0) { Availability = availability; Priority = priority; Messages = new Dictionary<string, string>(); if (messages != null) { foreach (KeyValuePair<string, string> pair in messages) Messages.Add(pair.Key, pair.Value); } }
/// <summary> /// Initializes a new instance of the Status class. /// </summary> /// <param name="availability">The availability state.</param> /// <param name="message">An optional message providing a detailed /// description of the availability state.</param> /// <param name="priority">Provides a hint for stanza routing.</param> /// <param name="language">The language of the description of the /// availability state.</param> public Status(Availability availability, string message = null, sbyte priority = 0, CultureInfo language = null) { Availability = availability; Priority = priority; Messages = new Dictionary<string, string>(); if (language == null) language = CultureInfo.CurrentCulture; if(message != null) Messages.Add(language.Name, message); }
public void OnStatusChanged(string provider, Availability status, Bundle extras) { switch (status) { case Availability.Available: OnProviderEnabled(provider); break; case Availability.OutOfService: OnProviderDisabled(provider); break; } }
public AppearanceFeatureModel(string name, AppearanceType type, string description = "", Availability availability = Availability.Common, List<Race> races = null, List<Gender> genders = null) { Name = name; AppearanceType = type; Description = description.NotNullOrEmpty() ? description : name; Availability = availability; var raceEnums = races ?? AllRaces; Races = string.Join("|", raceEnums); var genderEnums = genders ?? new List<Gender> {Gender.Female, Gender.Male}; Genders = string.Join("|", genderEnums); }
public void OnStatusChanged(string provider, Availability status, Bundle extras) { switch (status) { case Availability.OutOfService: _isUnavailable(); break; case Availability.TemporarilyUnavailable: _isUnavailable(); break; case Availability.Available: _isAvailable(); break; } }
public async Task<ActionResult> Index(AvailabilityModel model) { bool saveSuccessful = false; if (ModelState.IsValid) { using (var client = new DataServiceClient()) { client.Open(); var infoToStore = new Availability(); infoToStore.applicantId = Convert.ToInt32(this.Session["ApplicantId"]); infoToStore.daysYN = model.daysYN; infoToStore.eveningsYN = model.eveningsYN; infoToStore.weekendsYN = model.weekendsYN; infoToStore.fullTimeYN = model.fullTimeYN; infoToStore.salaryExpected = model.salaryExpected; infoToStore.mondayFrom = model.mondayFrom > 0 ? new Nullable<TimeSpan>(new TimeSpan(model.mondayFrom - 1, 0, 0)) : null; infoToStore.mondayTo = model.mondayTo > 0 ? new Nullable<TimeSpan>(new TimeSpan(model.mondayTo - 1, 0, 0)) : null; infoToStore.tuesdayFrom = model.tuesdayFrom > 0 ? new Nullable<TimeSpan>(new TimeSpan(model.tuesdayFrom - 1, 0, 0)) : null; infoToStore.tuesdayTo = model.tuesdayTo > 0 ? new Nullable<TimeSpan>(new TimeSpan(model.tuesdayTo - 1, 0, 0)) : null; infoToStore.wednesdayFrom = model.wednesdayFrom > 0 ? new Nullable<TimeSpan>(new TimeSpan(model.wednesdayFrom - 1, 0, 0)) : null; infoToStore.wednesdayTo = model.wednesdayTo > 0 ? new Nullable<TimeSpan>(new TimeSpan(model.wednesdayTo - 1, 0, 0)) : null; infoToStore.thursdayFrom = model.thursdayFrom > 0 ? new Nullable<TimeSpan>(new TimeSpan(model.thursdayFrom - 1, 0, 0)) : null; infoToStore.thursdayTo = model.thursdayTo > 0 ? new Nullable<TimeSpan>(new TimeSpan(model.thursdayTo - 1, 0, 0)) : null; infoToStore.fridayFrom = model.fridayFrom > 0 ? new Nullable<TimeSpan>(new TimeSpan(model.fridayFrom - 1, 0, 0)) : null; infoToStore.fridayTo = model.fridayTo > 0 ? new Nullable<TimeSpan>(new TimeSpan(model.fridayTo - 1, 0, 0)) : null; infoToStore.saturdayFrom = model.saturdayFrom > 0 ? new Nullable<TimeSpan>(new TimeSpan(model.saturdayFrom - 1, 0, 0)) : null; infoToStore.saturdayTo = model.saturdayTo > 0 ? new Nullable<TimeSpan>(new TimeSpan(model.saturdayTo - 1, 0, 0)) : null; infoToStore.sundayFrom = model.sundayFrom > 0 ? new Nullable<TimeSpan>(new TimeSpan(model.sundayFrom - 1, 0, 0)) : null; infoToStore.sundayTo = model.sundayTo > 0 ? new Nullable<TimeSpan>(new TimeSpan(model.sundayTo - 1, 0, 0)) : null; infoToStore.applicantId = model.applicantId; saveSuccessful = await client.updateAvailabilityAsync(infoToStore); client.Close(); } if (saveSuccessful) { this.Session["Availability"] = "Done"; return RedirectToAction("Index", "JobHistory"); } else { //some error has occured saving --currently do nothing } } return View(model); }
/// <summary> /// Called when the state of a location provider has changed. /// </summary> void ILocationListener.OnStatusChanged(string provider, Availability status, Bundle extras) { Log.Debug(logTag, "OnStatusChanged: " + provider + " - " + status); }
public void OnStatusChanged(string provider, Availability status, global::Android.OS.Bundle extras) { //Not Implemented }
public void OnStatusChanged(string provider, Availability status, Bundle extras) { if(provider == LocationManager.GpsProvider) { gpsStatus2.Text = status.ToString(); } else if(provider == LocationManager.NetworkProvider) { networkStatus.Text = status.ToString(); } }
void ILocationListener.OnStatusChanged(string provider, Availability status, Bundle extras) { }
public void OnStatusChanged(string provider, [GeneratedEnum] Availability status, Bundle extras) { throw new System.NotImplementedException(); }
/// <summary> /// Status of the location services provider. /// </summary> /// <param name="provider">Type of provider for location services.</param> /// <param name="status">Availability of location services.</param> /// <param name="extras">Bundle.</param> public void OnStatusChanged(String provider, Availability status, Bundle extras) { // Required for ILocationListener }
public void OnStatusChanged (string provider, Availability status, Bundle extras) { this.StatusChanged (this, new StatusChangedEventArgs (provider, status, extras)); }
public void OnStatusChanged(string provider, Availability status, Bundle extras) { Log.Debug(tag, provider + " availability has changed to " + status.ToString()); }
public void OnStatusChanged(string provider, Availability status, Bundle extras) { Console.WriteLine("{0}, {1}", provider, status); }
// GET api/<controller> public List <Availability> Get() { Availability a = new Availability(); return(a.getAvailabilities()); }
// POST api/<controller> public Availability Post([FromBody] Availability availability) { availability.insert(); return(availability); }
/// <summary> /// Class to represent the buttons in a timetable /// </summary> /// <param name="color">color of the button</param> /// <param name="x">x coordinate of the button in pixels</param> /// <param name="y">y coordinate of the button in pixels</param> /// <param name="height">height of the button in pixels</param> /// <param name="width">width of the button in pixels</param> /// <param name="text">Text to be displayed on the button</param> /// <param name="scale">Determines the position of the text on the button</param> /// <param name="value">The string returned when the button is clicked</param> public Block(Color color, float x, float y, int height, int width, string text, int scale, string value) : base(color, x, y, height, width, text, scale, value) { _availability = Availability.N; }
public void AddEditInstallerAvailability(Availability a) { InstallUserDAL.Instance.AddEditInstallerAvailability(a); }
public void OnStatusChanged(string provider, [GeneratedEnum] Availability status, Bundle extras) { System.Diagnostics.Debug.WriteLine(provider + " availability has changed to " + status.ToString()); }
public void SetPresence(Availability status, string message, int priority) { switch (status) { case Availability.Available: XmppGlobal.InternalClient.Presence (PresenceType.available, message, "", priority); break; case Availability.Chat: XmppGlobal.InternalClient.Presence (PresenceType.available, message, "chat", priority); break; case Availability.Away: XmppGlobal.InternalClient.Presence (PresenceType.available, message, "away", priority); break; case Availability.ExtendedAway: XmppGlobal.InternalClient.Presence (PresenceType.available, message, "xa", priority); break; case Availability.DoNotDisturb: XmppGlobal.InternalClient.Presence (PresenceType.available, message, "dnd", priority); break; } }
/// <summary> /// Called when the provider status changes. /// </summary> /// <param name="provider">The name of the location provider associated with this update.</param> /// <param name="status">The status.</param> /// <param name="extras">The extras.</param> public void OnStatusChanged(string provider, Availability status, Bundle extras) { StatusChanged.SafeInvoke(this); }
/// <summary> /// Additional operations to be performed when cloning an instance of <see cref="Availability"/> to an instance of <see cref="PSProductAvailability" />. /// </summary> /// <param name="productAvailability">The product availablity being cloned.</param> private void CloneAdditionalOperations(Availability productAvailability) { AvailabilityId = productAvailability.Id; DefaultCurrencyCode = productAvailability.DefaultCurrency.Code; DefaultCurrencySymbol = productAvailability.DefaultCurrency.Symbol; }
public void OnStatusChanged (string provider, Availability status, Bundle extras) { Log.Debug (tag, provider + " availability has changed to " + status.ToString()); OnResume (); }
/// <summary> /// Initializes a new instance of the <see cref="PSProductAvailability" /> class. /// </summary> /// <param name="productAvailability">The base product availablity for this instance.</param> public PSProductAvailability(Availability productAvailability) { this.CopyFrom(productAvailability, CloneAdditionalOperations); }
/// <summary> /// Sets the availability status. /// </summary> /// <param name="availability">The availability state. Can be one of the /// values from the Availability enumeration, however not /// Availability.Offline.</param> /// <param name="messages">A dictionary of messages providing detailed /// descriptions of the availability state. The dictionary keys denote /// the languages of the messages and must be valid ISO 2 letter language /// codes.</param> /// <param name="priority">Provides a hint for stanza routing.</param> /// <exception cref="ArgumentException">The availability parameter has a /// value of Availability.Offline.</exception> /// <exception cref="IOException">There was a failure while writing to or reading /// from the network.</exception> /// <exception cref="InvalidOperationException">The XmppClient instance is not /// connected to a remote host, or the XmppClient instance has not authenticated with /// the XMPP server.</exception> /// <exception cref="ObjectDisposedException">The XmppClient object has been /// disposed.</exception> public void SetStatus(Availability availability, Dictionary<string, string> messages, sbyte priority = 0) { AssertValid(); im.SetStatus(availability, messages, priority); }
public void OnStatusChanged(string provider, [GeneratedEnum] Availability status, Bundle extras) { }
public void OnStatusChanged(string provider, Availability status, Bundle extras) { Toast.MakeText(this, "Provider status " + status.ToString(), ToastLength.Short).Show(); }
public static IEnumerable <long> CalculateTimeFromEpoch(Availability availability) { return(EachDay(availability.StartTime, (DateTime)availability.EndTime) .Select(day => (long)(day - new DateTime(1970, 1, 1)).TotalSeconds)); }
public static bool SaveAvailability(Availability avail, string conStr) { if (avail != null) { using (SqlConnection connection = new SqlConnection(conStr)) { User curUser = User.CurrentUser; //long subId = -1; //switch (curUser.Type) //{ // case EntityType.Tutor: // subId = ((TutorProfile)curUser).Id; // break; // case EntityType.Student: // subId = ((Student)curUser).Id; // break; // case EntityType.Parent: // subId = ((Parent)curUser).Id; // break; // case EntityType.School: // subId = ((School)curUser).Id; // break; //} DataTable availability = new DataTable();// "Availability"); availability.Columns.Add("UId", typeof(long)); availability.Columns.Add("ObjEntityId", typeof(byte)); availability.Columns.Add("DayId", typeof(byte)); availability.Columns.Add("FromTime", typeof(byte)); availability.Columns.Add("ToTime", typeof(byte)); availability.Columns.Add("PhoneCall", typeof(bool)); availability.Columns.Add("OnlineSession", typeof(bool)); availability.Columns.Add("FacetoFace", typeof(bool)); avail.Days.Where <AvailabilityDay>(d => d.Active).ToList().ForEach(d => d.Limits.ToList <TimeLimit>().ForEach(t => { DataRow row = availability.NewRow(); row["UId"] = curUser.UserId; row["ObjEntityId"] = (byte)curUser.Type; row["DayId"] = d.Day.Index; row["FromTime"] = t.From.Index; row["ToTime"] = t.To.Index; row["PhoneCall"] = t.Extra.PhoneCall; row["OnlineSession"] = t.Extra.OnlineSession; row["FacetoFace"] = t.Extra.FaceToFace; availability.Rows.Add(row); })); SqlCommand cmd = new SqlCommand("sp_ManageAvailability", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter { ParameterName = "@Avail", TypeName = "Availability", SqlDbType = SqlDbType.Structured, Value = availability }); cmd.Parameters.Add(new SqlParameter { ParameterName = "@Mode", SqlDbType = SqlDbType.VarChar, Value = "Save" }); connection.Open(); var r = cmd.ExecuteNonQuery(); return(true); } } return(false); }
public Availability Add(Availability entity, object?userId = null) { throw new NotImplementedException(); }
public static Availability GetAvailability(string conStr) { Availability avail = new Availability(); using (SqlConnection connection = new SqlConnection(conStr)) { User curUser = User.CurrentUser; //long subId = -1; //switch (curUser.Type) //{ // case EntityType.Tutor: // subId = ((TutorProfile)curUser).Id; // break; // case EntityType.Student: // subId = ((Student)curUser).Id; // break; // case EntityType.Parent: // subId = ((Parent)curUser).Id; // break; // case EntityType.School: // subId = ((School)curUser).Id; // break; //} SqlCommand cmd = new SqlCommand("sp_ManageAvailability", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter { ParameterName = "@UId", SqlDbType = SqlDbType.BigInt, Value = curUser.UserId }); cmd.Parameters.Add(new SqlParameter { ParameterName = "@ObjEntityId", SqlDbType = SqlDbType.TinyInt, Value = (byte)curUser.Type });; cmd.Parameters.Add(new SqlParameter { ParameterName = "@Mode", SqlDbType = SqlDbType.VarChar, Value = "GetAvailability" }); connection.Open(); SqlDataReader reader = cmd.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { avail.Days.AsEnumerable <AvailabilityDay>().Where <AvailabilityDay>(d => d.Day.Index == reader.GetByte(2)).SingleOrDefault <AvailabilityDay>().Add(new TimeLimit { From = new TimePoint { Index = reader.GetByte(3), Value = TimePoint.Times[reader.GetByte(3)].Value }, To = new TimePoint { Index = reader.GetByte(4), Value = TimePoint.Times[reader.GetByte(4)].Value }, Extra = new TimeLimitExtra { PhoneCall = reader.GetBoolean(5), OnlineSession = reader.GetBoolean(6), FaceToFace = reader.GetBoolean(7) } }); } } } return(avail); }
public void OnStatusChanged(string provider, Availability status, Bundle extras) { Log.Debug(_tag, provider + " availability has changed to " + status); }
public void OnStatusChanged(string provider, Availability status, Bundle extras) { //throw new NotImplementedException(); }
public void SetPresence(Availability status, string message) { SetPresence (status, message, 1); }
/// <summary> /// /// </summary> /// <param name="provider"></param> /// <param name="status"></param> /// <param name="extras"></param> public void OnStatusChanged(string provider, [GeneratedEnum] Availability status, Bundle extras) { StopLocationUpdates(); StartLocationUpdates(); }
public void OnStatusChanged(string provider, Availability status, Bundle extras) { //Toast.MakeText(this, "OnStatusChanged", ToastLength.Short).Show ();//... }
// Add an Availability public void Add(Availability availability) { _context.Availability.Add(availability); _context.SaveChanges(); }
public void OnStatusChanged (string provider, Availability status, Bundle extras) { Log.Debug (TAG, "{0}, {1}", provider, status); }
public List <ProductModel> GetAll(Availability availability = Availability.All, string productName = "", int skip = 0, int count = 0) { return(_dataManager.Products.GetAll(false, GetExpressionByAvailability(availability, productName), skip, count) .Select(ProductDbToModel).ToList()); }
public void OnStatusChanged(string provider, Availability status, Bundle extras) { _owner.OnStatusChanged(provider, status, extras); }
public void OnStatusChanged(string provider, Availability status, Bundle extras) { locationLabel.Text = "Provider status changed"; }
public void SetAvailability(Availability availability) { var user = Core.Utility.Storage.Repository<Guid, IPresence>.GetById(this.PersistentId); user.Availability = availability; SavePresence(user); }
public void OnStatusChanged(string provider, Availability status, Bundle extras) { }
/// <summary> /// Sets the availability status. /// </summary> /// <param name="availability">The availability state. Can be one of the /// values from the Availability enumeration, however not /// Availability.Offline.</param> /// <param name="message">An optional message providing a detailed /// description of the availability state.</param> /// <param name="priority">Provides a hint for stanza routing.</param> /// <param name="language">The language of the description of the /// availability state.</param> /// <exception cref="ArgumentException">The availability parameter has a /// value of Availability.Offline.</exception> /// <exception cref="IOException">There was a failure while writing to or reading /// from the network.</exception> /// <exception cref="InvalidOperationException">The XmppClient instance is not /// connected to a remote host, or the XmppClient instance has not authenticated with /// the XMPP server.</exception> /// <exception cref="ObjectDisposedException">The XmppClient object has been /// disposed.</exception> public void SetStatus(Availability availability, string message = null, sbyte priority = 0, CultureInfo language = null) { AssertValid(); im.SetStatus(availability, message, 0, language); }
public Task <Availability> RemoveAsync(Availability entity, object?userId = null) { throw new NotImplementedException(); }
public void OnStatusChanged (string provider, Availability status, Bundle extras) { Toast.MakeText(this, "Provider status" + status.ToString(),ToastLength.Short).Show(); }
public void AddMemberAvailability(int memberId, Availability availability) { var member = GetMember(memberId, false); member.Availabilities.Add(availability); }
/// <summary> /// Called when the status of the location listener changed. /// </summary> /// <param name="provider">the name of the location provider associated with this /// update.</param> /// <param name="status">Status.</param> /// <param name="extras">Extras.</param> public void OnStatusChanged (string provider, Availability status, Bundle extras) { // TODO: Remove Console.WriteLine ("Status changed: {0} is {1}",provider,status.ToString()); }
public void OnStatusChanged(string provider, Availability status, Bundle extras) { Log.Debug(TAG, "{0}, {1}", provider, status); }
public int GetCount(Availability availability = Availability.All, string productName = "") { return(_dataManager.Products.GetCount(GetExpressionByAvailability(availability, productName))); }
public Vape(string Name, string prodState, int rating, VapeType vapeT, string imgURL, int price, string descript, Availability avail, int count) { this.Name = Name; this.StateProd = prodState; this.Rating = rating; this.Type = vapeT; this.ImageURL = imgURL; this.Price = price; this.Description = descript; this.Avail = avail; this.Count = count; }
public void OnStatusChanged(string provider, Availability status, Bundle extras) { switch (status) { case Availability.Available: break; case Availability.OutOfService: case Availability.TemporarilyUnavailable: SendError(MvxLocationErrorCode.PositionUnavailable); break; default: throw new ArgumentOutOfRangeException("status"); } }
public void OnStatusChanged(string provider, Availability status, Bundle extras) { //TO DO: }
public void OnStatusChanged(string provider, Availability status, Bundle extras) { // throw new NotImplementedException(); }
public void DeleteAvailability(Availability availability) { _context.Availabilities.Remove(availability); }