Author Topic: ApplicationServices.Application VS ApplicationServices.Core.Application  (Read 702 times)

0 Members and 1 Guest are viewing this topic.

kdub

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 1509
  • class keyThumper<T>:ILazy<T>
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 ??

called Kerry in my other life

Sometimes the question is more important than the answer.

I don't really work crazy hours . . I just live at UTC + 13.00
#ridesober

gile

  • Water Moccasin
  • Posts: 2406
  • Marseille, France
Re: ApplicationServices.Application VS ApplicationServices.Core.Application
« Reply #1 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;
Speaking English as a French Frog

kdub

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 1509
  • class keyThumper<T>:ILazy<T>
Re: ApplicationServices.Application VS ApplicationServices.Core.Application
« Reply #2 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.
called Kerry in my other life

Sometimes the question is more important than the answer.

I don't really work crazy hours . . I just live at UTC + 13.00
#ridesober

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 7486
  • AKA Daniel
Re: ApplicationServices.Application VS ApplicationServices.Core.Application
« Reply #3 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
« Last Edit: November 20, 2022, 03:13:20 AM by It's Alive! »
Retired

n.yuan

  • Bull Frog
  • Posts: 333
Re: ApplicationServices.Application VS ApplicationServices.Core.Application
« Reply #4 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.



kdub

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 1509
  • class keyThumper<T>:ILazy<T>
Re: ApplicationServices.Application VS ApplicationServices.Core.Application
« Reply #5 on: November 20, 2022, 03:10:27 PM »
Thanks Norman, I'll keep that in mind.

Regards,
called Kerry in my other life

Sometimes the question is more important than the answer.

I don't really work crazy hours . . I just live at UTC + 13.00
#ridesober