public FormsDesignerContent(FormsDesignerExtension parent, OpenedFile sourceFile)
            : base(parent)
        {
            _language = (NetLanguageDescriptor)LanguageDescriptor.GetLanguageByPath(sourceFile.FilePath);
            if (!(_language is NetLanguageDescriptor))
                throw new ArgumentException("File must be a .NET source file.");
            
            _extensionHost = parent.ExtensionHost;
            _extensionHost.ControlManager.AppearanceChanged += ControlManager_AppearanceChanged;

            _propertyContainer = new PropertyContainer();

            _serviceContainer = new ServiceContainer();
            _surfaceManager = parent.DesignerSurfaceManager;

            _codeReader = new DesignerCodeReader(_extensionHost, _language);
            _codeWriter = new DesignerCodeWriter(_language);

            this.Text = sourceFile.FilePath.FileName + sourceFile.FilePath.Extension + " [Design]";
            this.AssociatedFile = sourceFile;
            this.AssociatedFile.FilePathChanged += AssociatedFile_FilePathChanged;
            
            _errorControl = new ErrorControl()
            {
                Dock = DockStyle.Fill,
            };
            _errorControl.ReloadRequested += _errorControl_ReloadRequested;

            SetupDesigner();
        }
Ejemplo n.º 2
0
 public NetProjectTemplate(string name, Bitmap icon,
     NetLanguageDescriptor language,
     SubSystem applicationType,
     params FileTemplate[] files)
     : base(name, icon, files)
 {
     Language = language;
     ApplicationType = applicationType;
     References = new List<string>()
     {
         "System.dll",
     };
 }
 public DesignerCodeWriter(NetLanguageDescriptor language)
 {
     Language = language;
 }
 public DesignerCodeReader(ILiteExtensionHost extensionHost, NetLanguageDescriptor language)
 {
     _extensionHost = extensionHost;
     Language = language;
 }