示例#1
0
 private void EnsureRelationships()
 {
     // once per package
     if (_relationships == null)
     {
         _relationships = new InternalRelationshipCollection(this);
     }
 }
示例#2
0
 private void EnsureRelationships()
 {
     if (this._relationships == null)
     {
         this.ThrowIfRelationship();
         this._relationships = new InternalRelationshipCollection(this);
     }
 }
 //------------------------------------------------------
 //
 //  Internal Events
 //
 //------------------------------------------------------
 // None
 //------------------------------------------------------
 //
 //  Private Methods
 //
 //------------------------------------------------------
 #region Private Methods
 
 // lazy init
 private void EnsureRelationships()
 {
    if (_relationships  == null)
     {
         // check here
         ThrowIfRelationship();
         
         // obtain the relationships from the PackageRelationship part (if available)
         _relationships = new InternalRelationshipCollection(this);
     }
 }
示例#4
0
 internal void Close()
 {
     if (!this._disposed)
     {
         try
         {
             if (this._requestedStreams != null)
             {
                 if (!this._deleted)
                 {
                     foreach (Stream stream in this._requestedStreams)
                     {
                         stream.Close();
                     }
                 }
                 this._requestedStreams.Clear();
             }
             else if (this._container.InStreamingCreation)
             {
                 this.GetStream(FileMode.CreateNew, this._container.FileOpenAccess).Close();
             }
         }
         finally
         {
             this._requestedStreams = null;
             this._relationships = null;
             this._container = null;
             this._disposed = true;
         }
     }
 }