public void ClearSelectedShapesTest()
        {
            SelectInfo target = new SelectInfo(); // TODO: Initialize to an appropriate value

            target.ClearSelectedShapes();
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
Exemple #2
0
        public void AddItem(SelectInfo info, string image_key)
        {
            ListViewItem item = this.lvMain.Items.Add(info.Name, image_key);

            item.Tag  = info;
            info.Item = item;
        }
        public static int GetLength(this SelectInfo selInfo,
                                    PdfDocument document)
        {
            int len = 0;

            if (selInfo.StartPage >= 0 && selInfo.StartIndex >= 0)
            {
                for (int i = selInfo.StartPage; i <= selInfo.EndPage; i++)
                {
                    int pageLen = document.Pages[i].Text.CountChars;

                    if (i == selInfo.EndPage)
                    {
                        pageLen -= pageLen - (selInfo.EndIndex + 1);
                    }

                    if (i == selInfo.StartPage)
                    {
                        pageLen -= selInfo.StartIndex;
                    }

                    len += pageLen;
                }
            }

            return(len);
        }
Exemple #4
0
    public void Refresh()
    {
        for (int i = 0; i < Globals.MaxCharacterCount; i++)
        {
            if (i >= characters.Count)
            {
                CreateButtons[i].gameObject.SetActive(true);
                CharacterButtons[i].gameObject.SetActive(false);
            }
            else
            {
                SelectInfo info = characters[i];
                CreateButtons[i].gameObject.SetActive(false);
                CharacterButtons[i].gameObject.SetActive(true);
                CharacterButtons[i].NeutralImage = Resources.Load <Sprite>($"CharSel/{(byte)info.Class}_{(byte)info.Gender}_1");
                CharacterButtons[i].HoverImage   = Resources.Load <Sprite>($"CharSel/{(byte)info.Class}_{(byte)info.Gender}_2");
                CharacterButtons[i].DownImage    = Resources.Load <Sprite>($"CharSel/{(byte)info.Class}_{(byte)info.Gender}_1");
                CharacterButtons[i].SelectImage  = Resources.Load <Sprite>($"CharSel/{(byte)info.Class}_{(byte)info.Gender}_3");
                CharacterButtons[i].gameObject.transform.Find("Username").GetComponent <TextMeshProUGUI>().text = info.Name;
                CharacterButtons[i].gameObject.transform.Find("Level").GetComponent <TextMeshProUGUI>().text    = $"Level {info.Level}";
                CharacterButtons[i].gameObject.transform.Find("Class").GetComponent <TextMeshProUGUI>().text    = info.Class.ToString();

                if (SelectedCharacter == null)
                {
                    SelectedCharacter = info;
                    CharacterButtons[i].Select(true);
                }
                CharacterButtons[i].gameObject.GetComponent <Image>().sprite = CharacterButtons[i].GetNeutralButton();
            }
        }

        DeleteButton.gameObject.SetActive(characters.Any(x => x != null));
    }
Exemple #5
0
            public void Update(SelectInfo info)
            {
                if (info == null)
                {
                    Index           = 44;
                    Library         = Libraries.Prguse;
                    NameLabel.Text  = string.Empty;
                    LevelLabel.Text = string.Empty;
                    ClassLabel.Text = string.Empty;

                    NameLabel.Visible  = false;
                    LevelLabel.Visible = false;
                    ClassLabel.Visible = false;

                    return;
                }

                Library = Libraries.Title;

                Index = 660 + (byte)info.Class;

                if (Selected)
                {
                    Index += 5;
                }


                NameLabel.Text  = info.Name;
                LevelLabel.Text = info.Level.ToString();
                ClassLabel.Text = info.Class.ToString();

                NameLabel.Visible  = true;
                LevelLabel.Visible = true;
                ClassLabel.Visible = true;
            }
Exemple #6
0
    bool needRepaint = true; // Update scene

    protected virtual void OnEnable()
    {
        pointsPos  = (Points)target;   // assign component Points
        selectInfo = new SelectInfo(); // new class Select Info

        Undo.undoRedoPerformed += OnUndoRedo;
    }
Exemple #7
0
        /// <summary>
        /// Select
        /// </summary>
        /// <param name="sysAreaQuery"></param>
        /// <param name="DataCount"></param>
        /// <param name="ErrorMsg"></param>
        /// <returns></returns>
        public List <SysAreaVm> Select(SysAreaQuery sysAreaQuery, ref int DataCount, ref string ErrorMsg)
        {
            try
            {
                SelectInfo <SysArea> selectInfo = new SelectInfo <SysArea>("SysArea");

                Expression <Func <SysArea, bool> > predicate = null;

                var DbRequest = selectInfo
                                .SetWhere(predicate, DataBaseType.SqlServer, DataDeleteFlag.IsNotDelete)
                                .SetType(TableType.Table)
                                .OrderBy(EF => EF.CreateTime)
                                .OrderByDescending(EF => EF.ObjectId)
                                .Check(ref erolt)
                                .Run <SysAreaVm>(db, erolt);

                //selectInfo
                //    .GetById("123")
                //    .Run();

                //var DbRequest = selectInfo.SetSqlStr("select * from SysArea").Run<SysAreaVm>();

                //var DbRequest = DbContextExtensions.Query<SysAreaVm>(new MSSqlDBContext(), new DbContextSqlQueryCommands
                //{
                //    Sql = sql
                //}).ToList();
                //ErrorMsg = "Select Success";
                return(DbRequest);
            }
            catch (Exception ex)
            {
                ErrorMsg = "Select Error";
                return(null);
            }
        }
 public void CopyRange(SelectInfo aSrc)
 {
     this.StartItemNo     = aSrc.StartItemNo;
     this.StartItemOffset = aSrc.StartItemOffset;
     this.EndItemNo       = aSrc.EndItemNo;
     this.EndItemOffset   = aSrc.EndItemOffset;
 }
        public string SelectionToText(SelectInfo selInfo)
        {
            string ret = string.Empty;

            if (selInfo.IsTextSelectionValid())
            {
                for (int i = selInfo.StartPage; i <= selInfo.EndPage; i++)
                {
                    if (ret != "")
                    {
                        ret += "\r\n";
                    }

                    int s = 0;
                    if (i == selInfo.StartPage)
                    {
                        s = selInfo.StartIndex;
                    }

                    int len = Document.Pages[i].Text.CountChars;
                    if (i == selInfo.EndPage)
                    {
                        len = (selInfo.EndIndex + 1) - s;
                    }

                    ret += Document.Pages[i].Text.GetText(s,
                                                          len);
                }
            }

            return(ret);
        }
Exemple #10
0
        private SelectInfo getSelectInfo()
        {
            SelectInfo si = new SelectInfo();

            String path = String.Format("{0}\\{1}", System.AppDomain.CurrentDomain.BaseDirectory, "test\\Records\\");

            si.RecordDirectory = path;
            si.Volume          = 50000;
            si.Pressure        = 500;
            si.VolumeUnit      = VolumeUnit.vuM3H;
            si.PressureUnit    = PressureUnit.puPa;
            si.PressureType    = PressureType.ptStatic;
            si.CallType        = 0;
            si.Debug           = 0;
            si.Hz                = 50;
            si.Temperature       = 20;
            si.Altitude          = 0;
            si.ProductType       = Product.ptAny;
            si.MinStyle          = 1;
            si.MinClass          = FanClass.fcI;
            si.SoundCondition    = SoundCondition.scRoom;
            si.FanCasing         = FanCasing.fcSingleFrame;
            si.FanWidth          = 1;
            si.VelocityUnit      = VelocityUnit.vuMS;
            si.OutletType        = OutletType.otDucted;
            si.ServiceFactor     = 1.3F;
            si.AltitudeUnit      = AltitudeUnit.auFT;
            si.SoundDistance     = 1;
            si.SoundDistanceUnit = DistanceUnit.duM;
            si.TemperatureUnit   = TemperatureUnit.DegreeC;

            return(si);
        }
        protected bool CreatePDFExtract(SelectInfo selInfo,
                                        string title = null)
        {
            Save(false);

            var extractPagePt = GetCharPointEx(selInfo.StartPage,
                                               selInfo.StartIndex);

            bool ret = PDFElement.Create(PDFElement.BinaryMember,
                                         selInfo.StartPage,
                                         selInfo.EndPage,
                                         selInfo.StartIndex,
                                         selInfo.EndIndex,
                                         PDFElement.ElementId,
                                         selInfo.StartPage,
                                         extractPagePt,
                                         PDFElement.ViewMode,
                                         PDFElement.PageMargin,
                                         PDFElement.Zoom,
                                         false,
                                         title) == PDFElement.CreationResult.Ok;

            if (ret)
            {
                PDFElement.PDFExtracts.Add(selInfo);
                Save(false);

                AddPDFExtractHighlight(selInfo);
            }

            return(ret);
        }
        public void RemoveByShapeIndexTest()
        {
            SelectInfo target     = new SelectInfo(); // TODO: Initialize to an appropriate value
            int        ShapeIndex = 0;                // TODO: Initialize to an appropriate value

            target.RemoveByShapeIndex(ShapeIndex);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
Exemple #13
0
    private void _SelectInfo(byte[] data)
    {
        Info.Instance.Print("audioinfo parse", true);
        SelectInfo result = NetworkUtils.Deserialize <SelectInfo>(data);
        MajPrefab  obj    = GameObject.Find("Controller").GetComponent <ARController>().visualizer;

        obj.handleSelect(result.id);
    }
 public static T FirstOrDefault <T>(this IQueryable <T> source, QueryInfo queryInfo)
     where T : class, new()
 {
     return(source.FirstOrDefault(
                FilterInfo.Parse(queryInfo?.Filter),
                OrderInfo.Parse(queryInfo?.OrderBy),
                SelectInfo.Parse(queryInfo?.Select)));
 }
 public static List <T> ListAll <T>(this IQueryable <T> source, QueryInfo queryInfo)
     where T : class, new()
 {
     return(source.ListAll(
                FilterInfo.Parse(queryInfo?.Filter),
                OrderInfo.Parse(queryInfo?.OrderBy),
                SelectInfo.Parse(queryInfo?.Select)));
 }
        public void LayerHandleTest()
        {
            SelectInfo target = new SelectInfo(); // TODO: Initialize to an appropriate value
            int        actual;

            actual = target.LayerHandle;
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
        public void SelectBoundsTest()
        {
            SelectInfo target = new SelectInfo(); // TODO: Initialize to an appropriate value
            Extents    actual;

            actual = target.SelectBounds;
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
        public void AddSelectedShapeTest()
        {
            SelectInfo    target   = new SelectInfo(); // TODO: Initialize to an appropriate value
            SelectedShape newShape = null;             // TODO: Initialize to an appropriate value

            target.AddSelectedShape(newShape);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
        public void SetLayerHandleTest()
        {
            SelectInfo target    = new SelectInfo(); // TODO: Initialize to an appropriate value
            int        NewHandle = 0;                // TODO: Initialize to an appropriate value

            target.SetLayerHandle(NewHandle);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
Exemple #20
0
 public void NewCharacterSuccess(SelectInfo info)
 {
     CreateClose();
     AddCharacter(info);
     NewCharacterBox.SetActive(false);
     LogOutButton.gameObject.SetActive(true);
     SelectCharacterBox.SetActive(true);
 }
Exemple #21
0
        public void ResetTest()
        {
            SelectInfo  inp    = null;                                        // TODO: Initialize to an appropriate value
            IEnumerator target = new SelectInfo.SelectedShapeEnumerator(inp); // TODO: Initialize to an appropriate value

            target.Reset();
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
Exemple #22
0
 private void lvMain_MouseUp(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         SelectInfo info = this.GetSelecctInfo();
         this.OnListViewShowMenu(new ListViewShowMenuEventArgs(info, this.databaseInfo, e));
     }
 }
Exemple #23
0
        private MemberBinding ToMemberBinding(Expression it, SelectClause selectClause)
        {
            Expression navigationProperty = Expression.MakeMemberAccess(it, _navigationProperty);

            if (_isCollection)
            {
                // NavigationProperty = it.NavigationProperty.Select( arg => new Item { ... } ).ToArray()
                // NavigationProperty = it.NavigationProperty.Select( arg => new Item { ... } ).ToList()

                // apply all constraints
                if (Select != null)
                {
                    navigationProperty = Select.ApplyTo(navigationProperty);
                }
                if (Orderby != null)
                {
                    navigationProperty = Orderby.ApplyTo(navigationProperty);
                }
                if (Filter != null)
                {
                    navigationProperty = Filter.ApplyTo(navigationProperty);
                }
                if (Skip != null)
                {
                    navigationProperty = Skip.ApplyTo(navigationProperty, ItemType);
                }
                if (Top != null)
                {
                    navigationProperty = Top.ApplyTo(navigationProperty, ItemType);
                }

                // build proper select of properties
                var expression = BuildSelectLambdaExpression(ItemType, selectClause, NestedExpands);

                navigationProperty = Expression.Call(null,
                                                     SelectInfo.MakeGenericMethod(ItemType, ItemType),
                                                     navigationProperty,
                                                     expression
                                                     );

                // add ToList/ToArray
                var loadFunction = _navigationProperty.PropertyType.IsArray
                    ? ToArrayInfo.MakeGenericMethod(ItemType)
                    : ToListInfo.MakeGenericMethod(ItemType);

                navigationProperty = Expression.Call(null,
                                                     loadFunction,
                                                     navigationProperty
                                                     );
            }
            else
            {
                // NavigationProperty = new Item { ... }
                navigationProperty = BuildMemberInit(ItemType, navigationProperty, selectClause, NestedExpands);
            }

            return(Expression.Bind(_navigationProperty, navigationProperty));
        }
Exemple #24
0
 public void AddCharacter(SelectInfo info)
 {
     if (characters.Count >= Globals.MaxCharacterCount)
     {
         return;
     }
     characters.Add(info);
     Refresh();
 }
Exemple #25
0
        public static IQueryable <R> DoSelect <T, R>(this IQueryable <T> source, SelectInfo selectInfo, ObjectMapper <T, R> baseMapper)
            where T : class
            where R : class, new()
        {
            _ = source ?? throw new ArgumentNullException(nameof(source));
            var mapper = baseMapper;

            return(source.Map(mapper));
        }
Exemple #26
0
 public void changeSelectId(int player, int index)
 {
     if (Server.Players.Count > player)
     {
         SelectInfo x = new SelectInfo();
         x.id = index;
         Server.Players[player].Send(MessageType.SelectInfo, NetworkUtils.Serialize(x));
     }
 }
Exemple #27
0
        public void CurrentTest()
        {
            SelectInfo  inp    = null;                                        // TODO: Initialize to an appropriate value
            IEnumerator target = new SelectInfo.SelectedShapeEnumerator(inp); // TODO: Initialize to an appropriate value
            object      actual;

            actual = target.Current;
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Exemple #28
0
        public void ParseTestsAncCheckCount(string command, int outputCount, int conditionCount, int orderByCount)
        {
            DefaultSelectParser parser = new DefaultSelectParser();
            SelectInfo          info   = parser.Parse(command);

            Assert.AreEqual(outputCount, info.Fields.Count, "count of output");
            Assert.AreEqual(conditionCount, info.Conditions.Count, "count of condition");
            Assert.AreEqual(orderByCount, info.Orders.Count, "count of orderby");
        }
        private SelectInfo createSelectInfo()
        {
            SelectInfo si   = new SelectInfo();
            String     path = String.Format("{0}{1}", System.AppDomain.CurrentDomain.BaseDirectory, "test\\Records\\");

            si.RecordDirectory = path;

            return(si);
        }
        public void ShapesSelectedTest()
        {
            MapWindow.PluginTracker target = new PluginTracker(); // TODO: Initialize to an appropriate value
            int        Handle     = 0;                            // TODO: Initialize to an appropriate value
            SelectInfo SelectInfo = null;                         // TODO: Initialize to an appropriate value

            target.ShapesSelected(Handle, SelectInfo);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
            public void Update(SelectInfo info)
            {
                if (info == null)
                {
                    Index = 44;
                    Library = Libraries.Prguse;
                    NameLabel.Text = string.Empty;
                    LevelLabel.Text = string.Empty;
                    ClassLabel.Text = string.Empty;

                    NameLabel.Visible = false;
                    LevelLabel.Visible = false;
                    ClassLabel.Visible = false;

                    return;
                }

                Library = Libraries.Title;

                Index = 660 + (byte) info.Class;

                if (Selected) Index += 5;


                NameLabel.Text = info.Name;
                LevelLabel.Text = info.Level.ToString();
                ClassLabel.Text = info.Class.ToString();
                
                NameLabel.Visible = true;
                LevelLabel.Visible = true;
                ClassLabel.Visible = true;
            }
Exemple #32
0
 protected override void ReadPacket(BinaryReader reader)
 {
     CharInfo = new SelectInfo(reader);
 }
Exemple #33
0
		public static PolyGisLayer CreateFromUtmFbxModel(Game engine, string fileName)
		{
			var scene = engine.Content.Load<Scene>(fileName);

			var s = fileName.Split('_');
			double easting	= double.Parse(s[1]);
			double northing = double.Parse(s[2]);
			string region	= s[3];
			
			var transforms = new Matrix[scene.Nodes.Count];
			scene.ComputeAbsoluteTransforms(transforms);

			List<Gis.GeoPoint>	points = new List<Gis.GeoPoint>();
			List<int>			indeces = new List<int>();

			var oInfo = new SelectInfo[scene.Meshes.Count];

			for (int i = 0; i < scene.Nodes.Count; i++) {

				var meshIndex = scene.Nodes[i].MeshIndex;

				if (meshIndex < 0) {
					continue;
				}


				oInfo[meshIndex] = new SelectInfo {
					MeshIndex	= meshIndex,
					NodeIndex	= i,
					NodeName	= scene.Nodes[i].Name
				};


				int vertexOffset = points.Count;

				var world = transforms[i];

				double worldLon, worldLat;
				Gis.UtmToLatLon(easting + world.TranslationVector.X, northing - world.TranslationVector.Z, region, out worldLon, out worldLat);

				var worldBasis			= GeoHelper.CalculateBasisOnSurface(DMathUtil.DegreesToRadians(new DVector2(worldLon, worldLat)));
				var worldBasisInvert	= DMatrix.Invert(worldBasis);

				oInfo[meshIndex].WorldMatrix		= worldBasis;
				oInfo[meshIndex].WorldMatrixInvert	= worldBasisInvert;

				List<Vector3> cartPoints = new List<Vector3>();
				
				foreach (var vert in scene.Meshes[meshIndex].Vertices) {
					var pos = vert.Position;

					var worldPos	= Vector3.TransformCoordinate(pos, world);
					var worldNorm	= Vector3.TransformNormal(vert.Normal, world);


					double lon, lat;
					Gis.UtmToLatLon(easting + worldPos.X, northing - worldPos.Z, region, out lon, out lat);

					DVector3 norm = new DVector3(worldNorm.X, worldNorm.Z, worldNorm.Y);
					norm.Normalize();

					norm = DVector3.TransformNormal(norm, DMatrix.RotationYawPitchRoll(DMathUtil.DegreesToRadians(lon), DMathUtil.DegreesToRadians(lat), 0));
					norm.Normalize();

					norm.Y = -norm.Y;

					lon = DMathUtil.DegreesToRadians(lon) + 0.0000068;
					lat = DMathUtil.DegreesToRadians(lat) + 0.0000113;

					cartPoints.Add(DVector3.TransformCoordinate(GeoHelper.SphericalToCartesian(new DVector2(lon, lat), GeoHelper.EarthRadius + worldPos.Y / 1000.0f), worldBasisInvert).ToVector3());

					var point = new Gis.GeoPoint {
						Lon		= lon,
						Lat		= lat,
						Color	= vert.Color0,
						Tex0	= new Vector4(norm.ToVector3(), 0),
						Tex1	= new Vector4(0,0,0, worldPos.Y/1000.0f)
					};
					point.Color.Alpha = 0.5f;
					points.Add(point);
				}

				oInfo[meshIndex].BoundingBox = BoundingBox.FromPoints(cartPoints.ToArray());

				var inds = scene.Meshes[meshIndex].GetIndices();

				foreach (var ind in inds) {
					indeces.Add(vertexOffset + ind);
				}

			}

			return new PolyGisLayer(engine, points.ToArray(), indeces.ToArray(), false) { objectsInfo = oInfo };
		}
Exemple #34
0
		public ModelLayer(Game engine, DVector2 lonLatPosition, string fileName, int maxInstancedCount = 0) : base(engine)
		{
			model = engine.Content.Load<Scene>(fileName);

			transforms = new Matrix[model.Nodes.Count];
			model.ComputeAbsoluteTransforms(transforms);

			LonLatPosition	= lonLatPosition;

			Transparency = 1.0f;

			constData	= new ConstDataStruct();
			modelBuf	= new ConstantBuffer(Game.GraphicsDevice, typeof(ConstDataStruct));
			shader		= Game.Content.Load<Ubershader>("globe.Model.hlsl");
			
			factory		= shader.CreateFactory( typeof(ModelFlags), Primitive.TriangleList, VertexInputElement.FromStructure<VertexColorTextureTBNRigid>(), BlendState.AlphaBlend, RasterizerState.CullCW, DepthStencilState.Default);
			factoryXray = shader.CreateFactory( typeof(ModelFlags), Primitive.TriangleList, VertexInputElement.FromStructure<VertexColorTextureTBNRigid>(), BlendState.AlphaBlend, RasterizerState.CullCW, DepthStencilState.Default);
			
			if (maxInstancedCount > 0) {
				InstancedCountToDraw	= maxInstancedCount;
				InstancedDataCPU		= new InstancedDataStruct[maxInstancedCount];

				instDataGpu = new StructuredBuffer(engine.GraphicsDevice, typeof(InstancedDataStruct), maxInstancedCount, StructuredBufferFlags.None);
			}

			selectInfo = new SelectInfo[model.Nodes.Count];
			for (int i = 0; i < model.Nodes.Count; i++)
			{
				var meshindex = model.Nodes[i].MeshIndex;
				if (meshindex < 0) continue;

				selectInfo[i] = new SelectInfo
				{
					BoundingBox = model.Meshes[meshindex].ComputeBoundingBox(),
					MeshIndex = meshindex,
					NodeIndex = i,
					NodeName = model.Nodes[i].Name
				};
			}

		}
            public void Update(SelectInfo info)
            {
                if (info == null)
                {
                    Index = 45;
                    NameLabel.Text = string.Empty;
                    LevelLabel.Text = string.Empty;
                    ClassLabel.Text = string.Empty;

                    NameLabel.Visible = false;
                    LevelLabel.Visible = false;
                    ClassLabel.Visible = false;

                    return;
                }

                Index = 90 + (byte) info.Class;

                if (Selected) Index += 4;

                NameLabel.Text = info.Name;
                LevelLabel.Text = info.Level.ToString();
                ClassLabel.Text = info.Class.ToString();

                NameLabel.Visible = true;
                LevelLabel.Visible = true;
                ClassLabel.Visible = true;
            }