Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainForm"/> class.
        /// </summary>
        public MainForm()
        {
            // The InitializeComponent() call is required for Windows Forms designer support.
            InitializeComponent();

            textEditorControl1.ShowEOLMarkers   = false;
            textEditorControl1.ShowInvalidLines = false;

            HostCallbackImplementation.Register(this);
            CodeCompletionKeyHandler.Attach(this, textEditorControl1);
            ToolTipProvider.Attach(this, textEditorControl1);

            PcRegistry = new ProjectContentRegistry(); // Default .NET 2.0 registry

            // Persistence lets SharpDevelop.Dom create a cache file on disk so that future starts are faster.
            // It also caches XML documentation files in an on-disk hash table, thus reducing memory usage.
            // Paul Meems, 1 Sept. 2010: Create the file if it doesn't exist (Bug #1763):
            string cacheFolder = Path.Combine(Path.GetTempPath(), "CSharpCodeCompletion");

            if (!Directory.Exists(cacheFolder))
            {
                Directory.CreateDirectory(cacheFolder);
            }

            PcRegistry.ActivatePersistence(cacheFolder);

            MyProjectContent = new DefaultProjectContent
            {
                Language = IsVisualBasic ? LanguageProperties.VBNet : LanguageProperties.CSharp
            };
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainForm"/> class.
        /// </summary>
        public MainForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            //            if (IsVisualBasic) {
            //                textEditorControl1.Text = @"
            //Class A
            // Sub B
            //  Dim xx As String
            //
            // End Sub
            //End Class
            //";
            //                textEditorControl1.SetHighlighting("VBNET");
            //            } else {
            //                textEditorControl1.Text = @"using System;
            //class A
            //{
            // void B()
            // {
            //  string x;
            //
            // }
            //}
            //";
            //                textEditorControl1.SetHighlighting("C#");
            //            }
            textEditorControl1.ShowEOLMarkers   = false;
            textEditorControl1.ShowInvalidLines = false;

            HostCallbackImplementation.Register(this);
            CodeCompletionKeyHandler.Attach(this, textEditorControl1);
            ToolTipProvider.Attach(this, textEditorControl1);

            pcRegistry = new ProjectContentRegistry(); // Default .NET 2.0 registry

            // Persistence lets SharpDevelop.Dom create a cache file on disk so that
            // future starts are faster.
            // It also caches XML documentation files in an on-disk hash table, thus
            // reducing memory usage.
            // Paul Meems, 1 Sept. 2010: Create the file if it doesn't exist (Bug #1763):
            string cacheFolder = Path.Combine(Path.GetTempPath(), "CSharpCodeCompletion");

            if (!Directory.Exists(cacheFolder))
            {
                Directory.CreateDirectory(cacheFolder);
            }
            pcRegistry.ActivatePersistence(cacheFolder);

            myProjectContent          = new DefaultProjectContent();
            myProjectContent.Language = CurrentLanguageProperties;
        }
Exemplo n.º 3
0
        public MainForm()
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            if (IsVisualBasic)
            {
                textEditorControl1.Text = @"
Class A
 Sub B
  Dim xx As String
  
 End Sub
End Class
";
                textEditorControl1.SetHighlighting("VBNET");
            }
            else
            {
                textEditorControl1.Text = @"using System;
class A
{
 void B()
 {
  string x;
  
 }
}
";
                textEditorControl1.SetHighlighting("C#");
            }
            textEditorControl1.ShowEOLMarkers   = false;
            textEditorControl1.ShowInvalidLines = false;
            HostCallbackImplementation.Register(this);
            CodeCompletionKeyHandler.Attach(this, textEditorControl1);
            ToolTipProvider.Attach(this, textEditorControl1);

            pcRegistry = new Dom.ProjectContentRegistry();             // Default .NET 2.0 registry

            // Persistence lets SharpDevelop.Dom create a cache file on disk so that
            // future starts are faster.
            // It also caches XML documentation files in an on-disk hash table, thus
            // reducing memory usage.
            pcRegistry.ActivatePersistence(Path.Combine(Path.GetTempPath(),
                                                        "CSharpCodeCompletion"));

            myProjectContent          = new Dom.DefaultProjectContent();
            myProjectContent.Language = CurrentLanguageProperties;
            // create dummy parseInformation to prevent NullReferenceException when using CC before parsing
            // for the first time
            parseInformation = new Dom.ParseInformation(new Dom.DefaultCompilationUnit(myProjectContent));
        }