/// <summary> /// Creates a <see cref="ParameterDefinition"/> list that represents this filter. /// </summary> public IEnumerable <ParameterDefinition> ToParameterDefinition() { var result = new List <ParameterDefinition>(); if (Depth.HasValue) { result.Add(ParameterDefinition.Create(DepthParamName, Depth.ToString())); } if (WithHistory) { result.Add(ParameterDefinition.Create(WithHistoryParamName, WithHistory.ToString())); } if (PartUuids != null && PartUuids.Length > 0) { result.Add(ParameterDefinition.Create(PartUuidsParamName, RestClientHelper.ConvertGuidListToString(PartUuids))); } if (RequestedPartAttributes != null && RequestedPartAttributes.AllAttributes != AllAttributeSelection.True && RequestedPartAttributes.Attributes != null) { result.Add(ParameterDefinition.Create(RequestedPartAttributesParamName, RestClientHelper.ConvertUInt16ListToString(RequestedPartAttributes.Attributes))); } if (RequestedCharacteristicAttributes != null && RequestedCharacteristicAttributes.AllAttributes != AllAttributeSelection.True && RequestedCharacteristicAttributes.Attributes != null) { result.Add(ParameterDefinition.Create(RequestedCharacteristicsAttributesParamName, RestClientHelper.ConvertUInt16ListToString(RequestedCharacteristicAttributes.Attributes))); } return(result); }
public override XmlElement GetInXML(XmlDocument doc) { XmlElement shapeElm = doc.CreateElement("shape"); XmlElement elem = doc.CreateElement("cuboid"); XmlElement pointElem = point.GetInXML(doc); XmlElement matElem = material.GetInXML(doc); XmlElement widthElm = doc.CreateElement("width"); XmlElement heightElm = doc.CreateElement("height"); XmlElement depthElm = doc.CreateElement("depth"); XmlText widthText = doc.CreateTextNode(Width.ToString()); XmlText heightText = doc.CreateTextNode(Height.ToString()); XmlText depthText = doc.CreateTextNode(Depth.ToString()); widthElm.AppendChild(widthText); heightElm.AppendChild(heightText); depthElm.AppendChild(depthText); elem.AppendChild(widthElm); elem.AppendChild(heightElm); elem.AppendChild(depthElm); elem.AppendChild(matElem); elem.AppendChild(pointElem); shapeElm.AppendChild(elem); return(shapeElm); }
public override void DumpBody(XmlWriter writer) { if ((Flags & SwfPlaceFlags.HasCharacter) != 0) { writer.WriteAttributeString("cid", _cid.ToString()); } writer.WriteAttributeString("depth", Depth.ToString()); writer.WriteAttributeString("flags", Flags.ToString()); if (SwfDumpService.DumpDisplayListTags) { if ((Flags & SwfPlaceFlags.HasMatrix) != 0) { writer.WriteElementString("matrix", _matrix.GetMatrixString()); } if ((Flags & SwfPlaceFlags.HasColorTransform) != 0) { ColorTransform.Dump(writer, true); } if ((Flags & SwfPlaceFlags.HasRatio) != 0) { writer.WriteElementString("ratio", Ratio.ToString()); } //if ((_flags & SwfPlaceFlags.HasName) != 0) // writer.WriteElementString("name", XmlHelper.EntifyString(_name)); if ((Flags & SwfPlaceFlags.HasClipDepth) != 0) { writer.WriteElementString("clip-depth", _clipDepth.ToString()); } } }
public override void DumpBody(XmlWriter writer) { if (SwfDumpService.DumpDisplayListTags) { writer.WriteElementString("depth", Depth.ToString()); } }
public override void Select(MainForm frm) { if (frm.grpUndergroundRegion.Text == ToString() && frm.MainTab.SelectedTab == frm.tabUndergroundRegion) { return; } Program.MakeSelected(frm.tabUndergroundRegion, frm.lstUndergroundRegion, this); frm.grpUndergroundRegion.Text = ToString(); frm.grpUndergroundRegion.Show(); frm.lblUndergroundRegionDepth.Text = Depth.ToString(); frm.lblUndergroundRegionType.Text = Type; if (Populations != null) { frm.grpUndergroundRegionPopulation.FillListboxWith(frm.lstUndergroundRegionPopulation, Populations.Keys); frm.grpUndergroundRegionPopulation.Text = $"Population ({(Populations.Values.Contains(10000001) ? "Unnumbered" : Populations.Values.Sum().ToString())})"; frm.grpUndergroundRegionPopulation.Visible = true; } else { frm.grpUndergroundRegionPopulation.Visible = false; } }
protected override void OnRender(DrawingContext context) { base.OnRender(context); context.DrawLine(baselinePen, angleLeftLeft, angleLeftRight); //context.DrawText(warningFormattedText, new Point(ActualWidth/2, ActualHeight/2)); context.DrawLine(baselinePen, angleRightLeft, angleRightRight); context.DrawLine(baselinePen, directionLineLeftBoundTop, directionLineLeftBoundBottom); context.DrawLine(baselinePen, directionLineRightBoundTop, directionLineRightBoundBottom); context.DrawLine(baselinePen, directionTop, directionBottom); RenderGauge(context, Humidity.ToString("0.00"), 2, humidityFormattedText); RenderGauge(context, Temperature.ToString("0.00"), 6, temperatureFormattedText); RenderGauge(context, Fps.ToString("0.0"), 18, fpsFormattedText); RenderGauge(context, Voltage.ToString("0.00"), 4, voltageFormattedText); RenderGauge(context, Current.ToString("0.00"), 16, currentFormattedText); RenderGauge(context, Thrust.ToString("0"), 10, thrustFormattedText); RenderGauge(context, Salinity.ToString("0.00"), 8, salinityFormattedText); RenderGauge(context, Depth.ToString("0.00"), 12, depthFormattedText); RenderGauge(context, ExtTemp.ToString("0.00"), 14, extTempFormattedText); RenderDepthGauge(context); RenderBatteryBar(context); if (ScreenshotAck == true) { RenderCTDValues(context, "Captured!", 2, screenshotFormattedText); } RenderCompass(context); RenderFalseHorizon(context); //RenderMap(context); //RenderLocation(context); }
public T Get(int id, Depth depth = Depth.minimal) { var data = new T { id = id, depth = depth.ToString() }; return(_baseClient.Get <T>(data)); }
protected override string[] GetFullData() { return(new[] { "Data:", _text, "Location:", $"({X}, {Y})", "Min steps from root node:", Depth.ToString(), "Outgoing connections:", Connections.Count.ToString() }); }
public override string ToString() { var sb = new StringBuilder(50); // [depth] name (type) numberOfChildren sb.AppendFormat("[{0}] {1} ({2})", Depth.ToString("D3"), name, Target.GetType().Name); return(sb.ToString()); }
public T Get <T>(int id, Depth depth = Depth.complete) where T : RestObject, new() { var item = new T { id = id, depth = depth.ToString() }; var request = Request.Get(Request.Type.Get, item); return(Execute <T>(request)); }
public CustomObjectData Get(int parentId, int id, Depth depth = Depth.minimal) { var data = new CustomObjectData { id = id, depth = depth.ToString() }; var request = Request.Get(Request.Type.Get, parentId, data); return(_baseClient.Execute <CustomObjectData>(request)); }
public override void Select(MainForm frm) { frm.grpUndergroundRegion.Text = this.ToString(); frm.grpUndergroundRegion.Show(); frm.lblUndergroundRegionDepth.Text = Depth.ToString(); frm.lblUndergroundRegionType.Text = Type; Program.MakeSelected(frm.tabUndergroundRegion, frm.lstUndergroundRegion, this); }
public SearchResponse <T> Get(string search, int pageNumber, int pageSize, Depth depth = Depth.complete) { return(_baseClient.Search <T>(new T { searchTerm = search, page = pageNumber, pageSize = pageSize, depth = depth.ToString() })); }
public override void Init(Vector2 pos) { sprite = new Sprite("Sprites/Placeholders/spr_test32", contentManager); sprite.Scale = new Vector2(1f, 1f); Depth = 5; Console.WriteLine("Depth: " + Depth.ToString()); //sprite.SetAnimationParameters(13, new Vector2(24, 39), 5, true); base.Init(pos); Console.WriteLine("Sprite: " + sprite.ToString()); Console.WriteLine("Position: " + Position.ToString()); }
public SearchResponse <CustomObjectData> Get(int parentId, string search, int pageNumber, int pageSize, Depth depth = Depth.complete) { var request = Request.Get(Request.Type.Search, parentId, new CustomObjectData { searchTerm = search, page = pageNumber, pageSize = pageSize, depth = depth.ToString() }); return(_baseClient.Execute <SearchResponse <CustomObjectData> >(request)); }
public override string ToString() { return(string.Concat(new[] { "{X=", X.ToString(CultureInfo.CurrentCulture), ",Y=", Y.ToString(CultureInfo.CurrentCulture), ",Z=", Z.ToString(CultureInfo.CurrentCulture), ",Width=", Width.ToString(CultureInfo.CurrentCulture), ",Height=", Height.ToString(CultureInfo.CurrentCulture), ",Depth=", Depth.ToString(CultureInfo.CurrentCulture), "}" })); }
public override void DumpBody(XmlWriter writer) { if (SwfDumpService.DumpDisplayListTags) { writer.WriteElementString("cid", CharId.ToString()); writer.WriteElementString("depth", Depth.ToString()); writer.WriteElementString("matrix", Matrix.GetMatrixString()); if (ColorTransform != null) { ColorTransform.Dump(writer, false); } } }
public override string ToString() { var sb = new StringBuilder(50); // [depth] name (type) numberOfChildren sb.AppendFormat("[{0}] {1} ({2})", Depth.ToString("D3"), _name, Target.GetType().Name); if (_visualChildrenCount != 0) { sb.Append(' '); sb.Append(_visualChildrenCount.ToString()); } return(sb.ToString()); }
public override string Write() { var temp = "\nShading:Overhang,\n"; temp += Name + ", !Name\n"; temp += FenestrationSurface.Name + ", !fenestrationSurfaceName\n"; temp += Height.ToString(CultureInfo.InvariantCulture) + ", !- height above Window or Door\n"; temp += TiltAngle.ToString(CultureInfo.InvariantCulture) + ", !- Tilt Angle\n"; temp += Extension.ToString(CultureInfo.InvariantCulture) + ", !- Left Extension from Window/Door Width\n"; temp += Extension.ToString(CultureInfo.InvariantCulture) + ", !- Right Extension from Window/Door Width\n"; temp += Depth.ToString(CultureInfo.InvariantCulture) + ", !- Depth\n"; return(temp); }
/// <summary>Returns the soil layer index for a specified soil depth (mm)</summary> /// <param name="depth">Soil depth (mm)</param> /// <param name="dlayer">Array of soil layer depths in the profile (mm)</param> /// <returns>soil layer index</returns> /// <exception cref="System.Exception"></exception> private int LayerIndex(double depth, double[] dlayer) { double CumDepth = 0.0; for (int i = 0; i < dlayer.Length; i++) { CumDepth = CumDepth + dlayer[i]; if (CumDepth >= depth) { return(i); } } throw new Exception(Name + ": Specified soil depth of " + Depth.ToString() + " mm is greater than profile depth of " + CumDepth.ToString() + " mm"); }
public JObject ToJson() { JObject worldJson = new JObject(); worldJson.Add("Width", Width.ToString()); worldJson.Add("Height", Height.ToString()); worldJson.Add("Depth", Depth.ToString()); worldJson.Add("Rooms", RoomManager.ToJson()); worldJson.Add("Tiles", TilesToJson()); worldJson.Add("Inventories", InventoryManager.ToJson()); worldJson.Add("Furnitures", FurnitureManager.ToJson()); worldJson.Add("Utilities", UtilityManager.ToJson()); worldJson.Add("RoomBehaviors", RoomManager.BehaviorsToJson()); worldJson.Add("Characters", CharacterManager.ToJson()); worldJson.Add("CameraData", CameraData.ToJson()); worldJson.Add("Skybox", skybox.name); worldJson.Add("Wallet", Wallet.ToJson()); worldJson.Add("Scheduler", Scheduler.Scheduler.Current.ToJson()); return(worldJson); }
public void HandleEvalConfig_HasHandledEvalConfigCorrect_Equal() { string fileName = "EvalConfigTest.txt"; using (File.Create(fileName)) { } string path = Path.GetFullPath(fileName); string[] textLines = { "false", "20", "1337", "10", "15" }; File.WriteAllLines(fileName, textLines); int Depth; Bayes.HandleEvalConfig(out Depth, path); File.Delete(path); Assert.Equal(Convert.ToBoolean(textLines[0]), Bayes.TuneEvalValues); Assert.Equal(textLines[1], Bayes.TuningBounderies.ToString()); Assert.Equal(textLines[2], Bayes.Seed.ToString()); Assert.Equal(textLines[3], Bayes.RepetetionPerEvalConfiguration.ToString()); Assert.Equal(textLines[4], Depth.ToString()); }
protected override void WriteDataXML(XElement ele, ElderScrollsPlugin master) { XElement subEle; ele.TryPathTo("Width/Min", true, out subEle); subEle.Value = MinWidth.ToString("G15"); ele.TryPathTo("Width/Max", true, out subEle); subEle.Value = MaxWidth.ToString("G15"); ele.TryPathTo("Height/Min", true, out subEle); subEle.Value = MinHeight.ToString("G15"); ele.TryPathTo("Height/Max", true, out subEle); subEle.Value = MaxHeight.ToString("G15"); ele.TryPathTo("Depth", true, out subEle); subEle.Value = Depth.ToString("G15"); ele.TryPathTo("Shininess", true, out subEle); subEle.Value = Shininess.ToString("G15"); ele.TryPathTo("Parallax/Scale", true, out subEle); subEle.Value = ParallaxScale.ToString("G15"); ele.TryPathTo("Parallax/Passes", true, out subEle); subEle.Value = ParallaxPasses.ToString(); ele.TryPathTo("Flags", true, out subEle); subEle.Value = DecalFlags.ToString(); WriteUnusedXML(ele, master); ele.TryPathTo("Color", true, out subEle); Color.WriteXML(subEle, master); }
public void WriteXml(XmlWriter writer) { // Save info here writer.WriteAttributeString("Width", Width.ToString()); writer.WriteAttributeString("Height", Height.ToString()); writer.WriteAttributeString("Depth", Depth.ToString()); writer.WriteStartElement("Rooms"); foreach (Room r in rooms) { if (GetOutsideRoom() == r) { // Skip the outside room. Alternatively, should SetupWorld be changed to not create one? continue; } writer.WriteStartElement("Room"); r.WriteXml(writer); writer.WriteEndElement(); } writer.WriteEndElement(); writer.WriteStartElement("Tiles"); for (int x = 0; x < Width; x++) { for (int y = 0; y < Height; y++) { for (int z = 0; z < Depth; z++) { if (tiles[x, y, z].Type != TileType.Empty) { writer.WriteStartElement("Tile"); tiles[x, y, z].WriteXml(writer); writer.WriteEndElement(); } } } } writer.WriteEndElement(); writer.WriteStartElement("Inventories"); foreach (string objectType in inventoryManager.inventories.Keys) { foreach (Inventory inv in inventoryManager.inventories[objectType]) { // If we don't have a tile, that means this is in a character's inventory (or some other non-tile location // which means we shouldn't save that Inventory here, the character will take care of saving and loading // the inventory properly. if (inv.tile != null) { writer.WriteStartElement("Inventory"); inv.WriteXml(writer); writer.WriteEndElement(); } } } writer.WriteEndElement(); writer.WriteStartElement("Furnitures"); foreach (Furniture furn in furnitures) { writer.WriteStartElement("Furniture"); furn.WriteXml(writer); writer.WriteEndElement(); } writer.WriteEndElement(); writer.WriteStartElement("Characters"); foreach (Character c in characters) { writer.WriteStartElement("Character"); c.WriteXml(writer); writer.WriteEndElement(); } writer.WriteEndElement(); writer.WriteElementString("Skybox", skybox.name); writer.WriteStartElement("Wallet"); foreach (Currency currency in Wallet.Currencies.Values) { writer.WriteStartElement("Currency"); currency.WriteXml(writer); writer.WriteEndElement(); } writer.WriteEndElement(); Scheduler.Scheduler.Current.WriteXml(writer); }
public override string ToString() { return($"{Time.ToString("HH:mm:ss")}: {ID} {Depth.ToString("0.00")} | {Count()}"); }
/// <summary> /// <para>Returns a nicely formatted string for this Rect.</para> /// </summary> /// <param name="format"></param> public string ToString(string format) => $"(x:{x.ToString(format)}, y:{y.ToString(format)}, z:{z.ToString(format)}, width:{Width.ToString(format)}, height:{Height.ToString(format)}, depth:{Depth.ToString(format)})";
public XElement ToXml() { return(new XElement(WebDavNamespaces.DavNsActiveLock, new XElement(WebDavNamespaces.DavNsLockType, new XElement(WebDavNamespaces.DavNs + XmlHelper.GetXmlValue(Type))), new XElement(WebDavNamespaces.DavNsLockScope, new XElement(WebDavNamespaces.DavNs + XmlHelper.GetXmlValue(Scope))), new XElement(WebDavNamespaces.DavNsDepth, Depth == int.MaxValue ? "infinity" : Depth.ToString(CultureInfo.InvariantCulture)), new XElement(WebDavNamespaces.DavNsOwner, Owner), new XElement(WebDavNamespaces.DavNsTimeout, Timeout == -1 ? "Infinite" : "Second-" + Timeout.ToString(CultureInfo.InvariantCulture)), new XElement(WebDavNamespaces.DavNsLockToken, new XElement(WebDavNamespaces.DavNsHref, LockToken.AbsoluteUri)), new XElement(WebDavNamespaces.DavNsLockRoot, new XElement(WebDavNamespaces.DavNsHref, LockRoot.AbsoluteUri)))); }
public void WriteXml(XmlWriter writer) { // Save info here writer.WriteAttributeString("Width", Width.ToString()); writer.WriteAttributeString("Height", Height.ToString()); writer.WriteAttributeString("Depth", Depth.ToString()); writer.WriteStartElement("Rooms"); foreach (Room r in RoomManager) { if (RoomManager.OutsideRoom == r) { // Skip the outside room. Alternatively, should SetupWorld be changed to not create one? continue; } writer.WriteStartElement("Room"); r.WriteXml(writer); writer.WriteEndElement(); } writer.WriteEndElement(); writer.WriteStartElement("Tiles"); for (int x = 0; x < Width; x++) { for (int y = 0; y < Height; y++) { for (int z = 0; z < Depth; z++) { if (tiles[x, y, z].Type != TileType.Empty) { writer.WriteStartElement("Tile"); tiles[x, y, z].WriteXml(writer); writer.WriteEndElement(); } } } } writer.WriteEndElement(); writer.WriteStartElement("Inventories"); foreach (Inventory inventory in InventoryManager.Inventories.SelectMany(pair => pair.Value)) { // If we don't have a tile, that means this is in a character's inventory (or some other non-tile location // which means we shouldn't save that Inventory here, the character will take care of saving and loading // the inventory properly. if (inventory.Tile != null) { writer.WriteStartElement("Inventory"); inventory.WriteXml(writer); writer.WriteEndElement(); } } writer.WriteEndElement(); writer.WriteStartElement("Furnitures"); FurnitureManager.WriteXml(writer); writer.WriteEndElement(); writer.WriteStartElement("Utilities"); UtilityManager.WriteXml(writer); writer.WriteEndElement(); writer.WriteStartElement("Characters"); CharacterManager.WriteXml(writer); writer.WriteEndElement(); writer.WriteStartElement("CameraData"); CameraData.WriteXml(writer); writer.WriteEndElement(); writer.WriteElementString("Skybox", skybox.name); writer.WriteStartElement("Wallet"); Wallet.WriteXml(writer); writer.WriteEndElement(); Scheduler.Scheduler.Current.WriteXml(writer); }
public virtual string GetStats() { TimeSpan ctime = TimeSpan.FromSeconds(CreationTime); string stats = "<b>Id: " + Id + "</b>" + "\nSource created by " + CreationModule.ModuleName + " [" + ctime.ToString("hh':'mm':'ss") + "]"; stats += "\nWidth: " + Width.ToString() + " Height: " + Height.ToString() + " Depth: " + Depth.ToString() + "\nThis source is on module " + _currentModuleParent; return(stats); }
public override string ToString() { return("[" + Value.ToString() + " : " + Depth.ToString() + "]"); }