Exemplo n.º 1
0
        public override void Add(DbgEntity aEntity)
        {
            SymSourceProvider provider = null;

            //
            if (aEntity.FSEntity.IsFile)
            {
                if (aEntity.Exists && aEntity.FSEntity.IsValid)
                {
                    provider = ProvisioningManager.GetProvider(aEntity.FSEntity.FullName);
                }
                //
                if (provider != null)
                {
                    using (SymSourceCollection sources = provider.CreateSources(aEntity.FullName))
                    {
                        // Make sure the time to read attribute is setup in alignment with
                        // whether the entity was explicitly added by the user or found implicitly
                        // by scanning.
                        if (aEntity.WasAddedExplicitly == false)
                        {
                            foreach (SymSource source in sources)
                            {
                                // This means, don't read this source until it is actually
                                // referenced by the client. I.e. until the client activates
                                // a code segment that refers to this
                                source.TimeToRead = SymSource.TTimeToRead.EReadWhenNeeded;
                            }
                        }

                        // Ownership is transferred
                        iSources.AddRange(sources);
                        sources.Clear();
                    }
                }
                else
                {
                    throw new NotSupportedException("Specified file type is not supported");
                }
            }
            else
            {
                throw new ArgumentException("SymbianSymbolLib does not support directory entities");
            }
        }