Exemplo n.º 1
0
        private HotSpotItemCtrl CreateHotSpotItemCtrl(HotspotLocation location)
        {
            HotSpotItemCtrl itemCtrl = new HotSpotItemCtrl();

            itemCtrl.ItemDeleted    += new EventHandler(itemCtrl_ItemDeleted);
            itemCtrl.HotspotLocation = location;
            itemCtrl.LoadControl();
            return(itemCtrl);
        }
Exemplo n.º 2
0
        void itemCtrl_ItemDeleted(object sender, EventArgs e)
        {
            HotSpotItemCtrl ctrl = (HotSpotItemCtrl)sender;

            // remove from the collection
            hotSpot.Locations.Remove(ctrl.HotspotLocation);
            HotspotManager.Save();

            // remove from the panel containing it
            pnlHotSpotItems.Controls.Remove(ctrl);
        }
Exemplo n.º 3
0
        public void LoadControl()
        {
            lblImageName.Text    = hotSpot.ImageName;
            pbImagePreview.Image = ImageLoader.GetImageFromFile(Globals.SettingsResourceDir + hotSpot.ImageName, pbImagePreview.Width, pbImagePreview.Height);

            // Load locations
            pnlHotSpotItems.Controls.Clear();
            foreach (HotspotLocation location in hotSpot.Locations)
            {
                HotSpotItemCtrl ctrl = CreateHotSpotItemCtrl(location);
                pnlHotSpotItems.Controls.Add(ctrl);
            }
        }
Exemplo n.º 4
0
        private void lnkAddNewLocation_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (hotSpot != null)
            {
                HotspotLocation newLocation = new HotspotLocation();

                HotSpotItemCtrl ctrl = CreateHotSpotItemCtrl(newLocation);
                pnlHotSpotItems.Controls.Add(ctrl);

                hotSpot.Locations.Add(newLocation);
                HotspotManager.Save();
            }
        }