当前位置: 首页>>代码示例>>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;未经允许,请勿转载。