public Repeater(BehaviourTree tree, int repeatNTimes, RepeatType repeatType, Node[] children) : base(children) { this.repeatNTimes = repeatNTimes; this.repeatType = repeatType; base.tree = tree; }
public static AnimData CustomMethodToFloat(AnimCustomMethodFloat method, float from, float to, float time = 0.5f, float delayTime = 0, InterpType interp = InterpType.Default, bool IsIgnoreTimeScale = false, RepeatType repeatType = RepeatType.Once, int repeatCount = -1, AnimCallBack callBack = null, object[] parameter = null) { AnimData l_tmp = HeapObjectPool <AnimData> .GetObject();; l_tmp.m_animType = AnimType.Custom_Float; l_tmp.m_fromFloat = from; l_tmp.m_toFloat = to; l_tmp.m_customMethodFloat = method; l_tmp.m_delayTime = delayTime; l_tmp.m_totalTime = time; l_tmp.m_interpolationType = interp; l_tmp.m_repeatType = repeatType; l_tmp.m_repeatCount = repeatCount; l_tmp.m_ignoreTimeScale = IsIgnoreTimeScale; l_tmp.m_callBack = callBack; l_tmp.m_parameter = parameter; l_tmp.Init(); GetInstance().animList.Add(l_tmp); return(l_tmp); }
public static AnimData CustomMethodToVector4(AnimCustomMethodVector4 method, Vector4 from, Vector4 to, float time = 0.5f, float delayTime = 0, InterpType interp = InterpType.Default, bool IsIgnoreTimeScale = false, RepeatType repeatType = RepeatType.Once, int repeatCount = -1, AnimCallBack callBack = null, object[] parameter = null) { AnimData l_tmp = new AnimData();; l_tmp.m_animType = AnimType.Custom_Vector4; l_tmp.m_fromV4 = from; l_tmp.m_toV4 = to; l_tmp.m_customMethodV4 = method; l_tmp.m_delayTime = delayTime; l_tmp.m_totalTime = time; l_tmp.m_interpolationType = interp; l_tmp.m_repeatType = repeatType; l_tmp.m_repeatCount = repeatCount; l_tmp.m_ignoreTimeScale = IsIgnoreTimeScale; l_tmp.m_callBack = callBack; l_tmp.m_parameter = parameter; l_tmp.Init(); GetInstance().animList.Add(l_tmp); return(l_tmp); }
public static DateTime Repeat(this DateTime date, RepeatType repeat, int repeatCount) { switch (repeat) { case RepeatType.Daily: date = date.AddDays(1 * repeatCount); break; case RepeatType.Weekly: date = date.AddDays(7 * repeatCount); break; case RepeatType.BiWeekly: date = date.AddDays(14 * repeatCount); break; case RepeatType.Monthly: date = date.AddMonths(1 * repeatCount); break; case RepeatType.Quarterly: date = date.AddMonths(3 * repeatCount); break; case RepeatType.Yearly: date = date.AddYears(1 * repeatCount); break; } return(date); }
public static AnimData AlphaTo(GameObject animObject, float from, float to, float time = 0.5f, float delayTime = 0, InterpType interp = InterpType.Default, bool IsIgnoreTimeScale = false, RepeatType repeatType = RepeatType.Once, int repeatCount = -1, bool isChild = true, AnimCallBack callBack = null, object[] parameter = null) { AnimData l_tmp = new AnimData();; l_tmp.m_animGameObejct = animObject; l_tmp.m_animType = AnimType.Alpha; l_tmp.m_fromFloat = from; l_tmp.m_toFloat = to; l_tmp.m_isChild = isChild; l_tmp.m_delayTime = delayTime; l_tmp.m_totalTime = time; l_tmp.m_interpolationType = interp; l_tmp.m_repeatType = repeatType; l_tmp.m_repeatCount = repeatCount; l_tmp.m_ignoreTimeScale = IsIgnoreTimeScale; l_tmp.m_callBack = callBack; l_tmp.m_parameter = parameter; l_tmp.Init(); GetInstance().animList.Add(l_tmp); return(l_tmp); }
private void TimerElasped(object sender, ElapsedEventArgs elapsedEventArgs) { taskTimer.Enabled = false; IUserAccountService userService = m_registry.RequestModuleInterface <IUserAccountService>(); List <UserAccount> users = new List <UserAccount>(); users = userService.GetUserAccounts(new List <UUID> { UUID.Zero }, 0, m_options.StipendsPremiumOnly ? 600 : 0); foreach (UserAccount user in users) { SchedulerItem i = m_scheduler.Get(user.PrincipalID.ToString(), "StipendsPayout"); if (i != null) { continue; } RepeatType runevertype = (RepeatType)Enum.Parse(typeof(RepeatType), m_options.StipendsEveryType); int runevery = m_options.StipendsEvery; m_scheduler.Save(new SchedulerItem("StipendsPayout", OSDParser.SerializeJsonString( new StipendsInfo() { AgentID = user.PrincipalID }.ToOSD()), false, UnixTimeStampToDateTime(user.Created), runevery, runevertype, user.PrincipalID) { HisotryKeep = true, HistoryReciept = true }); } }
public static AnimData CustomMethodToVector3(AnimCustomMethodVector3 method, Vector3 from, Vector3 to, float time = 0.5f, float delayTime = 0, InterpType interp = InterpType.Default, bool IsIgnoreTimeScale = false, RepeatType repeatType = RepeatType.Once, int repeatCount = -1, AnimCallBack callBack = null, object[] parameter = null) { AnimParamHash animParnHash = new AnimParamHash( AnimParamType.AnimType, AnimType.Custom_Vector3, AnimParamType.FromV3, from, AnimParamType.ToV3, to, AnimParamType.Time, time, AnimParamType.DelayTime, delayTime, AnimParamType.InteType, interp, AnimParamType.RepeatType, repeatType, AnimParamType.CustomMethodV3, method, AnimParamType.IsIgnoreTimeScale, IsIgnoreTimeScale, AnimParamType.RepeatCount, repeatCount, AnimParamType.CallBack, callBack, AnimParamType.CallBackParams, parameter ); return(ValueTo(animParnHash)); }
public static AnimData AlphaTo(GameObject animObject, float from, float to, float time = 0.5f, float delayTime = 0, InterpType interp = InterpType.Default, bool IsIgnoreTimeScale = false, RepeatType repeatType = RepeatType.Once, int repeatCount = -1, bool isChild = true, AnimCallBack callBack = null, object[] parameter = null) { AnimParamHash animParnHash = new AnimParamHash( AnimParamType.GameObj, animObject, AnimParamType.AnimType, AnimType.Alpha, AnimParamType.FromFloat, from, AnimParamType.ToFloat, to, AnimParamType.Time, time, AnimParamType.DelayTime, delayTime, AnimParamType.InteType, interp, AnimParamType.IsIncludeChild, isChild, AnimParamType.RepeatType, repeatType, AnimParamType.IsIgnoreTimeScale, IsIgnoreTimeScale, AnimParamType.RepeatCount, repeatCount, AnimParamType.CallBack, callBack, AnimParamType.CallBackParams, parameter ); return(ValueTo(animParnHash)); }
public static AnimData UguiMove(GameObject animObject, Vector3?from, Vector3 to, float time = 0.5f, float delayTime = 0, InterpType interp = InterpType.Default, bool IsIgnoreTimeScale = false, RepeatType repeatType = RepeatType.Once, int repeatCount = -1, AnimCallBack callBack = null, object[] parameter = null) { Vector3 fromTmp = from ?? animObject.GetComponent <RectTransform>().anchoredPosition; AnimData l_tmp = HeapObjectPool <AnimData> .GetObject();; l_tmp.m_animGameObejct = animObject; l_tmp.m_animType = AnimType.UGUI_AnchoredPosition; l_tmp.m_fromV3 = fromTmp; l_tmp.m_toV3 = to; l_tmp.m_delayTime = delayTime; l_tmp.m_totalTime = time; l_tmp.m_interpolationType = interp; l_tmp.m_repeatType = repeatType; l_tmp.m_repeatCount = repeatCount; l_tmp.m_ignoreTimeScale = IsIgnoreTimeScale; l_tmp.m_callBack = callBack; l_tmp.m_parameter = parameter; l_tmp.Init(); GetInstance().animList.Add(l_tmp); return(l_tmp); }
public static AnimData Blink(GameObject animObject, float space, float time = 0.5f, float delayTime = 0, bool IsIgnoreTimeScale = false, RepeatType repeatType = RepeatType.Once, int repeatCount = -1, AnimCallBack callBack = null, object[] parameter = null) { AnimData l_tmp = new AnimData();; l_tmp.m_animType = AnimType.Blink; l_tmp.m_animGameObejct = animObject; l_tmp.m_space = space; l_tmp.m_delayTime = delayTime; l_tmp.m_totalTime = time; l_tmp.m_repeatType = repeatType; l_tmp.m_repeatCount = repeatCount; l_tmp.m_callBack = callBack; l_tmp.m_parameter = parameter; l_tmp.m_ignoreTimeScale = IsIgnoreTimeScale; l_tmp.Init(); GetInstance().animList.Add(l_tmp); return(l_tmp); }
public static AnimData ColorTo(GameObject animObject, Color from, Color to, float time = 0.5f, float delayTime = 0, InterpType interp = InterpType.Default, bool isChild = true, bool IsIgnoreTimeScale = false, RepeatType repeatType = RepeatType.Once, int repeatCount = -1, AnimCallBack callBack = null, object[] parameter = null) { AnimData l_tmp = HeapObjectPool.GetObject <AnimData>("AnimData"); l_tmp.m_animGameObejct = animObject; l_tmp.m_animType = AnimType.Color; l_tmp.m_fromColor = from; l_tmp.m_toColor = to; l_tmp.m_isChild = isChild; l_tmp.m_delayTime = delayTime; l_tmp.m_totalTime = time; l_tmp.m_interpolationType = interp; l_tmp.m_repeatType = repeatType; l_tmp.m_repeatCount = repeatCount; l_tmp.m_ignoreTimeScale = IsIgnoreTimeScale; l_tmp.m_callBack = callBack; l_tmp.m_parameter = parameter; l_tmp.Init(); GetInstance().animList.Add(l_tmp); return(l_tmp); }
public static int GetZeroBasedWeekDayOfLastDay(this RepeatType repeatType) { if (repeatType.HasFlag(RepeatType.Sun)) { return(6); } if (repeatType.HasFlag(RepeatType.Sat)) { return(5); } if (repeatType.HasFlag(RepeatType.Fri)) { return(4); } if (repeatType.HasFlag(RepeatType.Thu)) { return(3); } if (repeatType.HasFlag(RepeatType.Wed)) { return(2); } if (repeatType.HasFlag(RepeatType.Tue)) { return(1); } if (repeatType.HasFlag(RepeatType.Mon)) { return(0); } throw new ArgumentException("The given repeatType does not contain any day specification, no day number can be assinged to it."); }
public static AnimData Blink(GameObject animObject, float space, float time = 0.5f, float delayTime = 0, bool IsIgnoreTimeScale = false, RepeatType repeatType = RepeatType.Once, int repeatCount = -1, AnimCallBack callBack = null, object[] parameter = null) { AnimParamHash animParnHash = new AnimParamHash( AnimParamType.GameObj, animObject, AnimParamType.AnimType, AnimType.Blink, AnimParamType.Space, space, AnimParamType.Time, time, AnimParamType.DelayTime, delayTime, AnimParamType.RepeatType, repeatType, AnimParamType.IsIgnoreTimeScale, IsIgnoreTimeScale, AnimParamType.RepeatCount, repeatCount, AnimParamType.CallBack, callBack, AnimParamType.CallBackParams, parameter ); return(ValueTo(animParnHash)); }
public static AnimData UguiSizeDelta(GameObject animObject, Vector2?from, Vector2 to, float time = 0.5f, float delayTime = 0, InterpType interp = InterpType.Default, bool IsIgnoreTimeScale = false, RepeatType repeatType = RepeatType.Once, int repeatCount = -1, AnimCallBack callBack = null, object[] parameter = null) { Vector2 fromTmp = from ?? animObject.GetComponent <RectTransform>().sizeDelta; AnimParamHash animParnHash = new AnimParamHash( AnimParamType.GameObj, animObject, AnimParamType.AnimType, AnimType.UGUI_SizeDetal, AnimParamType.FromV2, fromTmp, AnimParamType.ToV2, to, AnimParamType.Time, time, AnimParamType.DelayTime, delayTime, AnimParamType.InteType, interp, AnimParamType.IsIgnoreTimeScale, IsIgnoreTimeScale, AnimParamType.RepeatCount, repeatCount, AnimParamType.RepeatType, repeatType, AnimParamType.CallBack, callBack, AnimParamType.CallBackParams, parameter ); return(ValueTo(animParnHash)); }
public static AnimData Rotation(GameObject animObject, Vector3?from, Vector3 to, float time = 0.5f, float delayTime = 0, bool isLocal = true, InterpType interp = InterpType.Default, bool IsIgnoreTimeScale = false, RepeatType repeatType = RepeatType.Once, int repeatCount = -1, AnimCallBack callBack = null, object[] parameter = null) { Quaternion?quaternion = null; if (from != null) { quaternion = Quaternion.Euler((Vector3)from); } return(Rotation(animObject, quaternion, Quaternion.Euler(to), time, delayTime, isLocal, interp, IsIgnoreTimeScale, repeatType, repeatCount, callBack, parameter)); }
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { RepeatType repeatType = RepeatType.NotRepeated; if (value is int) { switch ((int)value) { case 0: repeatType = RepeatType.NotRepeated; break; case 1: repeatType = RepeatType.Daily; break; case 2: repeatType = RepeatType.Weekly; break; case 3: repeatType = RepeatType.Monthly; break; case 4: repeatType = RepeatType.Yearly; break; default: break; } } return(repeatType); }
public static void Rotate(GameObject animObject, Vector3 from, Vector3 to, float time, InterpType interp = InterpType.Default, RepeatType repeatType = RepeatType.Once, bool isLocal = true, AnimCallBack callBack = null, params object[] parameter) { AnimType animType; if (isLocal) { animType = AnimType.LocalRotate; } else { animType = AnimType.Rotate; } AnimParamHash animParnHash = new AnimParamHash( AnimParamType.GameObj, animObject, AnimParamType.AnimType, animType, AnimParamType.FromV3, from, AnimParamType.ToV3, to, AnimParamType.Time, time, AnimParamType.InteType, interp, AnimParamType.IsLocal, isLocal, AnimParamType.RepeatType, repeatType, AnimParamType.CallBack, callBack, AnimParamType.CallBackParams, parameter ); ValueTo(animParnHash); }
public Transition PingPong() { _repeat = RepeatType.PingPong; Gui.Instance.AddUpdateHook(this); this.Reset(); return(this); }
/// <summary> /// Returns time between the first day and last day of a habit /// </summary> /// <param name="start">The start day of a habit.</param> /// <param name="repeatType">The type of repeating of the habit.</param> /// <param name="weeksToRepeat">Number of days (or weeks) for which the habit will run.</param> /// <returns>The time between first and last day of the habit.</returns> private TimeSpan HabitLength(DateTime start, RepeatType repeatType, int weeksToRepeat) { switch (repeatType) { case RepeatType.Years: return(start.AddYears(weeksToRepeat) - start); case RepeatType.Days: return(start.AddDays(weeksToRepeat) - start); } // The first week can begin later than on the first week day of the repeatType, so we have to treat it specially var firstWeekDays = 7 - start.ZeroMondayBasedDay(); var lastWeekDays = repeatType.GetZeroBasedWeekDayOfLastDay() + 1; if (weeksToRepeat == 1) { return(TimeSpan.FromDays(lastWeekDays - (7 - firstWeekDays))); } var middleWeeksDays = (weeksToRepeat - 2) * 7; return(TimeSpan.FromDays(firstWeekDays + middleWeeksDays + lastWeekDays)); }
private bool IsHabitActive(DateTime date, DateTime?nullableStartDate, RepeatType repeatType, int daysToRepeat) { if (nullableStartDate == null) { return(false); } var startDate = nullableStartDate.Value; if (!IsHabitCurrent(date, startDate, repeatType, daysToRepeat)) { return(false); } switch (repeatType) { case RepeatType.Days: return(true); case RepeatType.Years: return(startDate.Day == date.Day && startDate.Month == date.Month); } return(repeatType.HasFlag(RepeatType.Mon) && (int)date.DayOfWeek == 1 || repeatType.HasFlag(RepeatType.Tue) && (int)date.DayOfWeek == 2 || repeatType.HasFlag(RepeatType.Wed) && (int)date.DayOfWeek == 3 || repeatType.HasFlag(RepeatType.Thu) && (int)date.DayOfWeek == 4 || repeatType.HasFlag(RepeatType.Fri) && (int)date.DayOfWeek == 5 || repeatType.HasFlag(RepeatType.Sat) && (int)date.DayOfWeek == 6 || repeatType.HasFlag(RepeatType.Sun) && (int)date.DayOfWeek == 0); }
public static AnimData UguiSizeDelta(GameObject animObject, Vector2?from, Vector2 to, float time = 0.5f, float delayTime = 0, InterpType interp = InterpType.Default, bool IsIgnoreTimeScale = false, RepeatType repeatType = RepeatType.Once, int repeatCount = -1, AnimCallBack callBack = null, object[] parameter = null) { Vector2 fromTmp = from ?? animObject.GetComponent <RectTransform>().sizeDelta; AnimData l_tmp = new AnimData();; l_tmp.m_animGameObejct = animObject; l_tmp.m_animType = AnimType.UGUI_SizeDetal; l_tmp.m_fromV2 = fromTmp; l_tmp.m_toV2 = to; l_tmp.m_delayTime = delayTime; l_tmp.m_totalTime = time; l_tmp.m_interpolationType = interp; l_tmp.m_repeatType = repeatType; l_tmp.m_repeatCount = repeatCount; l_tmp.m_ignoreTimeScale = IsIgnoreTimeScale; l_tmp.m_callBack = callBack; l_tmp.m_parameter = parameter; l_tmp.Init(); GetInstance().animList.Add(l_tmp); return(l_tmp); }
public static AnimData Scale(GameObject animObject, Vector3?from, Vector3 to, float time = 0.5f, InterpType interp = InterpType.Default, bool IsIgnoreTimeScale = false, RepeatType repeatType = RepeatType.Once, int repeatCount = -1, float delayTime = 0, AnimCallBack callBack = null, object[] parameter = null) { Vector3 fromTmp = from ?? animObject.transform.localScale; AnimData l_tmp = new AnimData();; l_tmp.m_animGameObejct = animObject; l_tmp.m_animType = AnimType.LocalScale; l_tmp.m_fromV3 = fromTmp; l_tmp.m_toV3 = to; l_tmp.m_delayTime = delayTime; l_tmp.m_totalTime = time; l_tmp.m_interpolationType = interp; l_tmp.m_repeatType = repeatType; l_tmp.m_repeatCount = repeatCount; l_tmp.m_ignoreTimeScale = IsIgnoreTimeScale; l_tmp.m_callBack = callBack; l_tmp.m_parameter = parameter; l_tmp.Init(); GetInstance().animList.Add(l_tmp); return(l_tmp); }
static int Blink(IntPtr L) { try { ToLua.CheckArgsCount(L, 9); UnityEngine.GameObject arg0 = (UnityEngine.GameObject)ToLua.CheckUnityObject(L, 1, typeof(UnityEngine.GameObject)); float arg1 = (float)LuaDLL.luaL_checknumber(L, 2); float arg2 = (float)LuaDLL.luaL_checknumber(L, 3); float arg3 = (float)LuaDLL.luaL_checknumber(L, 4); bool arg4 = LuaDLL.luaL_checkboolean(L, 5); RepeatType arg5 = (RepeatType)ToLua.CheckObject(L, 6, typeof(RepeatType)); int arg6 = (int)LuaDLL.luaL_checknumber(L, 7); AnimCallBack arg7 = null; LuaTypes funcType8 = LuaDLL.lua_type(L, 8); if (funcType8 != LuaTypes.LUA_TFUNCTION) { arg7 = (AnimCallBack)ToLua.CheckObject(L, 8, typeof(AnimCallBack)); } else { LuaFunction func = ToLua.ToLuaFunction(L, 8); arg7 = DelegateFactory.CreateDelegate(typeof(AnimCallBack), func) as AnimCallBack; } object[] arg8 = ToLua.CheckObjectArray(L, 9); AnimData o = AnimSystem.Blink(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
public static AnimData Scale(GameObject animObject, Vector3?from, Vector3 to, float time = 0.5f, InterpType interp = InterpType.Default, bool IsIgnoreTimeScale = false, RepeatType repeatType = RepeatType.Once, int repeatCount = -1, float delayTime = 0, AnimCallBack callBack = null, object[] parameter = null) { Vector3 fromTmp = from ?? animObject.transform.localScale; AnimParamHash animParnHash = new AnimParamHash( AnimParamType.GameObj, animObject, AnimParamType.AnimType, AnimType.LocalScale, AnimParamType.FromV3, fromTmp, AnimParamType.ToV3, to, AnimParamType.Time, time, AnimParamType.DelayTime, delayTime, AnimParamType.InteType, interp, AnimParamType.RepeatType, repeatType, AnimParamType.IsIgnoreTimeScale, IsIgnoreTimeScale, AnimParamType.RepeatCount, repeatCount, AnimParamType.CallBack, callBack, AnimParamType.CallBackParams, parameter ); return(ValueTo(animParnHash)); }
public static int GetCountOfWeekDays(this RepeatType repeatType) { int count = 0; if (repeatType.HasFlag(RepeatType.Mon)) { count++; } if (repeatType.HasFlag(RepeatType.Tue)) { count++; } if (repeatType.HasFlag(RepeatType.Wed)) { count++; } if (repeatType.HasFlag(RepeatType.Thu)) { count++; } if (repeatType.HasFlag(RepeatType.Fri)) { count++; } if (repeatType.HasFlag(RepeatType.Sat)) { count++; } if (repeatType.HasFlag(RepeatType.Sun)) { count++; } return(count); }
public static int RepeatTypes(RepeatType type) { return((type.Equals(RepeatType.NoRepeats)) ? 0 : (type.Equals(RepeatType.AsDisplayFrequence)) ? 1 : 2); }
static int IntToEnum(IntPtr L) { int arg0 = (int)LuaDLL.lua_tonumber(L, 1); RepeatType o = (RepeatType)arg0; ToLua.Push(L, o); return(1); }
public ActionResult DeleteConfirmed(int id) { RepeatType repeatType = db.RepeatTypes.Find(id); db.RepeatTypes.Remove(repeatType); db.SaveChanges(); return(RedirectToAction("Index")); }
public static IEnumerable <DateTime> RecurrencesUntil(this DateTime date, RepeatType repeat, DateTime endDate) { DateTime repeatDate = date; do { yield return(repeatDate = repeatDate.Repeat(repeat, 1)); }while (repeatDate < endDate); }
public override void WriteXml(XmlWriter writer) { writer.WriteAttributeString("Entry", Entry.ToString()); writer.WriteAttributeString("Repeat", Repeat.ToString()); writer.WriteAttributeString("RepeatType", RepeatType.ToString()); writer.WriteAttributeString("CastOnItem", CastOnItem.ToString()); writer.WriteAttributeString("ItemId", ItemId.ToString()); writer.WriteAttributeString("ItemType", ItemType.ToString()); }
public RepeatElement(Element element, int min, int max, RepeatType repeatType) { this.element = element; this.min = min; var flag = max <= 0; this.max = flag ? 2147483647 : max; this.repeatType = repeatType; this.matchStart = -1; }
public SchedulerItem(string sName, string sParams, bool runOnce, DateTime startTime, int runEvery, RepeatType runEveryType) { SimpleInitilize(); FireFunction = sName; FireParams = sParams; RunOnce = runOnce; RunEvery = runEvery; RunEveryType = runEveryType; StartTime = startTime; CalculateNextRunTime(StartTime); CreateTime = DateTime.UtcNow; Enabled = true; }
public Repeater(RepeatType type, uint value) { Type = type; Value = value; }
public RepeatStmt(SimpleToken token, int endLineNumber, RepeatType type, Expr repeatExpr, ArrayList statementsList, bool whileNotUntil) : base(token, endLineNumber) { this.type = type; this.repeatExpr = repeatExpr; this.statementsList = statementsList; this.whileNotUntil = whileNotUntil; }
public static Repetition RepeatsIndefinitely(RepeatType repeatType) { return new Repetition(repeatType, DateTime.MaxValue); }
public Repetition(RepeatType repeats, DateTime ends) { this.Repeats = repeats; this.Ends = ends; }
private void Repeat_Click(object sender, RoutedEventArgs e) { switch (repeatType) { case RepeatType.NoRepeat: repeatType = RepeatType.RepeatSong; ((Image)repeatButton.Content).Source = new BitmapImage(new Uri(@"pack://*****:*****@"pack://application:,,,/Images/repeat_all.png")); break; case RepeatType.RepeatList: repeatType = RepeatType.NoRepeat; ((Image)repeatButton.Content).Source = new BitmapImage(new Uri(@"pack://application:,,,/Images/repeat.png")); break; } }
private void nextButton_Click(object sender, EventArgs e) { RepeatType temp = repeatType; repeatType = RepeatType.NoRepeat; Next(); repeatType = temp; }
public void RefreshPlayerStatus(PlayerStatusType status, RepeatType repeatType, bool isShuffleEnabled) { Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { if (status == PlayerStatusType.Playing) imagePlayPause.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/Images/Toolbar/pause.png")); else imagePlayPause.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/Images/Toolbar/play.png")); switch (repeatType) { case RepeatType.Off: imageRepeat.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/Images/Toolbar/repeat_off.png")); break; case RepeatType.Playlist: imageRepeat.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/Images/Toolbar/repeat_on.png")); break; case RepeatType.Song: imageRepeat.Source = new BitmapImage(new Uri("pack://application:,,,/Resources/Images/Toolbar/repeat_single.png")); break; default: throw new ArgumentOutOfRangeException(); } string imageName = isShuffleEnabled ? "shuffle_on" : "shuffle_off"; imageShuffle.Source = new BitmapImage(new Uri(string.Format("pack://application:,,,/Resources/Images/Toolbar/{0}.png", imageName))); EnableUIForPlayerStatus(status); })); }
public void RefreshPlayerStatus(PlayerStatusType status, RepeatType repeatType, bool isShuffleEnabled) { Console.WriteLine("MainWindow - RefreshPlayerStatus - status: {0}", status.ToString()); Gtk.Application.Invoke(delegate{ switch (status) { case PlayerStatusType.Initialized: case PlayerStatusType.Stopped: case PlayerStatusType.Paused: actionPlay.StockId = "gtk-media-play"; //actionPlay.IconName = "gtk-media-play"; break; case PlayerStatusType.Playing: actionPlay.StockId = "gtk-media-pause"; //actionPlay.IconName = "gtk-media-pause"; break; } }); }
public void SetRepeatMode(RepeatType repeatType) { CrossMediaManager.Current.MediaQueue.ToggleRepeat(repeatType); _repeatModeSubject.OnNext(repeatType); }
public void RefreshPlayerStatus(PlayerStatusType status, RepeatType repeatType, bool isShuffleEnabled) { Console.WriteLine("RefreshPlayerStatus - Status: {0} - RepeatType: {1} - IsShuffleEnabled: {2}", status, repeatType, isShuffleEnabled); InvokeOnMainThread(() => { switch (status) { case PlayerStatusType.Initialized: case PlayerStatusType.Stopped: case PlayerStatusType.Paused: case PlayerStatusType.StartPaused: case PlayerStatusType.WaitingToStart: btnToolbarPlayPause.ImageView.Image = ImageResources.Images.FirstOrDefault(x => x.Name == "toolbar_play"); break; case PlayerStatusType.Playing: btnToolbarPlayPause.ImageView.Image = ImageResources.Images.FirstOrDefault(x => x.Name == "toolbar_pause"); break; default: throw new ArgumentOutOfRangeException(); } switch (repeatType) { case RepeatType.Off: btnToolbarRepeat.ImageView.Image = ImageResources.Images.FirstOrDefault(x => x.Name == "toolbar_repeat_off"); break; case RepeatType.Playlist: btnToolbarRepeat.ImageView.Image = ImageResources.Images.FirstOrDefault(x => x.Name == "toolbar_repeat_on"); break; case RepeatType.Song: btnToolbarRepeat.ImageView.Image = ImageResources.Images.FirstOrDefault(x => x.Name == "toolbar_repeat_single"); break; default: throw new ArgumentOutOfRangeException(); } string imageName = isShuffleEnabled ? "toolbar_shuffle_on" : "toolbar_shuffle_off"; btnToolbarShuffle.ImageView.Image = ImageResources.Images.FirstOrDefault(x => x.Name == imageName); }); }
public void ToggleRepeat(RepeatType repeatType) { switch (repeatType) { case RepeatType.None: Repeat = RepeatType.RepeatOne; break; case RepeatType.RepeatOne: Repeat = RepeatType.RepeatAll; break; case RepeatType.RepeatAll: Repeat = RepeatType.None; break; } }
public void RefreshPlayerStatus(PlayerStatusType status, RepeatType repeatType, bool isShuffleEnabled) { _isPlaying = status == PlayerStatusType.Playing; RunOnUiThread(() => { switch (status) { case PlayerStatusType.Playing: _btnPlayPause.SetImageResource(Resource.Drawable.player_pause); break; default: _btnPlayPause.SetImageResource(Resource.Drawable.player_play); break; } }); }
public void RefreshRepeat(RepeatType repeatType) { }
/** * Creats a new element repeater. * * @param elem the element to repeat * @param min the minimum count * @param max the maximum count * @param type the repeat type constant */ public RepeatElement(Element elem, int min, int max, RepeatType type) { this.elem = elem; this.min = min; if (max <= 0) { this.max = Int32.MaxValue; } else { this.max = max; } this.type = type; this.matchStart = -1; this.matches = null; }
public void RefreshPlayerStatus(PlayerStatusType status, RepeatType repeatType, bool isShuffleEnabled) { InvokeOnMainThread(() => { switch (status) { case PlayerStatusType.Paused: btnPlayPause.GlyphImageView.Image = UIImage.FromBundle("Images/Player/play"); break; case PlayerStatusType.Playing: btnPlayPause.GlyphImageView.Image = UIImage.FromBundle("Images/Player/pause"); break; } }); }