Skip to content

VisioScripting dead-method removal (Phase A) #183

Description

@saveenr

Phase A of the cleanup deferred from #156's pre-lock work. Deliberately scheduled to CY27 per the project's "improve before audience-reducing changes" guiding principle (method deletion is technically audience-reducing even when the audience is empty, and any post-lock consumer of VisioScripting.Client deserves a deprecation cycle rather than a hard removal).

Background

The hybrid-public-API decision in #156 committed the documented VisioScripting.Client facade as a public-stable contract. The pre-decision usage audit found ~36 public methods on the *Commands classes with zero external callers (no cmdlet, no test, no sample, no doc snippet). They are part of the locked surface as of the #156 cleanup issue, but candidates for removal in CY27 with proper deprecation.

Scope

Dead methods, by class

Confirmed by the #156 usage audit. Counts are conservative — overload-vs-name disambiguation is fuzzy in spots; revisit before deletion to confirm zero-caller.

  • ApplicationCommands: AssertHasApplication
  • ArrangeCommands: Send, DistributeVertical
  • ConnectionCommands: GetTransitiveClosureOnActivePage
  • CustomPropertyCommands: GetCustomProperties (the bare-list form; GetCustomPropertiesAsShapeDictionary is the one used)
  • DeveloperCommands: DrawNamespaces(IList<Type>), DrawNamespacesAndClasses(IList<Type>), GetInteropEnums, GetInteropEnum, GetEnum. (GetTypes is intra-class only; can also be made internal.)
  • DocumentCommands: ActivateDocumentWithName, GetDocumentWithName, NewDocumentFromTemplate(Size, string) overload
  • DrawCommands: Duplicate
  • GroupingCommands: Ungroup(TargetSelection) overload
  • OutputCommands: WriteUser, WriteDebug, WriteWarning, WriteError. (Only WriteVerbose is consumed.)
  • PageCommands: SetActivePage(TargetDocument, PageRelativePosition) overload, both SetPageSize overloads (one is called intra-namespace from NewPage — keep it but mark internal on examination)
  • SelectionCommands: SubSelectShapes, SelectShapesByMaster, SelectShapesByLayer, GetSelectedShapes(TargetSelection) overload, GetShapesRecursive, GetShapeCount, GetSubSelectedShapes, CopySelectedShapes, ContainsShapes(TargetSelection, int) overload (most over-built class — 9 of 20 dead)
  • TextCommands: GetShapeTextFormat
  • UserDefinedCellCommands: GetUserDefinedCells, ContainsUserDefinedCellsWithName
  • ViewCommands: GetActiveWindow, GetZoom

Dead classes (delete-the-class candidates)

  • LayerCommands (FindLayersOnPageByName, GetLayersOnPage). Entire class is reached only from SelectionCommands.SelectShapesByLayer, which is itself dead. Delete both the class and the Client.Layer property if external usage is still nil at deletion time.

File-name cleanup

  • Rename Commands/ContainerrCommands.csCommands/ContainerCommands.cs (file name has a typo; class name is correct). Trivial git mv. Could be done before CY27 as a non-audience-affecting change if convenient — file name is not part of the public API.

Process

  • Re-run a usage scan immediately before deletion to catch anything that consumed these methods between #156 and this issue (gitbook samples, sibling repos, downstream forks).
  • If the surface is documented by #131 at the time of this work, decide whether to do a deprecation release ([Obsolete("Will be removed in...")] for one minor cycle) or a clean Major bump. Probably the former — VisioAutomation2010 is at 3.x and a 4.0 bump for cleanup feels heavy.
  • Update NuGet/CHANGELOG.md with full removal list.

Out of scope

  • The boundary-leak fix and enforcement layer — handled in the pre-lock cleanup issue (CY26Q3) referenced from #156.
  • The decision on the #156 open sub-question (mark dead methods as "candidate for CY27 removal" in their gitbook pages, or document them as fully stable). That decision shapes the deprecation messaging at this stage.

References

  • #156 closing comment (decision + audit findings)
  • The pre-lock cleanup issue (CY26Q3) handles Phases B + C; this issue is Phase A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions