@ -31,7 +31,7 @@ namespace ICSharpCode.SharpDevelop.Gui
readonly static string viewContentPath = "/SharpDevelop/Workbench/Pads" ;
readonly static string viewContentPath = "/SharpDevelop/Workbench/Pads" ;
List < PadDescriptor > padViewContentCollection = new List < PadDescriptor > ( ) ;
List < PadDescriptor > padViewContentCollection = new List < PadDescriptor > ( ) ;
List < IViewContent > v iewContentCollection = new List < IViewContent > ( ) ;
List < IViewContent > primaryV iewContentCollection = new List < IViewContent > ( ) ;
bool isActiveWindow ; // Gets whether SharpDevelop is the active application in Windows
bool isActiveWindow ; // Gets whether SharpDevelop is the active application in Windows
@ -113,17 +113,26 @@ namespace ICSharpCode.SharpDevelop.Gui
public IList < IWorkbenchWindow > WorkbenchWindowCollection {
public IList < IWorkbenchWindow > WorkbenchWindowCollection {
get {
get {
return v iewContentCollection. Select ( vc = > vc . WorkbenchWindow )
return primaryV iewContentCollection. Select ( vc = > vc . WorkbenchWindow )
. Distinct ( ) . ToArray ( ) . AsReadOnly ( ) ;
. Distinct ( ) . ToArray ( ) . AsReadOnly ( ) ;
}
}
}
}
public ICollection < IViewContent > ViewContentCollection {
public ICollection < IViewContent > PrimaryViewContents {
get {
get {
// return Linq.ToArray(Linq.Concat(Linq.Select<IWorkbenchWindow, IEnumerable<IViewContent>>(
// return Linq.ToArray(Linq.Concat(Linq.Select<IWorkbenchWindow, IEnumerable<IViewContent>>(
// workbenchWindowCollection, delegate (IWorkbenchWindow w) { return w.ViewContents; }
// workbenchWindowCollection, delegate (IWorkbenchWindow w) { return w.ViewContents; }
// )));
// )));
return viewContentCollection . AsReadOnly ( ) ;
return primaryViewContentCollection . AsReadOnly ( ) ;
}
}
public ICollection < IViewContent > ViewContentCollection {
get {
ICollection < IViewContent > primaryContents = PrimaryViewContents ;
List < IViewContent > contents = new List < IViewContent > ( primaryContents ) ;
contents . AddRange ( primaryContents . SelectMany ( vc = > vc . SecondaryViewContents ) ) ;
return contents . AsReadOnly ( ) ;
}
}
}
}
@ -292,8 +301,8 @@ namespace ICSharpCode.SharpDevelop.Gui
if ( PropertyService . Get ( "SharpDevelop.LoadDocumentProperties" , true ) & & content is IMementoCapable ) {
if ( PropertyService . Get ( "SharpDevelop.LoadDocumentProperties" , true ) & & content is IMementoCapable ) {
StoreMemento ( content ) ;
StoreMemento ( content ) ;
}
}
if ( v iewContentCollection. Contains ( content ) ) {
if ( primaryV iewContentCollection. Contains ( content ) ) {
v iewContentCollection. Remove ( content ) ;
primaryV iewContentCollection. Remove ( content ) ;
}
}
OnViewClosed ( new ViewContentEventArgs ( content ) ) ;
OnViewClosed ( new ViewContentEventArgs ( content ) ) ;
content . Dispose ( ) ;
content . Dispose ( ) ;
@ -316,7 +325,7 @@ namespace ICSharpCode.SharpDevelop.Gui
public void ShowView ( IViewContent content )
public void ShowView ( IViewContent content )
{
{
System . Diagnostics . Debug . Assert ( layout ! = null ) ;
System . Diagnostics . Debug . Assert ( layout ! = null ) ;
v iewContentCollection. Add ( content ) ;
primaryV iewContentCollection. Add ( content ) ;
if ( PropertyService . Get ( "SharpDevelop.LoadDocumentProperties" , true ) & & content is IMementoCapable ) {
if ( PropertyService . Get ( "SharpDevelop.LoadDocumentProperties" , true ) & & content is IMementoCapable ) {
try {
try {
Properties memento = GetStoredMemento ( content ) ;
Properties memento = GetStoredMemento ( content ) ;