/// <summary> /// Задает значения по умолчанию (значения по варианту). /// </summary> private void DefaultValues_Click(object sender, EventArgs e) { RangeFrom = 0; RangeFromTextBox.Text = RangeFrom.ToString(); RangeFromChecked = true; RangeTo = 0.05; RangeToTextBox.Text = RangeTo.ToString(); RangeToChecked = true; StepNumber = 100; StepNumberTextBox.Text = StepNumber.ToString(); StepNumberChecked = true; InitialCondition = 0; InitialConditionTextBox.Text = InitialCondition.ToString(); InitialConditionChecked = true; Resistance = 1000; ResistanceTextBox.Text = Resistance.ToString(); ResistanceChecked = true; Capacity = Math.Pow(10, -5); CapacityTextBox.Text = Capacity.ToString(); CapacityChecked = true; Voltage = 10; VoltageTextBox.Text = Voltage.ToString(); VoltageChecked = true; }
public void WriteXml(XmlWriter writer) { writer.WriteAttributeString(inputRateAttributeName, InputRate.ToString(CultureInfo.InvariantCulture)); writer.WriteAttributeString(outputRateAttributeName, OutputRate.ToString(CultureInfo.InvariantCulture)); writer.WriteAttributeString(capacityAttributeName, Capacity.ToString(CultureInfo.InvariantCulture)); writer.WriteAttributeString(accumulatedPowerAttributeName, AccumulatedPower.ToString(CultureInfo.InvariantCulture)); }
public override string ToString() { return("Serial Number " + SerialNumber + "\n" + "Fuel " + FuelType + "\n" + "Make/Model " + MakeModel.ToString() + "\n" + "Capacity " + Capacity.ToString() + "\n" + "Range (mi) " + Range.ToString() + "\n\n"); }
public override string ToString() { return("Serial Number " + SerialNumber + "\n" + "Fuel " + FuelType + "\n" + "Make/Model " + MakeModel.ToString() + "\n" + "Seating " + Capacity.ToString() + "\n" + "Doors " + Doors.ToString() + "\n\n"); }
public void StoreValues(Data data, string path) { data.SetValue(@"" + path + @"Capacity", Capacity.ToString(System.Globalization.CultureInfo.InvariantCulture)); data.SetValue(@"" + path + @"Column", Column.ToString()); data.SetValue(@"" + path + @"Enabled", Enabled.ToString()); data.SetValue(@"" + path + @"LastDateFrom", LastDateFrom.ToString("yyyy-MM-dd HH:mm:ss")); data.SetValue(@"" + path + @"LastDateTo", LastDateTo.ToString("yyyy-MM-dd HH:mm:ss")); data.SetValue(@"" + path + @"LastSearchText", Data.EscapeString(LastSearchText)); }
public override string ToString() { return("Serial Number " + SerialNumber + "\n" + "Fuel " + FuelType + "\n" + "Make/Model " + MakeModel.ToString() + "\n" + "Capacity " + Capacity.ToString() + "\n" + "Length (ft) " + FootLength.ToString() + "\n" + "Engine " + Engine + "\n\n"); }
public override string ToString() { StringBuilder sb = new StringBuilder(); sb.AppendLine("Capacity=" + Capacity.ToString()); sb.AppendLine("Enabled=" + Enabled.ToString()); return(sb.ToString()); }
protected override void FillXmlElement(XmlElement element, XmlDocument document) { XmlElement position = document.CreateElement("Position"); FillXmlPositionElement(position, document); element.AppendChild(position); element.SetAttribute("Name", Name); element.SetAttribute("NumOfToken", NumberOfTokens.ToString()); element.SetAttribute("Capacity", Capacity.ToString()); }
public override Dictionary <string, string> GetAdditionalProperties() { Dictionary <string, string> additionalProperties = new Dictionary <string, string>(); additionalProperties.Add("Capacity", Capacity.ToString()); additionalProperties.Add("RPM", RPM.ToString()); additionalProperties.Add("Form factor", FormFactor.ToString()); return(additionalProperties); }
public override string ToString() { return("Engine:\nPower: " + Power.ToString() + " ,Capacity: " + Capacity.ToString() + " ,Type: " + Type + " ,Serial Number: " + SerialNumber.ToString()); }
// Draw the link. public void Draw(bool showCosts, bool showCapacities, Graphics gr, Pen pen, Brush brush, Font font, StringFormat sf) { float dx = Nodes[1].Location.X - Nodes[0].Location.X; float dy = Nodes[1].Location.Y - Nodes[0].Location.Y; float dist = (float)Math.Sqrt(dx * dx + dy * dy); float nx = dx / dist; float ny = dy / dist; PointF head = new PointF( Nodes[1].Location.X - NetworkNode.Radius * nx, Nodes[1].Location.Y - NetworkNode.Radius * ny); // Draw the link. gr.DrawLine(pen, Nodes[0].Location, Nodes[1].Location); DrawArrowhead(gr, pen, head, nx, ny, NetworkNode.Radius / 2f); // Draw the link's cost. if (showCosts) { dx *= 3 * NetworkNode.Radius / dist; dy *= 3 * NetworkNode.Radius / dist; gr.DrawString(Cost.ToString("0"), font, brush, Nodes[0].Location.X + dx, Nodes[0].Location.Y + dy, sf); } // Draw the link's capacity. if (showCapacities) { dx *= 3 * NetworkNode.Radius / dist; dy *= 3 * NetworkNode.Radius / dist; string txt = ""; if (HasFlow) { txt += Flow.ToString() + "/"; } txt += Capacity.ToString(); // Measure the string. SizeF size = gr.MeasureString(txt, font); float x = Nodes[0].Location.X + dx; float y = Nodes[0].Location.Y + dy; gr.FillRectangle(Brushes.White, x - size.Width / 2, y - size.Height / 2, size.Width, size.Height); gr.DrawString(txt, font, brush, x, y, sf); } }
public override string ToString() { string s = ""; s += ID; s += ItemType; s += Quality; s += Description; s += Capacity.ToString(); s += BuyPrice.ToString(); s += SellPrice.ToString(); s += HP.ToString(); s += MP.ToString(); return(s); }
protected void ValidateRoomModel(out string message) { if (Capacity < 1 || !Regex.IsMatch(Capacity.ToString(), @"^\d{0,4}$")) { message = "Capacidade inválida"; } else if (RoomNumber < 1 || !Regex.IsMatch(RoomNumber.ToString(), @"^\d{0,4}$")) { message = "Número da sala inválido"; } else { message = String.Empty; } }
/// <summary> /// Generate the necessary parameters /// </summary> public List <KeyValuePair <string, string> > GetParams() { var p = new List <KeyValuePair <string, string> >(); if (Capacity != null) { p.Add(new KeyValuePair <string, string>("Capacity", Capacity.ToString())); } if (Available != null) { p.Add(new KeyValuePair <string, string>("Available", Available.Value.ToString().ToLower())); } return(p); }
/// <summary> /// Сохраняет исходные данные и результаты (если они имеются) в файл. /// </summary> private void SaveAsMenuItem_Click(object sender, EventArgs e) { SaveAsFileDialog.Filter = "Текстовый файл|*.txt"; if (SaveAsFileDialog.ShowDialog() == DialogResult.Cancel) { return; } string filename = SaveAsFileDialog.FileName; try { using (StreamWriter sw = new StreamWriter(filename, false, Encoding.Default)) { sw.WriteLine("Интервал от {0} до {1}", RangeFrom, RangeTo); sw.WriteLine("Количество разбиений: {0}", StepNumber); sw.WriteLine("Начальное условие: {0}", InitialCondition); sw.WriteLine(); sw.WriteLine("Сопротивление резистора: {0}", Resistance); sw.WriteLine("Ёмкость: {0}", Capacity.ToString()); sw.WriteLine("Напряжение: {0}", Voltage); sw.WriteLine(); if (Data.t != null && Data.q != null) { string tText, qText; for (int i = 0; i < Data.t.Length; i++) { tText = string.Format("t[{0}] = {1:f8}", i, Data.t[i]); qText = string.Format("q[{0}] = {1}", i, Data.q[i]); sw.WriteLine(string.Format("{0,-30} {1,-30}", tText, qText)); } } } } catch { MessageBox.Show("Ошибка при сохранении данных", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
// Draw the link. public void Draw(bool showCosts, bool showCapacities, Graphics gr, Pen pen, Brush brush, Font font, StringFormat sf) { float dx = Nodes[1].Location.X - Nodes[0].Location.X; float dy = Nodes[1].Location.Y - Nodes[0].Location.Y; float dist = (float)Math.Sqrt(dx * dx + dy * dy); float nx = dx / dist; float ny = dy / dist; PointF head = new PointF( Nodes[1].Location.X - NetworkNode.Radius * nx, Nodes[1].Location.Y - NetworkNode.Radius * ny); // Draw the link. gr.DrawLine(pen, Nodes[0].Location, Nodes[1].Location); DrawArrowhead(gr, pen, head, nx, ny, NetworkNode.Radius / 2f); // Draw the link's cost. if (showCosts) { dx *= 3 * NetworkNode.Radius / dist; dy *= 3 * NetworkNode.Radius / dist; gr.DrawString(Cost.ToString("0"), font, brush, Nodes[0].Location.X + dx, Nodes[0].Location.Y + dy, sf); } // Draw the link's capacity. if (showCapacities) { dx *= 3 * NetworkNode.Radius / dist; dy *= 3 * NetworkNode.Radius / dist; gr.DrawString(Capacity.ToString("0"), font, brush, Nodes[0].Location.X + dx, Nodes[0].Location.Y + dy, sf); } }
public bool TryGetVehicleDetails(RealTimeArrival arrival, out VehicleDetail detail) { detail = new VehicleDetail(); if (arrival.Vehicle != null) { string[] parts = arrival.Vehicle.Split('_'); if (parts.Length == 2) { int prefix; int postfix; if (int.TryParse(parts[0], out prefix) && int.TryParse(parts[1], out postfix) && ((NumberPrefix == prefix && NumberMin <= postfix && NumberMax >= postfix && !(ExcludedNumbers?.Contains(postfix) ?? false)) || (IncludedNumbers?.Contains(postfix) ?? false))) { detail.AgencyFunded = FundedBy; detail.AgencyOperated = OperatedBy; detail.VehicleName = Name; detail.SeatedCapacity = Capacity.ToString(); detail.ImageUri = new Uri(Image); detail.VehicleNumber = postfix.ToString(); return(true); } } } return(false); }
public void StoreValues(Data data, string path) { data.SetValue(@"" + path + @"Capacity", Capacity.ToString(System.Globalization.CultureInfo.InvariantCulture)); data.SetValue(@"" + path + @"Enabled", Enabled.ToString()); }
public string GetDescription() { return("Sport Engine Capacity: " + Capacity.ToString() + " Type: " + Type.ToString()); }
public override string ToString() { int a = int.Parse(Capacity.ToString()) / 1024 / 1024; return(a.ToString() + "MB" + Caption.ToString()); }
/// <summary> /// Converts the value of the current <see cref="CircularBuffer{T}" /> to its equivalent string representation. /// </summary> /// <returns> /// A string representation of the current <see cref="CircularBuffer{T}" />. /// </returns> public override String ToString() => $"Capacity: {Capacity.ToString()}, Length: {Length.ToString()}";
public override void PrepareRows() { DataBindingModel.ClearRows(); DataBindingModel.Add(new CIDBRow(new CIDBCell("Type"), new CIDBCell(SymbianUtils.Enum.EnumUtils.ToString(this.Type)))); if (Type == TType.ETypeDrive) { DataBindingModel.Add(new CIDBRow(new CIDBCell("Drive Letter"), new CIDBCell(DriveLetter))); if (VolumeName.Length > 0) { DataBindingModel.Add(new CIDBRow(new CIDBCell("Volume"), new CIDBCell(VolumeName))); } if (Vendor.Length > 0) { DataBindingModel.Add(new CIDBRow(new CIDBCell("Vendor"), new CIDBCell(Vendor))); } if (UID != 0) { DataBindingModel.Add(new CIDBRow(new CIDBCell("UID"), new CIDBCell(UID.ToString()))); } } DataBindingModel.Add(new CIDBRow(new CIDBCell("Free"), new CIDBCell(Free.ToString()))); if (Capacity != 0) { DataBindingModel.Add(new CIDBRow(new CIDBCell("Capacity"), new CIDBCell(Capacity.ToString()))); } }
/// <summary> /// Converts this instance to its equivalent string representation. /// </summary> /// <returns> /// The string representation of the value of this instance. /// </returns> public override string ToString() { return(Count.ToString() + " / " + Capacity.ToString()); }
void OnGUI() { GUILayout.Label("Size" + Capacity); Capacity = GUILayout.TextField(Capacity.ToString()).Call(int.Parse); }
public override string ToString() { return(Type.ToString() + " " + Capacity.ToString() + "mAh"); }
public override string ToString() { return((this as Part).ToString() + "S" + Capacity.ToString()); }
public override string GetInspectString() { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(base.GetInspectString()); if (stringBuilder.Length != 0) { stringBuilder.AppendLine(); } stringBuilder.AppendLine(string.Format("twComposter_Inspect_Resources".Translate(), RawCompostCount.ToString(), Capacity.ToString())); if (!Empty) { stringBuilder.AppendLine(string.Format("twComposter_Inspect_Processed".Translate(), progress.ToStringPercent("0"))); if (this.compPowerTrader != null && this.compPowerTrader.PowerOn) { stringBuilder.AppendLine("twComposter_Inspect_Powered".Translate()); } else { stringBuilder.AppendLine(string.Format("twComposter_Inspect_Temperature".Translate(), TemperatureFactor.ToStringPercent("0"), Temperature.ToString("#.0"))); } stringBuilder.AppendLine(string.Format("twComposter_Inspect_Produced".Translate(), (RawCompostCount / rawCompostPerCompost).ToString())); } return(stringBuilder.ToString().TrimEndNewlines()); }
public string Serialize() { return(Type.ToString() + MainDirection.ToString("d") + SocketUp.ToString("d") + SocketRight.ToString("d") + SocketDown.ToString("d") + SocketLeft.ToString("d") + Capacity.ToString() + (IsMain ? "1" : "0")); }
public override string ToString() { return(String.Format("Name: {0} Capacity: {1}", this.Name, Capacity.ToString())); }
/// <summary> /// ToString() method for drop-down apartment selection. /// </summary> public string ToDropDownString() => $"Number: {Number.ToString()}, Capacity: {Capacity.ToString()}, Double beds: {DoubleBeds.ToString()}, Price: {Price.ToString()} EUR";