Ejemplo n.º 1
0
        public ActionResult Update(BGImage bgi)
        {
            if (ModelState.IsValid)
            {
                BGImage Bgi = db.BGImages.Find(bgi.Id);

                if (bgi.ImageFile != null)
                {
                    string imageName = DateTime.Now.ToString("ddMMyyyyHHmmssfff") + bgi.ImageFile.FileName;
                    string imagePath = Path.Combine(Server.MapPath("~/Uploads/"), imageName);

                    string oldImagePath = Path.Combine(Server.MapPath("~/Uploads/"), Bgi.Image);
                    System.IO.File.Delete(oldImagePath);

                    bgi.ImageFile.SaveAs(imagePath);
                    Bgi.Image = imageName;
                }
                Bgi.TItle = bgi.TItle;
                Bgi.Page  = bgi.Page;

                db.Entry(Bgi).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(bgi));
        }
        void ReleaseDesignerOutlets()
        {
            if (BGImage != null)
            {
                BGImage.Dispose();
                BGImage = null;
            }

            if (BrushPreview != null)
            {
                BrushPreview.Dispose();
                BrushPreview = null;
            }

            if (BrushSlider != null)
            {
                BrushSlider.Dispose();
                BrushSlider = null;
            }

            if (Canvas != null)
            {
                Canvas.Dispose();
                Canvas = null;
            }

            if (ChangeColourButton != null)
            {
                ChangeColourButton.Dispose();
                ChangeColourButton = null;
            }

            if (Colour1 != null)
            {
                Colour1.Dispose();
                Colour1 = null;
            }

            if (Colour2 != null)
            {
                Colour2.Dispose();
                Colour2 = null;
            }

            if (TempCanvas != null)
            {
                TempCanvas.Dispose();
                TempCanvas = null;
            }

            if (TouchToCanvas != null)
            {
                TouchToCanvas.Dispose();
                TouchToCanvas = null;
            }
        }
Ejemplo n.º 3
0
        public ActionResult Update(int id)
        {
            BGImage bgi = db.BGImages.Find(id);

            if (bgi == null)
            {
                return(HttpNotFound());
            }

            return(View(bgi));
        }
        public void AddProperties(PropertyOwner owner)
        {
            BGImage.Position = new Point(1590, 100);
            BGImage.Initialize();



            AddPanelProperties();

            if (owner != PropertyOwner.SLIDER && owner != PropertyOwner.TOGGLE)
            {
                _textProperties = new TextProperty(this);
                _textProperties.AddProperties(owner);
                foreach (var item in _textProperties.Properties)
                {
                    _properties.Add(item.Key, item.Value);
                }
            }

            if (owner != PropertyOwner.LABEL)
            {
                _surfaceProperties = new SurfaceProperty(this);
                _surfaceProperties.AddProperties(owner);
                foreach (var item in _surfaceProperties.Properties)
                {
                    _properties.Add(item.Key, item.Value);
                }
            }

            if (owner == PropertyOwner.COMBOBOX)
            {
                _advancedProperties = new AdvancedProperty(this);
                _advancedProperties.AddProperties(owner);
                foreach (var item in _advancedProperties.Properties)
                {
                    _properties.Add(item.Key, item.Value);
                }
            }
            _generalProperties = new GeneralProperty(this);
            _generalProperties.AddProperties(owner);

            foreach (var item in _generalProperties.Properties)
            {
                _properties.Add(item.Key, item.Value);
            }

            _search.FieldWidth      = 320;
            _search.SampleText      = "Search for an item here...";
            _search.StickSampleText = true;

            _search.TextColor = Color.White;

            AddEvents();
        }
Ejemplo n.º 5
0
 public ItemGroup(T[] items, LockedState lockedState)
 {
     State = lockedState;
     Items = items;
     Level = -1;
     MascotIconContentKey = null;
     LocalizedThemeName   = null;
     ThemeIconContentKey  = null;
     BGImage       = BGImage.Default;
     GroupPosition = GroupPosition.None;
 }
Ejemplo n.º 6
0
 protected override void UpdateBackground()
 {
     if (goal.GetType().Equals(typeof(ScoreTarget)))
     {
         BGImage.UpdatePos(Mathf.Clamp(displayTime / level.ranks[level.ranks.Length - 1], 0, 1));
     }
     else
     {
         base.UpdateBackground();
     }
 }
        public void SetupProperties()
        {
            BGImage.Setup();

            foreach (var item in _properties)
            {
                item.Key.Position = BGImage.Position + item.Value;
                item.Key.Setup();
            }
            _lockerTooltip.Setup();
        }
        public void Update(GameTime gameTime)
        {
            if (MainWindow.CurrentObject == Owner)
            {
                BGImage.Update(gameTime);

                for (int i = _properties.Count - 1; i >= 0; i--)
                {
                    var item = _properties.ElementAt(i);

                    item.Key.Position = BGImage.Position + item.Value;
                    item.Key.Update(gameTime);
                }

                if (_textProperties != null)
                {
                    _textProperties.Update(gameTime);
                }

                if (_surfaceProperties != null)
                {
                    _surfaceProperties.Update(gameTime);
                }

                if (_advancedProperties != null)
                {
                    _advancedProperties.Update(gameTime);
                }
                _generalProperties.Update(gameTime);

                _showhide.Selected = Owner.Active;
                _locker.Selected   = Owner.Locked;

                if (MainWindow.RootContainer is Grid)
                {
                    _layoutCBG.SetSelected(_grid);
                }
                else if (MainWindow.RootContainer is Frame)
                {
                    _layoutCBG.SetSelected(_free);
                }
                else if (MainWindow.RootContainer is VerticalStack)
                {
                    _layoutCBG.SetSelected(_vertical);
                }
                else
                {
                    _layoutCBG.SetSelected(_horizontal);
                }

                _lockerTooltip.Update(gameTime);
            }
        }
        public void AddPropertyRenderer(SpriteBatch batch)
        {
            BGImage.AddSpriteRenderer(batch);
            _lockerTooltip.AddSpriteRenderer(batch);
            _lockerTooltip.AddStringRenderer(batch);

            foreach (var item in _properties)
            {
                item.Key.AddSpriteRenderer(batch);
                item.Key.AddStringRenderer(batch);
            }
            BGImage.Active = true;
        }
Ejemplo n.º 10
0
        public void Draw()
        {
            if (MainWindow.CurrentObject == Owner)
            {
                BGImage.Draw();

                for (int i = _properties.Count - 1; i >= 0; i--)
                {
                    _properties.ElementAt(i).Key.Draw();
                }
                // Temporary
                _lockerTooltip.Draw();
            }
        }
Ejemplo n.º 11
0
        public ActionResult Delete(int id)
        {
            BGImage bgi = db.BGImages.Find(id);

            if (bgi == null)
            {
                return(HttpNotFound());
            }

            db.BGImages.Remove(bgi);
            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
    public void SetBackgroundImage(BGImage bgImage)
    {
        switch (bgImage)
        {
        case BGImage.Default:
            setBackgroundSprite(DefaultSprite);
            break;

        case BGImage.Start:
            setBackgroundSprite(StartSprite);
            break;

        case BGImage.Middle:
            setBackgroundSprite(MiddleSprite);
            break;

        case BGImage.End:
            setBackgroundSprite(EndSprite);
            break;
        }
    }
Ejemplo n.º 13
0
        private void FileTreeViewSelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            var tree = sender as TreeView;

            if (tree.SelectedItem is TreeViewItem)
            {
                var item = tree.SelectedItem as TreeViewItem;

                //MessageBox.Show("sdadas:" + tree.SelectedItem);
            }
            else if (tree.SelectedItem is string)
            {
                //MessageBox.Show(tree.SelectedItem.ToString());
            }
            else if (tree.SelectedItem is FileEntry)
            {
                fileNameTextBlock.Text = (tree.SelectedItem as FileEntry).FileName.ToString();
                offsetTextBlock.Text   = (tree.SelectedItem as FileEntry).FileOffset.ToString();
                FileEntry f   = (FileEntry)tree.SelectedItem;
                var       ext = Path.GetExtension(f.FileName);

                if (ext.Equals(".LBV"))
                {
                    LBVImage image = new LBVImage(resource.GetFile(f.ResourceIdx), f.FileName, resource.FileName);
                    showImage(image);
                }
                else if (ext.Equals(".RRM"))
                {
                    RRMImage image = (RRMImage)tree.SelectedItem;
                    showImage(image);
                }
                else if (ext.Equals(".BG"))
                {
                    Console.Out.WriteLine("Trying to display BD image from The Last Express...");

                    var image = new BGImage(resource.GetFile(f.ResourceIdx), f.FileName, resource.FileName);
                    showImage(image);
                }
            }
        }
Ejemplo n.º 14
0
        public ActionResult Create(BGImage bgi)
        {
            if (ModelState.IsValid)
            {
                if (bgi.ImageFile == null)
                {
                    ModelState.AddModelError("", "Image is requred!");
                    return(View(bgi));
                }
                string imageName = DateTime.Now.ToString("ddMMyyyyHHmmssfff") + bgi.ImageFile.FileName;
                string imagePath = Path.Combine(Server.MapPath("~/Uploads/"), imageName);

                bgi.ImageFile.SaveAs(imagePath);
                bgi.Image = imageName;

                db.BGImages.Add(bgi);
                db.SaveChanges();

                return(RedirectToAction("Index"));
            }

            return(View(bgi));
        }
Ejemplo n.º 15
0
 void Start()
 {
     current = GameObject.Find("BackgroundImage").GetComponent <BGImage>();
 }
Ejemplo n.º 16
0
 void start()
 {
     currentImage = GameObject.Find("BackgrondImage").GetComponent <BGImage>();
 }
Ejemplo n.º 17
0
 // Use this for initialization
 void Start()
 {
     current = GameObject.Find("BackgroundImage").GetComponent <BGImage>();
     Cur     = Int32.Parse(current.currentImage); //Cur은 string인 currentImage를 정수로 형변환 한것.
 }
Ejemplo n.º 18
0
 public void Interact(BGImage currentImage)
 {
     Pickup();
 }