상속: ISymbolReader
예제 #1
0
 public SymInfoEnumerator(SymReader reader)
 {
     // This version enumerates over all of the data blocks.
     this.reader = reader;
     this.token  = 0;
     this.start  = 0;
     if (reader != null)
     {
         this.num = reader.numIndexEntries;
     }
     else
     {
         this.num = 0;
     }
     this.index = -1;
 }
예제 #2
0
	internal SymMethod(SymReader reader, int token)
			{
				this.reader = reader;
				this.token = token;
			}
예제 #3
0
 internal SymMethod(SymReader reader, int token)
 {
     this.reader = reader;
     this.token  = token;
 }
예제 #4
0
 internal SymDocument(SymReader reader, String language, String url)
 {
     this.reader   = reader;
     this.language = language;
     this.url      = url;
 }
예제 #5
0
        // Get a reader for the the file
        public ISymbolReader GetReader(
            int importer, 
            string filename,
            string searchPath)
        {

            IntPtr Reader;

            // Demand the permission to access unmanaged code. We do this since we are casting an int to a COM interface, and
            // this can be used improperly.
            (new SecurityPermission(SecurityPermissionFlag.UnmanagedCode)).Demand();

            int hr;
            COMException Exception;

            hr = SymBinder_GetReaderForFile(m_Binder, importer, filename, searchPath, out Reader);
            if (hr < 0)
            {
                Exception = new COMException("Call to GetReaderForFile failed.", hr);
                throw Exception;
            }

            SymReader SymbolReader = new SymReader(Reader);
            return SymbolReader;
        }
예제 #6
0
	internal SymDocument(SymReader reader, String language, String url)
			{
				this.reader = reader;
				this.language = language;
				this.url = url;
			}
예제 #7
0
        public SymInfoEnumerator(SymReader reader, int token)
        {
            // Save the reader and token information for later.
            this.reader = reader;
            this.token  = token;
            this.index  = -1;
            if (reader == null || reader.data == null)
            {
                // There is no symbol information to be processed.
                this.start = 0;
                this.num   = 0;
                return;
            }

            // Locate the token information in the symbol data.
            int left = 0;
            int right = reader.numIndexEntries - 1;
            int middle, temp;

            while (left <= right)
            {
                middle = left + (right - left) / 2;
                temp   = Utils.ReadInt32
                             (reader.data, reader.indexOffset + middle * 8);
                if (((uint)temp) < ((uint)token))
                {
                    left = middle + 1;
                }
                else if (((uint)temp) > ((uint)token))
                {
                    right = middle - 1;
                }
                else
                {
                    // We've found an entry: search forwards and
                    // backwards to find the extent of the token.
                    left = middle;
                    while (left > 0)
                    {
                        temp = Utils.ReadInt32
                                   (reader.data,
                                   reader.indexOffset + (left - 1) * 8);
                        if (temp == token)
                        {
                            --left;
                        }
                        else
                        {
                            break;
                        }
                    }
                    right = middle;
                    while (right < (reader.numIndexEntries - 1))
                    {
                        temp = Utils.ReadInt32
                                   (reader.data,
                                   reader.indexOffset + (right + 1) * 8);
                        if (temp == token)
                        {
                            ++right;
                        }
                        else
                        {
                            break;
                        }
                    }
                    this.start = left;
                    this.num   = right - left + 1;
                    return;
                }
            }

            // We were unable to find the token data.
            this.start = 0;
            this.num   = 0;
        }
예제 #8
0
 // Constructors.
 public SymInfoEnumerator(SymReader reader, String name)
     : this(reader, Utils.CreatePseudoToken(name))
 {
 }
	public SymInfoEnumerator(SymReader reader, int token)
			{
				// Save the reader and token information for later.
				this.reader = reader;
				this.token = token;
				this.index = -1;
				if(reader == null || reader.data == null)
				{
					// There is no symbol information to be processed.
					this.start = 0;
					this.num = 0;
					return;
				}

				// Locate the token information in the symbol data.
				int left = 0;
				int right = reader.numIndexEntries - 1;
				int middle, temp;
				while(left <= right)
				{
					middle = left + (right - left) / 2;
					temp = Utils.ReadInt32
						(reader.data, reader.indexOffset + middle * 8);
					if(((uint)temp) < ((uint)token))
					{
						left = middle + 1;
					}
					else if(((uint)temp) > ((uint)token))
					{
						right = middle - 1;
					}
					else
					{
						// We've found an entry: search forwards and
						// backwards to find the extent of the token.
						left = middle;
						while(left > 0)
						{
							temp = Utils.ReadInt32
								(reader.data,
								 reader.indexOffset + (left - 1) * 8);
							if(temp == token)
							{
								--left;
							}
							else
							{
								break;
							}
						}
						right = middle;
						while(right < (reader.numIndexEntries - 1))
						{
							temp = Utils.ReadInt32
								(reader.data,
								 reader.indexOffset + (right + 1) * 8);
							if(temp == token)
							{
								++right;
							}
							else
							{
								break;
							}
						}
						this.start = left;
						this.num = right - left + 1;
						return;
					}
				}

				// We were unable to find the token data.
				this.start = 0;
				this.num = 0;
			}
	// Constructors.
	public SymInfoEnumerator(SymReader reader, String name)
			: this(reader, Utils.CreatePseudoToken(name)) {}
	public SymInfoEnumerator(SymReader reader)
			{
				// This version enumerates over all of the data blocks.
				this.reader = reader;
				this.token = 0;
				this.start = 0;
				if(reader != null)
				{
					this.num = reader.numIndexEntries;
				}
				else
				{
					this.num = 0;
				}
				this.index = -1;
			}