对象正确可见性的问题

时间:2019-05-11 19:16:02

标签: c# visual-studio .net-framework-version

我想编写一个代码,当条件使我消失时,它会预先定义一个对象。问题在于,即使代码中的对象碰巧被隐藏了,在应用程序中也没有。

我已经证明,在更改了一个对象的所有权之后,我重新粉刷了所有这些对象,以便一个对象消失,但是它不起作用。我也不认为代码是错误的,因为在Visual Studio中我没有收到错误。

/* Getting file name */
$filename = $_FILES['file']['name'];

/* Location */
$location = "uploads/".$filename;

/* Upload file */
if(move_uploaded_file($_FILES['file']['tmp_name'],$location)){
    echo 'Uploaded: ' . $filename;
}

我首先创建了这个数组:

if (matriunombres[rectangleTocatfila, rectangleTocatcolumna] == 0)
{
    matriurectangles[rectangleTocatfila, rectangleTocatcolumna].Visibility = Visibility.Hidden;
}

这是Rectangle类:

private void crearArrayRectangles(Rectangle[,] matriurectangles, int 
ampladarect, int alçadarect, int espaiX, int espaiY, int 
nombreRectanglesVerticals, int nombreRectanglesHoritzontals, int margeX, 
int margeY)
        {
            int posX;
            int posY;
            for (int y = 0; y < nombreRectanglesVerticals; y++)
            {
                for (int x = 0; x < nombreRectanglesHoritzontals; x++)
                { posX = espaiX * (1 + x) + (ampladarect * x) + margeX;
                    posY = espaiY * (1 + y) + (alçadarect * y) + margeY;
                    Rectangle rectangle = creaRectangle(posX, posY, 
ampladarect, alçadarect, Colors.Violet);
                    canvas_joc.Children.Add(rectangle);
                    matriurectangles[x,y] = creaRectangle(posX, posY, 
ampladarect, alçadarect, Colors.Violet);
                }

             }


         }

我希望使数组的对象不可见。

0 个答案:

没有答案