logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

New Topic Post Reply
Options
Go to last post Go to first unread
cjansen  
#1 Posted : Thursday, August 9, 2018 10:45:52 AM(UTC)
Quote
cjansen

Rank: Newbie

Groups: Registered
Joined: 7/25/2018(UTC)
Posts: 7
Canada
Location: Sherwood Park, Alberta

Thanks: 1 times
Just wondering if I've finally gone slightly mad or has the ability to extend classes been locked out?

private constructors?

I'm trying something like

Code:
public class MyPdfField: Patagames.Pdf.Net.PdfField, IPdfField
{ }


but getting errors about not have a parameterless constructor, no constructor at all when I check, and the runtime isn't creating a public parameterless constructor so... I'm thinking there's a private constructor.

yes?
Paul Rayman  
#2 Posted : Friday, August 10, 2018 4:21:57 AM(UTC)
Quote
Paul Rayman

Rank: Administration

Groups: Administrators
Joined: 1/5/2016(UTC)
Posts: 1,138

Thanks: 10 times
Was thanked: 133 time(s) in 130 post(s)
Yes you are right.
Some classes have a constructor with an Internal access modifier.
Basically, this is done in order to prevent the creation of an object by the user, when such an object requires special tuning.

Edited by user Friday, August 10, 2018 4:25:17 AM(UTC)  | Reason: Not specified

cjansen  
#3 Posted : Friday, August 10, 2018 7:58:36 AM(UTC)
Quote
cjansen

Rank: Newbie

Groups: Registered
Joined: 7/25/2018(UTC)
Posts: 7
Canada
Location: Sherwood Park, Alberta

Thanks: 1 times
rats.

Extension methods to the rescue! haha
Quick Reply Show Quick Reply
Users browsing this topic
Guest
New Topic Post Reply
Forum Jump  
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.