本文整理汇总了C#中Availability类的典型用法代码示例。如果您正苦于以下问题:C# Availability类的具体用法?C# Availability怎么用?C# Availability使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Availability类属于命名空间,在下文中一共展示了Availability类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MigrateAvailability
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;
}
示例2: DecisionMaker
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;
}
示例3: Status
/// <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);
}
}
示例4: OnStatusChanged
public void OnStatusChanged(string provider, Availability status, Bundle extras)
{
switch (status)
{
case Availability.Available:
OnProviderEnabled(provider);
break;
case Availability.OutOfService:
OnProviderDisabled(provider);
break;
}
}
示例5: AppearanceFeatureModel
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);
}
示例6: OnStatusChanged
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;
}
}
示例7: Index
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);
}
示例8: OnStatusChanged
/// <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());
}
示例9: OnStatusChanged
public void OnStatusChanged (string provider, Availability status, Bundle extras)
{
Toast.MakeText(this, "Provider status" + status.ToString(),ToastLength.Short).Show();
}
示例10: OnStatusChanged
public void OnStatusChanged(string provider, Availability status, global::Android.OS.Bundle extras)
{
//Not Implemented
}
示例11: SetStatus
/// <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);
}
示例12: SetPresence
public void SetPresence(Availability status, string message)
{
SetPresence (status, message, 1);
}
示例13: OnStatusChanged
public void OnStatusChanged (string provider, Availability status, Bundle extras)
{
this.StatusChanged (this, new StatusChangedEventArgs (provider, status, extras));
}
示例14: OnStatusChanged
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();
}
}
示例15: OnStatusChanged
public void OnStatusChanged (string provider, Availability status, Bundle extras)
{
Log.Debug (tag, provider + " availability has changed to " + status.ToString());
OnResume ();
}