//-------------------------------------------------------------
        public SuggestedGameInternetControl(DTO_Suggestion dto, KobberLan parent)
        //-------------------------------------------------------------
        {
            //Init control
            InitializeComponent();

            kobberLan              = parent;
            dto_suggestion         = dto;
            Likes                  = new List <IPAddress>();
            label_GameTitle.Text   = dto.title;
            pictureBox_Cover.Image = dto.imageCover;

            //Set mouseover tooltip
            CustomToolTip tip = new CustomToolTip(dto, this);

            tip.InitImage(dto.imageBig);
            tip.SetToolTip(pictureBox_Cover, "Details");

            //Check for startup value
            if (!(string.IsNullOrEmpty(dto.startGame) && string.IsNullOrEmpty(dto.startServer)))
            {
                button_Play.Enabled = true;
            }

            //Show popup notification about the new game
            kobberLan.Invoke(new Action(() =>
            {
                kobberLan.ShowBallonTip("Kobberlan internet suggested", "Game: " + dto_suggestion.title);
            }));
        }
        //-------------------------------------------------------------
        public SuggestedGameControl(DTO_Suggestion dto, KobberLan parent)
        //-------------------------------------------------------------
        {
            //Init control
            InitializeComponent();

            finishedDownloaded = false;
            kobberLan          = parent;
            dto_suggestion     = dto;
            Likes = new List <IPAddress>();
            label_GameTitle.Text   = dto.title;
            pictureBox_Cover.Image = dto.imageCover;
            state = TorrentState.Starting;

            if (dto.torrent == null)
            {
                button_Get.Enabled = false;
                button_Get.Visible = false;
            }
            else //Internet suggestion
            {
                button_Get.Enabled = true;
                button_Get.Visible = true;
            }

            //Set mouseover tooltip
            CustomToolTip tip = new CustomToolTip(dto, this);

            tip.InitImage(dto.imageBig);
            tip.SetToolTip(pictureBox_Cover, "Details");

            //-------------------------------------------------------------
            //Check for startup value
            //-------------------------------------------------------------
            if (!(string.IsNullOrEmpty(dto.startGame) && string.IsNullOrEmpty(dto.startServer)))
            {
                button_Play.Visible = true;
                button_Play.Enabled = false;

                //-------------------------------------------------------------
                //Check if player already got the game
                //-------------------------------------------------------------
                var path = Helper.GetDirection();
                if (Directory.Exists(path + "\\" + dto_suggestion.key))
                {
                    button_Play.Enabled = true;
                }
            }

            //Show popup notification about the new game
            kobberLan.Invoke(new Action(() =>
            {
                kobberLan.ShowBallonTip("Kobberlan game suggested", "Game: " + dto_suggestion.title);
            }));
        }
Example #3
0
        //-------------------------------------------------------------
        public SuggestedGameOwnerControl(DTO_Suggestion dto, string pathHDD, KobberLan parent, bool ownSuggestions = false)
        //-------------------------------------------------------------
        {
            //Init control
            InitializeComponent();

            torrentPeers = new List <string>();
            torrentPeers.Add("127.0.0.1"); // Inclusive owner
            torrentDownloadCompleted = new List <string>();
            torrentDownloadStarted   = new List <string>();

            ingame                 = new List <string>();
            metaProgress           = 0;
            state                  = TorrentState.Starting;
            kobberLan              = parent;
            path                   = pathHDD;
            dto_suggestion         = dto;
            Likes                  = new List <IPAddress>();
            label_GameTitle.Text   = dto.title;
            pictureBox_Cover.Image = dto.imageCover;

            //Set mouseover tooltip
            CustomToolTip tip = new CustomToolTip(dto, this);

            tip.InitImage(dto.imageBig);
            tip.SetToolTip(pictureBox_Cover, "Details");
            torrentShared = false;

            //Check for startup value
            if (!(string.IsNullOrEmpty(dto.startGame) && string.IsNullOrEmpty(dto.startServer)))
            {
                button_Play.Enabled = true;
            }

            //Hide peers/downloads/remove if not own suggestions
            this.ownSuggestions = ownSuggestions;
            if (!ownSuggestions)
            {
                pictureBox_Downloaded.Visible = false;
                pictureBox_Peers.Visible      = false;
                label_Downloading.Visible     = false;
                label_Peers.Visible           = false;
                button_Clear.Visible          = false;
            }
        }