Esempio n. 1
0
        private void codeProvider_Apply(object sender, ApplyContentEventArgs ea)
        {
            //select the entire block that belongs to the active element.
            _activeElement.SelectFullBlock();
            //_fullBlockText = Environment.NewLine + CodeRush.Selection.Text;
            //CodeRush.Selection.Delete();
            _activeBlock = CodeRush.TextViews.Active.Selection;

            //get the document for the parent class and activate it.
            Document parentDocument = CodeRush.Documents.Get(_parentClass.FileNode.Name);

            CodeRush.Documents.Activate(parentDocument);

            //now select the target location in the parent class' document.
            if (_parentClass.FirstChild == null)
            {
                //this is temporary. i would like to use the "cc" command in the dxcore but dont know how...
                actionHint.Color = Color.Orange;
                actionHint.Text  = "Add a constructor first..";
                actionHint.PointTo(_parentClass.NameRange.End.Line, _parentClass.NameRange.End.Offset);
                _activeBlock.Clear();
            }
            else
            {
                targetPicker.Start(_parentClass.View as TextView, _parentClass.FirstChild);
            }
        }
Esempio n. 2
0
 private void DeleteTypeDeclaration(LanguageElement element)
 {
     element.SelectFullBlock();
     CodeRush.Selection.Delete();
 }
 private void DeleteTypeDeclaration(LanguageElement element)
 {
     element.SelectFullBlock();
     CodeRush.Selection.Delete();
 }