private void RandomColorPair() { Random rand = new Random(); int randInt = rand.Next(0, 1); switch (randInt) { case 0: ClrA = ColorExt.ToBrush(System.Drawing.Color.AliceBlue); ClrB = ColorExt.ToBrush(System.Drawing.Color.Cornsilk); break; case 1: ClrA = ColorExt.ToBrush(System.Drawing.Color.Cornsilk); ClrB = ColorExt.ToBrush(System.Drawing.Color.AliceBlue); break; case 2: ClrA = ColorExt.ToBrush(System.Drawing.Color.Bisque); ClrB = ColorExt.ToBrush(System.Drawing.Color.BlanchedAlmond); break; case 3: ClrA = ColorExt.ToBrush(System.Drawing.Color.Lavender); ClrB = ColorExt.ToBrush(System.Drawing.Color.LavenderBlush); break; default: ClrA = ColorExt.ToBrush(System.Drawing.Color.AliceBlue); ClrB = ColorExt.ToBrush(System.Drawing.Color.Cornsilk); break; } }
public void SetMsg(string _msg, string purpose, string _bot = "") { _purpose = purpose; MsgTextBlockMainMsg.Text = _msg; MsgLabelTop.Text = purpose; ChkTagOption.IsChecked = Properties.Settings.Default.TagOtherViews; if (purpose.Contains("Tag")) { TagOption.Visibility = System.Windows.Visibility.Visible; } else { TagOption.Visibility = System.Windows.Visibility.Collapsed; } if (_closable) { MsgLabelBot.Text = "Ok Already"; MsgLabelBot.FontSize = 18; if (_anErr) { ClrA = ColorExt.ToBrush(System.Drawing.Color.LavenderBlush); Body.BorderBrush = ColorExt.ToBrush(System.Drawing.Color.Red); } } else { if (_bot != "") { MsgLabelBot.Text = _bot; } } FlipColor(); }
private void SanityCheck() { Double opArea = XOpDist * YOpDist; String strMaxArea = XOpMaxA.Text; UnitType clipUnit = UnitType.UT_Area; Units thisDocUnits = _doc.GetUnits(); double userMaxOpArea; UnitFormatUtils.TryParse(thisDocUnits, clipUnit, strMaxArea, out userMaxOpArea); if (userMaxOpArea >= opArea) { Body.Background = ColorExt.ToBrush(System.Drawing.Color.AliceBlue); } else { Body.Background = ColorExt.ToBrush(System.Drawing.Color.LightPink); msg.Text = "OpArea exceeds Max OpArea"; return; } if (XOpDist < 6.0 || YOpDist < 6.0) { Body.Background = ColorExt.ToBrush(System.Drawing.Color.LightPink); msg.Text = "Spacing smaller than 6'."; return; } double maxDist; if (Double.TryParse(MaxSpace.Text, out maxDist)) { if (XOpDist > maxDist || YOpDist > maxDist) { Body.Background = ColorExt.ToBrush(System.Drawing.Color.LightPink); msg.Text = "Spacing exceeds " + maxDist.ToString() + "'."; return; } } msg.Text = ""; }