Ejemplo n.º 1
0
        private void UpdateData()
        {
            if (IsReady == false)
            {
                return;
            }

            CPCRawBitmap.Document.ItemType type = CPCRawBitmap.Document.ItemType.Raw;

            if (Raw.Checked)
            {
                type = CPCRawBitmap.Document.ItemType.Raw;
            }
            else if (VerticalRaw.Checked)
            {
                type = CPCRawBitmap.Document.ItemType.VerticalRaw;
            }

            CPCRawBitmap.Document.Item item = GetSelectedItem();
            if (item == null)
            {
                return;
            }

            item.Type = type;

            RefreshUI();

            SetModified(true);
        }
Ejemplo n.º 2
0
        private void lvFiles_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lvFiles.SelectedIndices.Count == 0)
            {
                curSelIndexLabel.Text       = "";
                Preview.Image               = null;
                GroupItemProperties.Enabled = false;
                Information.Text            = "";

                return;
            }

            int index = lvFiles.SelectedIndices[0];

            if (index < 0)
            {
                GroupItemProperties.Enabled = false;
            }
            else
            {
                curSelIndexLabel.Text = "Selection index: " + (index + 1);

                GroupItemProperties.Enabled = true;

                CPCRawBitmap.Document.Item item = Document.Items[index];

                PhactoryHost.Database.Resource bmpResource = Plugin.ControllerEditor.Host.GetResource(item.ResourceID);

                string filename = Plugin.ControllerEditor.Host.GetFileInfo(bmpResource).FullName;
                Preview.Image = Image.FromFile(filename);

                IsReady = false;

                CPCRawBitmap.Document.ItemType type = item.Type;

                switch (type)
                {
                case CPCRawBitmap.Document.ItemType.Raw:
                    Raw.Checked = true;
                    break;

                case CPCRawBitmap.Document.ItemType.VerticalRaw:
                    VerticalRaw.Checked = true;
                    break;
                }

                IsReady = true;
            }
        }