/// <summary> /// Handles the back button being clicked on a <see cref="Prediction"/> form /// </summary> /// <param name="sender">The sender object</param> /// <param name="e">Event arguments</param> public static void BackButtonClicked(object sender, EventArgs e) { PredictionView.Owner.Show(); PredictionView.Close(); }
public static void ReadOptions(XmlDocument xmlDoc, XmlNamespaceManager nsmgr, XmlElement pluginNode) { String attr, attr2; attr = pluginNode.GetAttribute(xmlTags.settingsVersion); if (attr.Length > 0) { settingsVersion = (Int16)XmlConvert.ToInt16(attr); } if (0 == settingsVersion) { // No settings in Preferences.System found, try read old files load(); } attr = pluginNode.GetAttribute(xmlTags.predictionView); if (attr.Length > 0) { try { predictionView = (PredictionView)Enum.Parse(typeof(PredictionView), attr); } catch { } } //else //{ // attr = pluginNode.GetAttribute(xmlTags.showPrediction); // if (attr.Length > 0) // { // bool isPrediction = XmlConvert.ToBoolean(attr); // if (isPrediction) // { // predictionView = PredictionView.TimePrediction; // } // else // { // predictionView = PredictionView.Training; // } // } //} attr = pluginNode.GetAttribute(xmlTags.elinderBreakEvenTime); if (attr.Length > 0) { elinderBreakEvenTime = TimeSpan.FromSeconds(Settings.parseFloat(attr)); } attr = pluginNode.GetAttribute(xmlTags.riegelFatigueFactor); if (attr.Length > 0) { riegelFatigueFactor = Settings.parseFloat(attr); } attr = pluginNode.GetAttribute(xmlTags.idealBmi); if (attr.Length > 0) { idealBmi = Settings.parseFloat(attr); } attr = pluginNode.GetAttribute(xmlTags.idealShoe); if (attr.Length > 0) { idealShoe = Settings.parseFloat(attr); } attr = pluginNode.GetAttribute(xmlTags.showPace); if (attr.Length > 0) { showPace = XmlConvert.ToBoolean(attr); } attr = pluginNode.GetAttribute(xmlTags.showChart); if (attr.Length > 0) { showChart = XmlConvert.ToBoolean(attr); } attr = pluginNode.GetAttribute(xmlTags.minPercentOfDistance); if (attr.Length > 0) { minPercentOfDistance = XmlConvert.ToInt16(attr); } attr = pluginNode.GetAttribute(xmlTags.hsPercentOfDistance); if (attr.Length > 0) { hsPercentOfDistance = XmlConvert.ToInt16(attr); } attr = pluginNode.GetAttribute(xmlTags.model); if (attr.Length > 0) { model = (PredictionModel)Enum.Parse(typeof(PredictionModel), attr); } attr = pluginNode.GetAttribute(xmlTags.showToolBar); if (attr.Length > 0) { showToolBar = XmlConvert.ToBoolean(attr); } attr = pluginNode.GetAttribute(xmlTags.distances); if (attr.Length > 0) { distances = parseDistances(attr.Split(';')); } attr = pluginNode.GetAttribute(xmlTags.viewWidth); attr2 = pluginNode.GetAttribute(xmlTags.viewHeight); if (attr.Length > 0 && attr2.Length > 0) { windowSize = new Size(XmlConvert.ToInt16(attr), XmlConvert.ToInt16(attr2)); } }
private void button2_Click(object sender, EventArgs e) { PredictionView predictionView = new PredictionView(); predictionView.Show(); }
public static void defaults() { predictionView = PredictionView.TimePrediction; idealBmi = 18.5f; idealShoe = 0.100f; showPace = true; showChart = false;//show chart by default minPercentOfDistance = 10; hsPercentOfDistance = 40; model = PredictionModelUtil.Default; elinderBreakEvenTime = TimeSpan.FromHours(2); riegelFatigueFactor = 1.06f; showToolBar = true; distances.Clear(); //Some distances removed by default //addDistance(100, Length.Units.Meter, false); //addDistance(200, Length.Units.Meter, false); //addDistance(400, Length.Units.Meter, false); //addDistance(500, Length.Units.Meter, false); //addDistance(800, Length.Units.Meter, false); addDistance(1, Length.Units.Kilometer, false); //addDistance(1.5, Length.Units.Kilometer, false); addDistance(1, Length.Units.Mile, false); addDistance(2, Length.Units.Kilometer, false); //addDistance(3, Length.Units.Kilometer, false); addDistance(2, Length.Units.Mile, false); //addDistance(4, Length.Units.Kilometer, false); //addDistance(3, Length.Units.Mile, false); addDistance(5, Length.Units.Kilometer, false); //addDistance(4, Length.Units.Mile, false); //addDistance(8, Length.Units.Kilometer, false); addDistance(5, Length.Units.Mile, false); addDistance(10, Length.Units.Kilometer, false); //addDistance(15, Length.Units.Kilometer, false); addDistance(10, Length.Units.Mile, false); addDistance(20, Length.Units.Kilometer, false); addDistance(21097.5, Length.Units.Meter, true); //addDistance(15, Length.Units.Mile, false); addDistance(25, Length.Units.Kilometer, false); addDistance(30, Length.Units.Kilometer, false); addDistance(20, Length.Units.Mile, false); //addDistance(25, Length.Units.Mile, false); addDistance(42195, Length.Units.Meter, true); windowSize = new Size(800, 600); }