public IVisio.Page Resolve(VisioScripting.Client client) { if (this.Page == null) { var cmdtarget = client.GetCommandTargetPage(); this.Page = cmdtarget.ActivePage; } if (this.Page == null) { throw new VisioOperationException("Unvalid State No Pages"); } return(this.Page); }
public TargetPage Resolve(VisioScripting.Client client) { if (!this.IsResolved) { var cmdtarget = client.GetCommandTargetPage(); // It doesn't matter if there is an active page or not // at this point it is considered resolved return(new TargetPage(cmdtarget.ActivePage, true)); } else { return(this); } }
public TargetPages Resolve(VisioScripting.Client client) { // Handle the case where the object is already resolved if (this._items != null) { return(this); } // Otherwise perform resolution // Try to use the active page as the default target for the operation var cmdtarget = client.GetCommandTargetPage(); if (cmdtarget.ActivePage == null) { throw new VisioAutomation.Exceptions.InternalAssertionException(); } return(new TargetPages(cmdtarget.ActivePage)); }
public IList <IVisio.Page> Resolve(VisioScripting.Client client) { if (this.Pages == null) { var cmdtarget = client.GetCommandTargetPage(); this.Pages = new List <IVisio.Page> { cmdtarget.ActivePage }; } if (this.Pages == null) { throw new VisioOperationException("Unvalid State No Pages"); } if (this.Pages.Count < 1) { throw new VisioOperationException("Unvalid State No Pages"); } return(this.Pages); }