TheSwamp

Code Red => .NET => Topic started by: kdub_nz on November 19, 2022, 05:11:59 PM

Title: ApplicationServices.Application VS ApplicationServices.Core.Application
Post by: kdub_nz on November 19, 2022, 05:11:59 PM
Going through some of my older code :
I'm finding I have various Alias declarations for AcadApp :-

Code - C#: [Select]
  1. using AcadApp = Autodesk.AutoCAD.ApplicationServices.Core.Application;
and
Code - C#: [Select]
  1. using AcadApp = Autodesk.AutoCAD.ApplicationServices.Application;

I have a preference for the  ApplicationServices.Core.Application simply because it's the base class for ApplicationServices.Application
. . . but I'm wondering if it really makes a difference either way.

Has anyone done any research on this, or have a reasoned opinion ??

Title: Re: ApplicationServices.Application VS ApplicationServices.Core.Application
Post by: gile on November 20, 2022, 02:24:39 AM
Hi,

I would tend to use :
Code - C#: [Select]
  1. using AcAp = Autodesk.AutoCAD.ApplicationServices.Application;
because the Autodesk.AutoCAD.ApplicationServices.Core.Application class does not expose some methods I commonly use such as ShowModal.Dialog which warrants an alias to avoid confusion with System.Windows.Forms.Application.
I don't think using ApplicationServices.Application where one could use ApplicationServices.Core.Application has any real impact on code execution.

But we can also use two aliases:
Code - C#: [Select]
  1. using AcAp = Autodesk.AutoCAD.ApplicationServices.Application;
  2. using AcCoreAp = Autodesk.AutoCAD.ApplicationServices.Core.Application;
Title: Re: ApplicationServices.Application VS ApplicationServices.Core.Application
Post by: kdub_nz on November 20, 2022, 02:38:14 AM
Hi Gilles,
Sitting outside in the sunshine this afternoon I decided to go not us the Core.Application.
As you say, I too think the impact either way will be minimal.

I'll save my worrying for important things.
Title: Re: ApplicationServices.Application VS ApplicationServices.Core.Application
Post by: It's Alive! on November 20, 2022, 03:09:20 AM
I concur
I also dropped coding this morning to go out in the sunshine. Went to Singapore’s botanic garden
Title: Re: ApplicationServices.Application VS ApplicationServices.Core.Application
Post by: n.yuan on November 20, 2022, 09:17:19 AM
Well, if you write code that is generally intent to be shared by possible core console/Forge (now, called Platform), you may want to make sure you only use ...Core.Application, because you do not use acmgd.dll in plugins for core console/Forge.


Title: Re: ApplicationServices.Application VS ApplicationServices.Core.Application
Post by: kdub_nz on November 20, 2022, 03:10:27 PM
Thanks Norman, I'll keep that in mind.

Regards,