Esempio n. 1
0
        public CodeViewTab(ArmAssembly.ArmFileInfo progInfo, ApplicationJimulator jm)
        {
            JM  = jm;
            _PI = progInfo;
            string fileName = progInfo.FileName;

            InitializeComponent();

            this.SuspendLayout();
            this.Location = new System.Drawing.Point(4, 22);
            this.Name     = fileName;
            this.Size     = new System.Drawing.Size(464, 312);
            this.TabIndex = 0;
            this.Text     = Path.GetFileName(fileName);

            _codeViewList                 = new CodeViewList(this);
            _codeViewList.DrawItem       += this.drawItem;
            _codeViewList.VisibleChanged += this.createLines;
            this.Controls.Add(_codeViewList);

            this.fileSystemWatcher1.Path   = Path.GetDirectoryName(fileName);
            this.fileSystemWatcher1.Filter = Path.GetFileName(fileName);
            //_fileChanged = false;
            this.ResumeLayout(false);

            _drawParameters = new DrawParameters(_codeViewList.CreateGraphics(), _codeViewList.Font);
        }
Esempio n. 2
0
        private void drawItem(object sender, System.Windows.Forms.DrawItemEventArgs e)
        {
            if (!createLines())
            {
                return;
            }
            CodeViewList listBox = (CodeViewList)sender;

            if (e.Index < 0 || e.Index >= listBox.Items.Count)
            {
                return;
            }

            CodeViewLine cvl = (CodeViewLine)(listBox.Items[e.Index]);

            cvl.Draw(e.Index == listBox.SelectedIndex, e, _currentHighlightColour);
        }//drawItem