Visio Guy

Visio Discussions => Programming & Code => Topic started by: Visisthebest on January 27, 2022, 11:52:12 AM

Title: Using Tuples in a Visio Add-in
Post by: Visisthebest on January 27, 2022, 11:52:12 AM
I currently use structs or objects but I see that from .NET Framework 4.7 Tuples are also supported for returning multiple values from functions.

https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/data-types/tuples

Is it wise to use Tuples, I did read VB.NET Tuples aren't really completely immutable, or might this give issues on Visio installations, I have no clear picture of which .NET Framework versions are used on Office on most machines.

How does a Visio add-in mingle with another add-in that uses another .Net Framework 3.5 or 4.x version, do the add-in developers have some idea about best practices in this regard. (I don't aim for 100% but supporting 90% of actively used PC's out there would be nice). Thank you for sharing your insights!
Title: Re: Using Tuples in a Visio Add-in
Post by: Paul Herber on January 27, 2022, 12:23:48 PM
I see no reason why tuples shouldn't be used with your .NET code, but the Visio API hasn't changed as far as I know so your Visio interfacing won't change.
Title: Re: Using Tuples in a Visio Add-in
Post by: Visisthebest on January 27, 2022, 12:59:07 PM
Thank you Paul, more specifically my concern is if other Visio add-ins use an older version of .NET Framework and my add-in uses 4.7+ only, could this cause issues with the add-ins running on the same PC?
Title: Re: Using Tuples in a Visio Add-in
Post by: Paul Herber on January 27, 2022, 01:22:46 PM
I don't think that matters, you could have n programs/add-ins running all specifying different .NET versions, it all sorts itself out.
Title: Re: Using Tuples in a Visio Add-in
Post by: Nikolay on January 27, 2022, 03:43:18 PM
From what I know, your application either will run properly, or will not start at all if the installed version of the .NET runtime is not suitable.
So, there is no point in worrying about tuples specifically, IMHO.