コード例 #1
0
        /// <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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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());
                }
            }
        }
コード例 #4
0
 public override void DumpBody(XmlWriter writer)
 {
     if (SwfDumpService.DumpDisplayListTags)
     {
         writer.WriteElementString("depth", Depth.ToString());
     }
 }
コード例 #5
0
ファイル: UndergroundRegion.cs プロジェクト: tier6tank/DFWV
        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;
            }
        }
コード例 #6
0
        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);
        }
コード例 #7
0
        public T Get(int id, Depth depth = Depth.minimal)
        {
            var data = new T {
                id = id, depth = depth.ToString()
            };

            return(_baseClient.Get <T>(data));
        }
コード例 #8
0
 protected override string[] GetFullData()
 {
     return(new[]
     {
         "Data:", _text, "Location:", $"({X}, {Y})", "Min steps from root node:",
         Depth.ToString(), "Outgoing connections:", Connections.Count.ToString()
     });
 }
コード例 #9
0
ファイル: VisualTreeItem.cs プロジェクト: chrkon/snoopwpf
        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());
        }
コード例 #10
0
        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));
        }
コード例 #11
0
        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));
        }
コード例 #12
0
ファイル: UndergroundRegion.cs プロジェクト: tier6tank/DFWV
        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);
        }
コード例 #13
0
 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()
     }));
 }
コード例 #14
0
 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());
 }
コード例 #15
0
        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));
        }
コード例 #16
0
 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),
         "}"
     }));
 }
コード例 #17
0
 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);
         }
     }
 }
コード例 #18
0
ファイル: VisualTreeItem.cs プロジェクト: mcjt/snoopx
        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());
        }
コード例 #19
0
        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);
        }
コード例 #20
0
        /// <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");
        }
コード例 #21
0
    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);
    }
コード例 #22
0
ファイル: Class1.cs プロジェクト: anthrax3/intellichess
        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());
        }
コード例 #23
0
        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);
        }
コード例 #24
0
ファイル: World.cs プロジェクト: rhinboost/ProjectPorcupine
    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);
    }
コード例 #25
0
 public override string ToString()
 {
     return($"{Time.ToString("HH:mm:ss")}: {ID} {Depth.ToString("0.00")} | {Count()}");
 }
コード例 #26
0
 /// <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)})";
コード例 #27
0
 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))));
 }
コード例 #28
0
    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);
    }
コード例 #29
0
        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);
        }
コード例 #30
0
 public override string ToString()
 {
     return("[" + Value.ToString() + " : " + Depth.ToString() + "]");
 }