Exemple #1
0
        /// <summary>
        /// відкриває форму з налаштуваннями параметрів для таймерів та радіусу
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void customizeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (Form2 customizeForm = new Form2())
            {
                //передаємо параметри на форму для відображення
                customizeForm.SleepTime = SleepTime;
                customizeForm.CheckTime = CheckTime;
                customizeForm.Radius    = Radius;
                //відкриваємо у режимі діалогового вікна
                if (customizeForm.ShowDialog() == DialogResult.OK)
                {
                    //зчитуємо нвоі параметри
                    SleepTime = customizeForm.SleepTime;
                    CheckTime = customizeForm.CheckTime;
                    Radius    = customizeForm.Radius;

                    //зберігаємо нові параметри до файле з параметрами
                    FileStream f = File.Open("Settings", FileMode.Truncate);
                    f.Close();
                    using (StreamWriter stream = new StreamWriter("Settings"))
                    {
                        stream.WriteLine(SleepTime.ToString());
                        stream.WriteLine(CheckTime.ToString());
                        stream.WriteLine(Radius.ToString());
                    }
                }
            }
        }
Exemple #2
0
 /// <summary>
 /// Return a text representation of this object.
 /// </summary>
 public override String ToString()
 {
     return(String.Format("Circle2D: Left={0}, Top={1}, Radius={2}",
                          X.ToString(),
                          Y.ToString(),
                          Radius.ToString()));
 }
        public override XmlNode ToXml(XmlDocument xDoc)
        {
            XmlElement statement = xDoc.CreateElement(_nodeName);

            if (SphereBox == SphereBox.Sphere)
            {
                __AddNewAttribute(xDoc, statement, "centerX", _coordinatesStart.X.ToString());
                __AddNewAttribute(xDoc, statement, "centerY", _coordinatesStart.Y.ToString());
                __AddNewAttribute(xDoc, statement, "centerZ", _coordinatesStart.Z.ToString());
                __AddNewAttribute(xDoc, statement, "radius", Radius.ToString());
                if (_name != null)
                {
                    __AddNewAttribute(xDoc, statement, "name", _name);
                }
            }
            else
            {
                __AddNewAttribute(xDoc, statement, "leastX", Math.Min(_coordinatesStart.X, _coordinatesEnd.X).ToString());
                __AddNewAttribute(xDoc, statement, "leastZ", Math.Min(_coordinatesStart.Z, _coordinatesEnd.Z).ToString());
                __AddNewAttribute(xDoc, statement, "mostX", Math.Max(_coordinatesStart.X, _coordinatesEnd.X).ToString());
                __AddNewAttribute(xDoc, statement, "mostZ", Math.Max(_coordinatesStart.Z, _coordinatesEnd.Z).ToString());
                if (_name != null)
                {
                    __AddNewAttribute(xDoc, statement, "name", _name);
                }
            }

            return(statement);
        }
Exemple #4
0
        protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            ele.TryPathTo("Time", true, out subEle);
            subEle.Value = Time.ToString();

            ele.TryPathTo("Radius", true, out subEle);
            subEle.Value = Radius.ToString();

            ele.TryPathTo("Color", true, out subEle);
            Color.WriteXML(subEle, master);

            ele.TryPathTo("Flags", true, out subEle);
            subEle.Value = Flags.ToString();

            ele.TryPathTo("FalloffExponent", true, out subEle);
            subEle.Value = FalloffExponent.ToString("G15");

            ele.TryPathTo("FOV", true, out subEle);
            subEle.Value = FOV.ToString("G15");

            ele.TryPathTo("Value", true, out subEle);
            subEle.Value = Value.ToString();

            ele.TryPathTo("Weight", true, out subEle);
            subEle.Value = Weight.ToString("G15");
        }
Exemple #5
0
        public override ArrayList GetItemInfo()
        {
            ArrayList itemInfo = new ArrayList
            {
//                "Name: " + Name,
//                "X: " + Position.x,
//                "Y: " + Position.y,
//                "Z: " + Position.z,
//                "Radius: " + Radius,
//                "showCorona: " + ShowCorona,
//                "showLensFlare: " + ShowLensFlare,
//                "lightUpEnvivornment: " + LightUpEnvivornment,
                new InputText(this, "Name:", Name, true, "name"),

                new InputText(this, "X:", Position.x.ToString(), true, "posX"),
                new InputText(this, "Y:", Position.y.ToString(), true, "posY"),
                new InputText(this, "Z:", Position.z.ToString(), true, "posZ"),

                new InputText(this, "Radius:", Radius.ToString(), true, "radius"),

                new InputText(this, "R:", ((Color >> 16) & 0x0ff).ToString(), true, "colR"),
                new InputText(this, "G:", ((Color >> 8) & 0x0ff).ToString(), true, "colG"),
                new InputText(this, "B:", ((Color) & 0x0ff).ToString(), true, "colB"),

                new InputBool(this, "showCorona", ShowCorona, true, "corona"),
                new InputBool(this, "showLensFlare", ShowLensFlare, true, "lensFlare"),
                new InputBool(this, "lightUpEnvivornment", LightUpEnvivornment, true, "lightUpEnvivornment"),
            };

            return(itemInfo);
        }
        public List <string> AsDXFString()
        {
            List <string> entityList = new List <string>();

            entityList.Add("CIRCLE");
            entityList.Add("5");
            entityList.Add(ID.ToString());
            entityList.Add("100");
            entityList.Add("AcDbEntity");
            entityList.Add("8");
            entityList.Add("1");
            entityList.Add("6");
            entityList.Add("SOLID");
            entityList.Add("62");
            entityList.Add((DXFColorConverter.ToDxfColor(Col)).ToString());
            entityList.Add("100");
            entityList.Add("AcDbCircle");
            entityList.Add("10");
            entityList.Add(Center.X.ToString("f5"));
            entityList.Add("20");
            entityList.Add(Center.Y.ToString("f5"));
            entityList.Add("30");
            entityList.Add(Center.Z.ToString("f5"));
            entityList.Add("40");
            entityList.Add(Radius.ToString("f5"));
            entityList.Add("210");
            entityList.Add("0.0");
            entityList.Add("220");
            entityList.Add("0.0");
            entityList.Add("230");
            entityList.Add("1.0");
            entityList.Add("0");

            return(entityList);
        }
Exemple #7
0
 /// <summary>
 /// Returns a <see cref="System.String" /> that represents this instance.
 /// </summary>
 /// <returns>
 /// A <see cref="System.String" /> that represents this instance.
 /// </returns>
 public override string ToString()
 {
     return(string.Format(CultureInfo.CurrentCulture,
                          "Center:{0} Radius:{1}",
                          Center.ToString(),
                          Radius.ToString()));
 }
Exemple #8
0
        protected string GetValidationError(string propertyName)
        {
            if (Array.IndexOf(ValidatedProperties, propertyName) < 0)
            {
                return(null);
            }

            string error = null;

            switch (propertyName)
            {
            case "Radius":
            {
                error = InputCheck.MaggioreDiZero(Radius.ToString());
            }
            break;

            case "SideCount":
            {
                if (SideCount < 3)
                {
                    error = "Minimum 3 side";
                }
            }
            break;

            default:
                Debug.Fail("Unexpected property : " + propertyName);
                break;
            }

            return(error);
        }
Exemple #9
0
        public override string GetRequestUrl()
        {
            string pointStr = string.Format("LocationRecog/{0}?", CenterPoint.ToString());

            string du;

            switch (DistanceUnits)
            {
            case DistanceUnitType.Miles:
                du = "mile";
                break;

            case DistanceUnitType.Kilometers:
            default:
                du = "kilometer";
                break;
            }

            List <string> param_list = new List <string>
            {
                string.Format("r={0}", Radius.ToString(System.Globalization.CultureInfo.InvariantCulture)),
                string.Format("top={0}", Top.ToString()),
                string.Format("distanceUnit={0}", du),
                string.Format("verboseplacenames={0}", VerbosePlaceNames.ToString().ToLower()),
                string.Format("key={0}", BingMapsKey.ToString()),
                string.Format("includeEntityTypes={0}", IncludeEntityTypes)
            };

            if (DateTimeInput.HasValue)
            {
                param_list.Add(string.Format("dateTime={0}", DateTimeHelper.GetUTCString(DateTimeInput.Value)));
            }

            return(this.Domain + pointStr + string.Join("&", param_list));
        }
Exemple #10
0
 /// <summary>
 /// конструктор основної форми
 /// ініціалізовує стандартні елементи і делегати та зчитує налаштування параметрів чи створює новий файл з параметрами по замовчуванню(для першого запуску)
 /// </summary>
 public Form1()
 {
     InitializeComponent();
     //додаємо делегат на зміну стану сесії для відслідковування стану обліковго запису - заблоковано/активно
     SystemEvents.SessionSwitch += new SessionSwitchEventHandler(SystemEvents_SessionSwitch);
     Radius = 10;
     Lock   = false;
     //перевіряємо чи існує файл з налашуваннями
     if (File.Exists("Settings"))
     {
         using (StreamReader stream = new StreamReader("Settings"))
         {
             //для існуючого файлу читаємо параметри
             SleepTime = Convert.ToInt32(stream.ReadLine());
             CheckTime = Convert.ToInt32(stream.ReadLine());
             Radius    = Convert.ToInt32(stream.ReadLine());
         }
     }
     else
     {
         //якщо файлу нема створюємо новий і вносимо значення по замовчуванню
         FileStream f = File.Open("Settings", FileMode.Create);
         f.Close();
         using (StreamWriter stream = new StreamWriter("Settings"))
         {
             stream.WriteLine(SleepTime.ToString());
             stream.WriteLine(CheckTime.ToString());
             stream.WriteLine(Radius.ToString());
         }
     }
 }
Exemple #11
0
 /// <summary>Converts the cylinder to a readable string representation</summary>
 /// <returns>The cylinder as a string</returns>
 public override string ToString()
 {
     return
         ("{ " +
          Transform.ToString() + " R:" + Radius.ToString() + " H:" + Height.ToString() +
          " }");
 }
 /// <summary>
 /// Returns a <see cref="System.String" /> that represents this instance.
 /// </summary>
 /// <param name="formatProvider">The format provider.</param>
 /// <returns>A <see cref="System.String" /> that represents this instance.</returns>
 public string ToString(IFormatProvider formatProvider)
 {
     return(string.Format(formatProvider,
                          "Center:{0} Radius:{1}",
                          Center.ToString(),
                          Radius.ToString()));
 }
        public void SaveInXML(XmlElement parentNode, CandleChartControl owner)
        {
            var node = parentNode.AppendChild(parentNode.OwnerDocument.CreateElement("Asterisk"));

            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Name")).Value = Name;

            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Text")).Value  = Text;
            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Sign")).Value  = Sign;
            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("magic")).Value = Magic.ToString();

            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("ColorLine")).Value = ColorLine.ToArgb().ToString();
            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("ColorFill")).Value = ColorFill.ToArgb().ToString();
            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("ColorText")).Value = ColorText.ToArgb().ToString();

            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Price")).Value = Price.ToString(CultureProvider.Common);
            if (DateStart.HasValue)
            {
                node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("PivotTime")).Value =
                    DateStart.Value.ToString("ddMMyyyy HHmmss", CultureProvider.Common);
            }
            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Shape")).Value        = Shape.ToString();
            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Transparency")).Value =
                Transparency.ToString();
            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("TransparencyText")).Value =
                TransparencyText.ToString();
            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("Radius")).Value =
                Radius.ToString();
            node.Attributes.Append(parentNode.OwnerDocument.CreateAttribute("magic")).Value = Magic.ToString();
        }
Exemple #14
0
        public override void GenerateXmlAttributes(XmlWriter writer)
        {
            base.GenerateXmlAttributes(writer);

            if (Radius.HasValue)
            {
                writer.WriteAttributeString(Prefix + "Radius", Radius.ToString());
            }
            if (FillColor.HasValue)
            {
                writer.WriteAttributeString(Prefix + "FillColor", FillColor.Value.ToHexString());
            }
            if (FillAlpha.HasValue)
            {
                writer.WriteAttributeString(Prefix + "FillAlpha", FillAlpha.ToString());
            }
            if (FillAngle.HasValue)
            {
                writer.WriteAttributeString(Prefix + "FillAngle", FillAngle.ToString());
            }

            if (FillType.HasValue)
            {
                writer.WriteAttributeString(Prefix + "FillType", FillType.GetHashCode().ToString());
            }

            if (FillMix.IsNotWhiteSpace())
            {
                writer.WriteAttributeString(Prefix + "FillMix", FillMix);
            }
            if (FillRatio.IsNotWhiteSpace())
            {
                writer.WriteAttributeString(Prefix + "FillRatio", FillRatio);
            }
        }
Exemple #15
0
        public KeyValue ToKV(string key)
        {
            KeyValue kv = new KeyValue(key);

            if (Preset != PresetType.NONE)
            {
                kv += Preset.ToString();
                return(kv);
            }
            kv += new KeyValue("Center") + Center.ToString();
            if (this.Shape == ShapeE.CIRCLE)
            {
                kv += new KeyValue("Radius") + Radius.ToString();
            }
            if (this.Shape == ShapeE.LINE)
            {
                KeyValue linechild = new KeyValue("Line");
                linechild += new KeyValue("Length") + Length.ToString();
                linechild += new KeyValue("Thickness") + Thickness.ToString();
                kv        += linechild;
            }

            kv += new KeyValue("Teams") + Teams.ToString().Replace(",", " |");
            kv += new KeyValue("Types") + UnitTypes.ToString().Replace(",", " |");
            kv += new KeyValue("Flags") + Flags.ToString().Replace(",", " |");

            if (MaxTargets.Value != "-1")
            {
                kv += new KeyValue("MaxTargets") + MaxTargets.ToString();
                kv += new KeyValue("Random") + Random.ToString();
            }


            return(kv);
        }
Exemple #16
0
        public override void GenerateXmlAttributes(System.Xml.XmlWriter writer)
        {
            base.GenerateXmlAttributes(writer);

            if (Radius.HasValue)
            {
                writer.WriteAttributeString(AttrName + "Radius", Radius.ToString());
            }
            if (BgColor.HasValue)
            {
                writer.WriteAttributeString(AttrName + "BgColor", BgColor.GetHashCode().ToString());
            }
            if (BgAlpha.HasValue)
            {
                writer.WriteAttributeString(AttrName + "BgAlpha", BgAlpha.ToString());
            }
            if (Sides.HasValue)
            {
                writer.WriteAttributeString(AttrName + "Sides", Sides.ToString());
            }

            if (_borderAttr != null)
            {
                _borderAttr.GenerateXmlAttributes(writer);
            }
        }
 /// <summary>
 /// Gets the custom query string variables.
 /// </summary>
 /// <returns></returns>
 protected override string GetCustomQueryStringVariables()
 {
     return(string.Format("latitude={0}&longitude={1}&radius={2}&sortByDistance={3}",
                          Uri.EscapeDataString(Latitude.ToString()),
                          Uri.EscapeDataString(Longitude.ToString()),
                          Uri.EscapeDataString(Radius.ToString()),
                          Uri.EscapeDataString(SortByDistance ? "true" : "false")));
 }
Exemple #18
0
        public override void WriteGroupCodes()
        {
            WriteGroupCodeValue(10, X0.ToString().Trim());
            WriteGroupCodeValue(20, Y0.ToString().Trim());
            WriteGroupCodeValue(30, Z0.ToString().Trim());

            WriteGroupCodeValue(40, Radius.ToString().Trim());
        }
Exemple #19
0
 /// <summary>
 /// Return a text representation of this object.
 /// </summary>
 public override String ToString()
 {
     return(String.Format("Sphere: Left={0}, Top={1}, Front={2}, Radius={3}",
                          Left.ToString(),
                          Top.ToString(),
                          Front.ToString(),
                          Radius.ToString()));
 }
Exemple #20
0
 public override string ToString()
 {
     return(string.Format("{0}, {1}, {2} | {3}",
                          Coord.X.ToString(InvariantCulture),
                          Coord.Y.ToString(InvariantCulture),
                          Coord.Z.ToString(InvariantCulture),
                          Radius.ToString(InvariantCulture)));
 }
Exemple #21
0
        /// <summary>
        /// 속성들을 Xml Attribute로 생성합니다.
        /// </summary>
        /// <param name="writer">Attribute를 쓸 Writer</param>
        public override void GenerateXmlAttributes(System.Xml.XmlWriter writer)
        {
            base.GenerateXmlAttributes(writer);

            writer.WriteAttributeString("type", Type.ToString());

            if (X.HasValue)
            {
                writer.WriteAttributeString("x", X.ToString());
            }
            if (Y.HasValue)
            {
                writer.WriteAttributeString("y", Y.ToString());
            }
            if (Color.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("Color", Color);
            }
            if (Alpha.HasValue)
            {
                writer.WriteAttributeString("Alpha", Alpha.ToString());
            }
            if (Thickness.HasValue)
            {
                writer.WriteAttributeString("Thickness", Thickness.ToString());
            }

            if (XScale.HasValue)
            {
                writer.WriteAttributeString("XScale", XScale.ToString());
            }
            if (YScale.HasValue)
            {
                writer.WriteAttributeString("YScale", YScale.ToString());
            }
            if (Radius.HasValue)
            {
                writer.WriteAttributeString("Radius", Radius.ToString());
            }
            if (YRadius.HasValue)
            {
                writer.WriteAttributeString("YRadius", YRadius.ToString());
            }
            if (InnerRadius.HasValue)
            {
                writer.WriteAttributeString("InnerRadius", InnerRadius.ToString());
            }

            if (ToX.HasValue)
            {
                writer.WriteAttributeString("ToX", ToX.ToString());
            }
            if (ToY.HasValue)
            {
                writer.WriteAttributeString("ToY", ToY.ToString());
            }
        }
Exemple #22
0
        public void TestRadiusClone()
        {
            const string radiusStr = "10:20.5:$v:40";
            var          radius    = new Radius(10, 20.5f, "$v", 40);
            var          cloned    = radius.Clone();

            Assert.AreEqual(radiusStr, radius.ToString());
            Assert.AreEqual(radiusStr, cloned.ToString());
        }
        public override string ToString()
        {
            var bw = Width == default(BorderWidthProperty)? string.Empty: Width.ToString();
            var st = string.IsNullOrEmpty(Style)?string.Empty: string.Format("border-style:{0};", Style);
            var cl = string.IsNullOrEmpty(Color)?string.Empty: string.Format("border-color:{0};", Color);
            var br = Radius == default(BorderRadiusProperty)? string.Empty: Radius.ToString();

            return(string.Format("{0}{1}{2}{3}",
                                 bw, st, cl, br).Trim());
        }
Exemple #24
0
 public override string[] getObjectInfo()
 {
     string[] str = new string[6];
     str[0] = Name;
     str[1] = Mass.ToString();
     str[2] = Radius.ToString();
     str[3] = Temperature.ToString();
     str[4] = RotationPeriod.ToString();
     str[5] = DistanceToTheStar.ToString();
     return(str);
 }
Exemple #25
0
        internal override RestRequest GetRequest()
        {
            var request = new RestRequest(Routes.RadiusRoute, Method.GET);

            request.AddQueryParameter(LatitudeParameter, Coordinates.Latitude.ToString(CultureInfo.InvariantCulture));
            request.AddQueryParameter(LongitudeParameter, Coordinates.Longitude.ToString(CultureInfo.InvariantCulture));
            request.AddQueryParameter(RadiusParameter, Radius.ToString(CultureInfo.InvariantCulture));
            request.AddQueryParameter(SortParameter, Sort.QueryString());
            request.AddQueryParameter(TypeParameter, FuelType.QueryString());
            request.AddApiKey(ApiKey);
            return(request);
        }
 public override void PrintGeometryTag(XmlTextWriter URDFWriter)
 {
     /* <geometry>
      *     <sphere radius="#"/>
      * </geometry>
      */
     URDFWriter.WriteStartElement("geometry");
     URDFWriter.WriteStartElement("cylinder");
     URDFWriter.WriteAttributeString("radius", Radius.ToString());
     URDFWriter.WriteEndElement();
     URDFWriter.WriteEndElement();
 }
Exemple #27
0
 public override string[] getObjectInfo()
 {
     string[] str = new string[7];
     str[0] = Name;
     str[1] = Mass.ToString();
     str[2] = Radius.ToString();
     str[3] = Temperature.ToString();
     str[4] = RotationPeriod.ToString();
     str[5] = Satellites.ToString();
     str[6] = AttractivePower.ToString();
     return(str);
 }
        /// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <param name="format">The format.</param>
        /// <returns>A <see cref="System.String" /> that represents this instance.</returns>
        public string ToString(string format)
        {
            if (format == null)
            {
                return(ToString());
            }

            return(string.Format(CultureInfo.CurrentCulture,
                                 "Center:{0} Radius:{1}",
                                 Center.ToString(format, CultureInfo.CurrentCulture),
                                 Radius.ToString(format, CultureInfo.CurrentCulture)));
        }
        public override XmlNode ToXml(XmlDocument xDoc)
        {
            XmlElement statement = xDoc.CreateElement("destroy_near");

            __AddNewAttribute(xDoc, statement, "centerX", _coordinates.X.ToString());
            __AddNewAttribute(xDoc, statement, "centerY", _coordinates.Y.ToString());
            __AddNewAttribute(xDoc, statement, "centerZ", _coordinates.Z.ToString());
            __AddNewAttribute(xDoc, statement, "radius", Radius.ToString());
            __AddNewAttribute(xDoc, statement, "type", TypeToString);

            return(statement);
        }
        /// <summary>
        /// Returns a <see cref="System.String" /> that represents this instance.
        /// </summary>
        /// <param name="format">The format.</param>
        /// <param name="formatProvider">The format provider.</param>
        /// <returns>A <see cref="System.String" /> that represents this instance.</returns>
        public string ToString(string format, IFormatProvider formatProvider)
        {
            if (format == null)
            {
                return(ToString(formatProvider));
            }

            return(string.Format(formatProvider,
                                 "Center:{0} Radius:{1}",
                                 Center.ToString(format, formatProvider),
                                 Radius.ToString(format, formatProvider)));
        }