internal StreamInfoCore CoreForChildStream( string streamName )
    {
        CheckDisposedStatus();
        
        object childElement = core.elementInfoCores[ streamName ];

        if( null != childElement &&
            null == childElement as StreamInfoCore )
        {
            // Name is already in use, but not as a StreamInfo
            throw new InvalidOperationException(
                SR.Get(SRID.NameAlreadyInUse, streamName ));
        }
        else if( null == childElement )
        {
            // No such element with the name exist - create one.
            // 

            // Check to see if there is a data space mapping on this guy
            DataSpaceManager manager = Root.GetDataSpaceManager();
            if( null != manager )
            {
                // Have data space manager - retrieve data space label for 
                //  the child stream.  The data space manager will return 
                //  null if there isn't a data space associated with this
                //  stream.
                childElement = new StreamInfoCore( 
                    streamName,
                    manager.DataSpaceOf( 
                        new CompoundFileStreamReference( FullNameInternal, streamName ) ) );
            }
            else
            {
                // Data space manager not yet initialized - correct behavior
                //  is that nothing transformed should be required at this
                //  point but in case of incorrect behavior we can not possibly
                //  recover.  User gets un-transformed data instead.
                childElement = new StreamInfoCore( streamName, null, null );
            }
            core.elementInfoCores[ streamName ] = childElement;
        }

        Debug.Assert( null != childElement as StreamInfoCore,
            "We should have already checked to make sure childElement is either StreamInfoCore, created as one, or thrown an exception if neither is possible");

        return childElement as StreamInfoCore;
    }
Esempio n. 2
0
        /***********************************************************************/
        // Constructors

        private void BuildStreamInfoRelativeToStorage(StorageInfo parent, string path)
        {
            parentStorage = parent;
            core          = parentStorage.CoreForChildStream(path);
        }
Esempio n. 3
0
        /***********************************************************************/
        // Constructors

        private void BuildStreamInfoRelativeToStorage( StorageInfo parent, string path )
        {
            parentStorage = parent;
            core = parentStorage.CoreForChildStream( path );
        }