public XSharpModelDiscover(XFile file, XSharpParser.SourceContext ctx, IEnumerable <XError> errors)
 {
     // To store intermediate declarations
     this._file    = file;
     this._xSource = ctx;
     this._errors  = errors;
     //
     this._currentTypes   = new Stack <XType>();
     this._currentNSpaces = new Stack <XType>();
     //
     this._options      = file.Project.ProjectNode.ParseOptions;
     this._types        = new Dictionary <string, XType>();
     this._usings       = new List <string>();
     this._staticusings = new List <String>();
     this._globalType   = XType.CreateGlobalType(_file);
     this._classVars    = new List <XTypeMember>();
     _types.Add(_globalType.Name, _globalType);
     if (this._file != null && this._file.Project != null)
     {
         if (this._file.Project.Loaded)       // this will fail if the project file is already unloaded
         {
             if (this._file.Project.ProjectNode.PrefixClassesWithDefaultNamespace)
             {
                 this._defaultNS = this._file.Project.ProjectNode.RootNameSpace;
             }
         }
     }
 }
Beispiel #2
0
 /// <summary>
 /// Reset the TypeList associated with the File, reCreating the GlobalType
 /// </summary>
 public void InitTypeList()
 {
     if (HasCode)
     {
         this._typeList   = new ConcurrentDictionary <string, XType>(StringComparer.InvariantCultureIgnoreCase);
         this._globalType = XType.CreateGlobalType(this);
         this._typeList.TryAdd(_globalType.Name, _globalType);
         _usings       = new List <string>();
         _usingStatics = new List <string>();
     }
 }