private static void DoHighlightForecolor(object higlightThreadParam) { HiglightThreadParam td = (HiglightThreadParam)higlightThreadParam; Color ctrlColor = (Color)td.control.GetProperty("ForeColor"); try { SetObjectProperty(td.control, "ForeColor", ctrlColor.BrightColor(td.HiglightPercent)); } catch (Exception) { } int iteration = AnimationControler.GetIterations(td.time); int t = td.time / iteration; for (int i = 0; i < iteration; i++) { if (td.animatorState.Canceled) break; Thread.Sleep(t); } try { SetObjectProperty(td.control, "ForeColor", ctrlColor); } catch (Exception) { } td.controlState.AnimatorEnd(td.animatorState); }
internal static AnimationControler.AnimePacket AnimeHighlightForecolorPacket(string queueName, int highlightPercent, int time, bool queue, int queueLevel, object qOwner, AnimationControler.FinalCallback finalCallback) { HiglightThreadParam highlightParam = new HiglightThreadParam(); highlightParam.HiglightPercent = highlightPercent; highlightParam.time = time; highlightParam.QueueLevel = queueLevel; highlightParam.finalCallback = finalCallback; highlightParam.queueName = queueName; return new AnimationControler.AnimePacket() { isQueue = queue && queueLevel >= 0, queueOwner = qOwner, method = DoHighlightForecolor, threadParam = highlightParam }; }