// instantiate a box instance
        private void addToBox(string name, string address, int rowspot, int colspot, int index)
        {
            box littleBox = new box(sizeOfBox, true);

            littleBox.index = index;
            littleBox.MouseEnter += Mouse_Enter;
            littleBox.MouseLeave += Mouse_Leave;

            // littleBox.boxName = name;
            // littleBox.address = address;
            // littleBox.name = name;
            // string path = System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\Images\\Tutorial_Art\\" + name + "_tutorial.png";
            string path = System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\Images\\Tutorial_Art\\" + name + "_tutorial.png";

            // string path = "/Resources/Images/" + Regex.Match(name, "([a-zA-Z]+)").Value + "-tutorial.png";
            littleBox.setImage(path);

            Grid.SetRow(littleBox, rowspot);
            Grid.SetColumn(littleBox, colspot);
            selectionGallary.Children.Add(littleBox);
        }
Exemplo n.º 2
0
        // instantiate a box instance
        private void addToBox(string name, string address, int rowspot, int colspot)
        {
            box littleBox = new box(sizeOfBox);

            littleBox.MouseEnter += Mouse_Enter;
            littleBox.MouseLeave += Mouse_Leave;

            littleBox.boxName = name;
            littleBox.address = address;
            littleBox.name = name;
            string path = System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "\\Images\\Album_Art\\" + name + ".jpg";
            littleBox.setImage(path);

            Grid.SetRow(littleBox, rowspot);
            Grid.SetColumn(littleBox, colspot);
            selectionGallary.Children.Add(littleBox);
        }