當前位置: 首頁>>代碼示例>>C#>>正文


C# Availability類代碼示例

本文整理匯總了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;
        }
開發者ID:nicknystrom,項目名稱:AscendRewards,代碼行數:30,代碼來源:MigrateFrom0000.cs

示例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;
 }
開發者ID:wshanshan,項目名稱:DDD,代碼行數:9,代碼來源:StateDB.cs

示例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);
				}
		}
開發者ID:BlueBasher,項目名稱:S22.Xmpp,代碼行數:19,代碼來源:Status.cs

示例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;
            }
        }
開發者ID:charifield,項目名稱:Xamarin.Plugins,代碼行數:13,代碼來源:GeolocationSingleListener.cs

示例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);
        }
開發者ID:JayDoubleA,項目名稱:NpcGen,代碼行數:13,代碼來源:AppearanceFeatureModel.cs

示例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;
     }
 }
開發者ID:jakkaj,項目名稱:Xamling-Core,代碼行數:15,代碼來源:LocationTrackingSensor.cs

示例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);
 }
開發者ID:KeithVanderzanden,項目名稱:CST336-Blue-42,代碼行數:45,代碼來源:AvailabilityController.cs

示例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());
		}
開發者ID:jonny65,項目名稱:WF.Player.Android,代碼行數:12,代碼來源:LocListener.cs

示例9: OnStatusChanged

		public void OnStatusChanged (string provider, Availability status, Bundle extras)
		{
			Toast.MakeText(this, "Provider status"  + status.ToString(),ToastLength.Short).Show();
		}
開發者ID:stowjam,項目名稱:Assignment6-gpsmaps,代碼行數:4,代碼來源:MainActivity.cs

示例10: OnStatusChanged

 public void OnStatusChanged(string provider, Availability status, global::Android.OS.Bundle extras)
 {
     //Not Implemented
 }
開發者ID:Sway0308,項目名稱:TestGPS,代碼行數:4,代碼來源:AndroidGpsService.cs

示例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);
 }
開發者ID:REPLDigital,項目名稱:Sharp.Xmpp,代碼行數:26,代碼來源:XmppClient.cs

示例12: SetPresence

 public void SetPresence(Availability status, string message)
 {
     SetPresence (status, message, 1);
 }
開發者ID:noismaster,項目名稱:xmppapplication,代碼行數:4,代碼來源:Presence.cs

示例13: OnStatusChanged

		public void OnStatusChanged (string provider, Availability status, Bundle extras)
		{
			this.StatusChanged (this, new StatusChangedEventArgs (provider, status, extras));
		}
開發者ID:kierstendevenish,項目名稱:vowapp2,代碼行數:4,代碼來源:VowLocationService.cs

示例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();
     }
 }
開發者ID:leef3,項目名稱:LatLongLog_Xamarin,代碼行數:11,代碼來源:GPSNetTest.cs

示例15: OnStatusChanged

		public void OnStatusChanged (string provider, Availability status, Bundle extras)
		{
			Log.Debug (tag, provider + " availability has changed to " + status.ToString());
			OnResume ();
		}
開發者ID:scrafty614,項目名稱:XamarinStudio_Example,代碼行數:5,代碼來源:MainActivity.cs


注:本文中的Availability類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。