/// <summary> /// Activate to ring /// </summary> /// <param name="delay">The duration of the alarm delay period before an alarm will activate</param> /// <seealso cref="int"> /// <param name="type">RingType for ringing</param> /// <seealso cref="RingType"> public void ActivateAlarm(int delay, RingType type) { Native.AppControl appControl = new Native.AppControl(); appControl.ApplicationId = Native.Application.Current.ApplicationInfo.ApplicationId; appControl.ExtraData.Add("RingType", type.ToString()); Native.AlarmManager.CreateAlarm(delay, appControl); }
public void PretendNewReleaseAvailableAtRemote(string upgradeVersion, RingType remoteRing) { string assetDownloadURLPrefix = "https://github.com/Microsoft/VFSForGit/releases/download/v" + upgradeVersion; Release release = new Release(); release.Name = "GVFS " + upgradeVersion; release.Tag = "v" + upgradeVersion; release.PreRelease = remoteRing == RingType.Fast; release.Assets = new List <Asset>(); Random random = new Random(); Asset gvfsAsset = new Asset(); gvfsAsset.Name = "VFSForGit." + upgradeVersion + GVFSPlatform.Instance.Constants.InstallerExtension; // This is not cross-checked anywhere, random value is good. gvfsAsset.Size = random.Next(int.MaxValue / 10, int.MaxValue / 2); gvfsAsset.DownloadURL = new Uri(assetDownloadURLPrefix + "/VFSForGit." + upgradeVersion + GVFSPlatform.Instance.Constants.InstallerExtension); release.Assets.Add(gvfsAsset); Asset gitAsset = new Asset(); gitAsset.Name = "Git-2.17.1.gvfs.2.1.4.g4385455-64-bit" + GVFSPlatform.Instance.Constants.InstallerExtension; gitAsset.Size = random.Next(int.MaxValue / 10, int.MaxValue / 2); gitAsset.DownloadURL = new Uri(assetDownloadURLPrefix + "/Git-2.17.1.gvfs.2.1.4.g4385455-64-bit" + GVFSPlatform.Instance.Constants.InstallerExtension); release.Assets.Add(gitAsset); this.expectedGVFSAssetName = gvfsAsset.Name; this.expectedGitAssetName = gitAsset.Name; this.FakeUpgradeRelease = release; }
public virtual bool TryLoadRingConfig(out string error) { string gitPath = GVFSPlatform.Instance.GitInstallation.GetInstalledGitBinPath(); LocalGVFSConfig localConfig = new LocalGVFSConfig(); string ringConfig = null; if (localConfig.TryGetConfig(GVFSConstants.LocalGVFSConfig.UpgradeRing, out ringConfig, out error, this.tracer)) { RingType ringType; if (Enum.TryParse(ringConfig, ignoreCase: true, result: out ringType) && Enum.IsDefined(typeof(RingType), ringType) && ringType != RingType.Invalid) { this.Ring = ringType; error = null; return(true); } if (string.IsNullOrEmpty(ringConfig)) { this.Ring = RingType.NoConfig; error = null; return(true); } error = "Invalid upgrade ring `" + ringConfig + "` specified in gvfs config." + Environment.NewLine; } error += GVFSConstants.UpgradeVerbMessages.SetUpgradeRingCommand; this.Ring = RingType.Invalid; return(false); }
public static RingEffectParameters With(RingType ring) { return(new RingEffectParameters() { Ring = ring }); }
public RingPage(RingType type) { NavigationPage.SetHasNavigationBar(this, false); Content = CreateRingPage(type); if (type == RingType.RING_TYPE_TIMER) { CreateElapsedTimer(); } }
public override void Initialize() { base.Initialize(); InstanceName = "CommonRing"; IType = ItemType.Ring; RType = RingType.None; IsDriveProb = true; TotalRing = 0; }
public RingPage(RingType type, AlarmRecord alarmRecord) { try { NavigationPage.SetHasNavigationBar(this, false); _alarmRecord = alarmRecord; SnoozeOn = _alarmRecord.Snooze; Content = CreateRingPage(type); } catch (Exception EX) { System.Diagnostics.Debug.WriteLine("RingPage() exception : " + EX.Message + " , " + EX.Source + ", " + EX.StackTrace); } }
static void Main(string[] args) { RingType forHer = RingType.Pear; var ring = RingType.Round; var message = String.Empty; if (forHer == RingType.Pear) { Console.WriteLine("Um no"); } else { Console.WriteLine("Trueee"); } switch (forHer) { case RingType.Marquise: message = "You are going to be a star"; break; case RingType.Pear: message = "You are un-pear-able"; break; case RingType.Round: message = "You are well-rounded"; break; default: message = "You is broke"; break; } Console.WriteLine(message); string[] traitsOfShamilah = new string[5] { "Happy", "Hungry", "Angry", "Sexy", "Smarty" }; foreach (var traits in traitsOfShamilah) { Console.WriteLine(traits); } }
public TableRingData(ushort objNo, string displayName, string displayNameEn, RingType rtype, float throwDexterity, int state, string description, string descriptionEn) { ObjNo = objNo; DisplayName = displayName; DisplayNameEn = displayNameEn; RType = rtype; ThrowDexterity = throwDexterity; State = state; Description = description; DescriptionEn = descriptionEn; }
public string GetItemName(float type, float id) { switch (type) { case (int)TypeOfItem.Type.Weapon: return((WeaponType.GetWeaponName(id) + "_" + (id + 1).ToString()).ToUpper()); case (int)TypeOfItem.Type.Ring: return((RingType.GetRingName(id) + "_" + (id + 1).ToString()).ToUpper()); case (int)TypeOfItem.Type.Amulet: return((AmuletType.GetAmuletName(id) + "_" + (id + 1).ToString()).ToUpper()); case (int)TypeOfItem.Type.Armor: return((ArmorType.GetArmorName(id) + "_" + (id + 1).ToString()).ToUpper()); default: return((OtherType.GetOtherName(id) + "_" + (id + 1).ToString()).ToUpper()); } }
public static EffectDescriptionLine GetEffectDescription(this RingType ring) { // todo: get description from original item switch (ring) { case RingType.SlimeCharmerRing: return(new EffectDescriptionLine(EffectIcon.None, "Prevents damage from slimes")); // EffectIcon.Slime case RingType.YobaRing: return(new EffectDescriptionLine(EffectIcon.Yoba, "Occasionally shields the wearer from damage")); case RingType.SturdyRing: return(new EffectDescriptionLine(EffectIcon.None, "Cuts the duration of negative status effects in half")); case RingType.BurglarsRing: return(new EffectDescriptionLine(EffectIcon.None, "Monsters have a greater chance of dropping loot")); default: return(new EffectDescriptionLine(EffectIcon.None, "Unknown effect")); } }
/// <summary> /// Create StackLayout for RingPage UI /// </summary> /// <param name="type">RingType</param> /// <returns>StackLayout</returns> public StackLayout CreateRingPage(RingType type) { type_ = type; rLayout = new RelativeLayout { HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, }; if (type == RingType.RING_TYPE_ALARM) { CreateAlarmInfo(); // Tone type (Phase 3) // Alarm Type if (_alarmRecord.AlarmType == Alarm.AlarmTypes.Sound) { DependencyService.Get <IAlarm>().PlaySound((float)_alarmRecord.Volume, _alarmRecord.AlarmToneType); } else if (_alarmRecord.AlarmType == Alarm.AlarmTypes.Vibration) { DependencyService.Get <IAlarm>().StartVibration(); } else if (_alarmRecord.AlarmType == Alarm.AlarmTypes.SoundVibration) { DependencyService.Get <IAlarm>().PlaySound((float)_alarmRecord.Volume, _alarmRecord.AlarmToneType); DependencyService.Get <IAlarm>().StartVibration(); } swipeAreaLayout = new AbsoluteLayout { HeightRequest = 438, HorizontalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.White, }; if (SnoozeOn) { CreateSnoozeAlarmOnOffArea(); } else { CreateAlarmOnOffArea(); } } else { CreateRingLabels(); swipeAreaLayout = new AbsoluteLayout { HeightRequest = 438, HorizontalOptions = LayoutOptions.FillAndExpand, BackgroundColor = Color.White, }; CreateTimerOnOffArea(); } StackLayout mainView = new StackLayout { Orientation = StackOrientation.Vertical, HorizontalOptions = LayoutOptions.FillAndExpand, VerticalOptions = LayoutOptions.FillAndExpand, Spacing = 0, Children = { rLayout, swipeAreaLayout } }; return(mainView); }
public RingEffect(RingType ring) : base(RingEffectParameters.With(ring)) { // -- }
public JumpRing(JumpRing j) { this.type = j.type; this.c = j.c; this.right = j.right; this.direction = j.direction; this.up = j.up; this.position = j.position; this.width = j.width; }
public JumpRing(RingType type, Vector3 pos, Vector3 up, Vector3 normal, float width, float radius) { this.type = type; this.radius = radius; this.width = width; this.right = Vector3.Cross(normal, up); this.direction = normal; this.up = up; this.position = pos; }
public JumpRing(RingType type, Vector3 pos, Vector3 up, Vector3 normal) { this.type = type; this.right = Vector3.Cross(normal, up); this.direction = normal; this.up = up; this.position = pos; }