Пример #1
0
 public AstRoot(ITextProvider textProvider, ICodeEvaluator codeEvaluator)
 {
     TextProvider  = textProvider;
     Comments      = new CommentsCollection();
     Errors        = new TextRangeCollection <IParseError>();
     CodeEvaluator = codeEvaluator;
 }
Пример #2
0
        public override bool Parse(ParseContext context, IAstNode parent = null)
        {
            // Remove comments from the token stream
            Comments = new CommentsCollection(context.Comments);

            var globalScope = new GlobalScope();

            return(globalScope.Parse(context, this));
        }
Пример #3
0
 internal override void Close()
 {
     base.Close();
     if (this.m_textBody != null)
     {
         this.m_textBody.method_28();
         this.m_textBody = null;
     }
     this.m_format                  = null;
     this.textBodyPart_0            = null;
     this.paragraphItemCollection_1 = null;
     this.commentsCollection_0      = null;
 }
Пример #4
0
 public AstRoot(ITextProvider textProvider, ICodeEvaluator codeEvaluator) {
     TextProvider = textProvider;
     Comments = new CommentsCollection();
     Errors = new TextRangeCollection<IParseError>();
     CodeEvaluator = codeEvaluator;
 }
Пример #5
0
 public AstRoot(ITextProvider textProvider, ICodeEvaluator codeEvaluator)
 {
     TextProvider  = textProvider;
     Comments      = new CommentsCollection();
     CodeEvaluator = codeEvaluator;
 }
Пример #6
0
        private void dataGridViewComments_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex == -1)
            {
                if (dataGridViewComments.Columns[e.ColumnIndex] == ColumnCommentsUseIt)
                {
                    ContextMenu cm = new ContextMenu();
                    cm.MenuItems.Add(Localization.Manager.Get("_CheckAll", "Check all"), new EventHandler((o, e1) =>
                    {
                        foreach (DataGridViewRow row in dataGridViewComments.Rows)
                        {
                            (row.Tag as CommentsCollection).UseIt = true;
                        }
                        TaxonComments.Manager.SaveCollections();
                        FillCollectionsComments();
                    }));
                    cm.MenuItems.Add(Localization.Manager.Get("_UncheckAll", "Uncheck all"), new EventHandler((o, e1) =>
                    {
                        foreach (DataGridViewRow row in dataGridViewComments.Rows)
                        {
                            (row.Tag as CommentsCollection).UseIt = false;
                        }
                        TaxonComments.Manager.SaveCollections();
                        FillCollectionsComments();
                    }));
                    cm.Show(this, this.PointToClient(Cursor.Position));
                }
                return;
            }

            if (dataGridViewComments.Columns[e.ColumnIndex] == ColumnCommentsUseIt)
            {
                if (e.RowIndex < 0 || e.RowIndex >= dataGridViewComments.Rows.Count)
                {
                    return;
                }
                CommentsCollection collection = dataGridViewComments.Rows[e.RowIndex].Tag as CommentsCollection;
                if (collection != null)
                {
                    collection.UseIt = !collection.UseIt;
                    TaxonComments.Manager.SaveCollections();
                    FillCollectionsComments();
                }
            }
            if (dataGridViewComments.Columns[e.ColumnIndex] == ColumnCommentsRank)
            {
                CommentsCollection collection = dataGridViewComments.Rows[e.RowIndex].Tag as CommentsCollection;
                Rectangle          r          = dataGridViewComments.GetCellDisplayRectangle(e.ColumnIndex, e.RowIndex, true);
                Point pt = Cursor.Position;
                pt = dataGridViewComments.PointToClient(pt);
                if (pt.Y > r.Top && pt.Y < r.Bottom)
                {
                    if (pt.X > r.Left && pt.X < r.Left + 20)
                    {
                        TaxonComments.Manager.MoveUp(dataGridViewComments.Rows[e.RowIndex].Tag as CommentsCollection);
                        TaxonComments.Manager.SaveCollections();
                        FillCollectionsComments();
                    }
                    if (pt.X > r.Right - 20 && pt.X < r.Right)
                    {
                        TaxonComments.Manager.MoveDown(dataGridViewComments.Rows[e.RowIndex].Tag as CommentsCollection);
                        TaxonComments.Manager.SaveCollections();
                        FillCollectionsComments();
                    }
                }
            }
        }
Пример #7
0
 public AstRoot(ITextProvider textProvider, ICodeEvaluator codeEvaluator) {
     TextProvider = textProvider;
     Comments = new CommentsCollection();
     CodeEvaluator = codeEvaluator;
 }