System.Collections.Generic.List.Remove(WorkbookPage)

Here are the examples of the csharp api System.Collections.Generic.List.Remove(WorkbookPage) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

19 Source : WorkbookPackage.cs
with MIT License
from microsoft

public void RemovePage (WorkbookPage workbookPage)
        {
            if (workbookPage == null)
                throw new ArgumentNullException (nameof (workbookPage));

            workbookPage.PropertyChanged -= WorkbookPage_PropertyChanged;

            pages.Remove (workbookPage);

            if (pages.Count == 0) {
                PlatformTargets = ImmutableArray<AgentType>.Empty;
            } else {
                PlatformTargets = pages [0].PlatformTargets;

                if (pages.Count > 1) {
                    var intersection = new HashSet<AgentType> (PlatformTargets);
                    foreach (var page in pages.Skip (1))
                        intersection.IntersectWith (page.PlatformTargets);

                    PlatformTargets = intersection.ToImmutableArray ();
                }
            }
        }