AtelierElieScripter.DialogueChoices.DialogueChoicesControl.PanelsJapPaint C# (CSharp) Метод

PanelsJapPaint() приватный Метод

private PanelsJapPaint ( object sender, PaintEventArgs e ) : void
sender object
e PaintEventArgs
Результат void
        void PanelsJapPaint(object sender, PaintEventArgs e)
        {
            if (custListViewMain.SelectedIndices.Count > 0 && custListViewBlock.SelectedIndices.Count > 0)
            {
                DialogueChoicesEntry choicesEntry = GetCurrentDialogueEntry();
                int j = 0;

                Lib.NoBackgroundPaintPanel panel = (Lib.NoBackgroundPaintPanel)sender;

                for (int i = 0; i < panelsJap.Length; i++)
                {
                    if (panel.Name == panelsJap[i].Name)
                        j = i;
                }

                if (choicesEntry.JapText[j] != null)
                {
                    ResourceObjects.JapFontResourceObject resobject = ResourceObjects.JapFontResourceObject.Instance;
                    Bitmap buffer = resobject.GetTextWithChoiceBoxBitmap(choicesEntry.JapText[j]);
                    panelsJap[j].Size = buffer.Size;

                    //Draws buffer
                    Graphics g = e.Graphics;

                    Point rect = new Point(0, 0);
                    g.DrawImage(buffer, rect);

                }
                else
                {
                    panelsJap[j].Visible = false;
                }

            }
        }