Ejemplo n.º 1
0
        public CustomTile(MainForm mainForm, MetroTile tile, int tileNum, string serializedTileInfo)
        {
            this.mainForm           = mainForm;
            this.tile               = tile;
            this.tileNum            = tileNum;
            this.serializedTileInfo = serializedTileInfo;

            tile.Click += (s, e) => {
                if (path != "")
                {
                    Process.Start(path);
                }
                else
                {
                    // no value defined for this custom tile.
                    CustomTileForm ctf = new CustomTileForm(mainForm, this);
                    ctf.ShowDialog();
                }
            };

            if (serializedTileInfo == "")
            {
                return;
            }

            var serializedTileInfoArr = serializedTileInfo.Split(',');

            for (int i = 0; i < serializedTileInfoArr.Length; i++)
            {
                if (i == 0)
                {
                    path = serializedTileInfoArr[0];
                    if (path == null)
                    {
                        return;
                    }
                    setPath(path);
                }
                else if (i == 1)
                {
                    tile.Text = serializedTileInfoArr[1];
                }
            }
        }
Ejemplo n.º 2
0
        public void editTile()
        {
            CustomTileForm ctf = new CustomTileForm(mainForm, this);

            ctf.ShowDialog();
        }