Eventually, I need to post a bunch of stuff I've learned while working on my current project but I still have some nagging deployment questions. My project has some custom built Icons. I can specify the icons in my proxy file like this:
[ActivityImageAttribute("c:\\...\\project path\\myCustomIcon.ico", true)]
So far, no problem. However, on deployment, this path might not (most likely will not) be the same. I tried to tackle the problem like this:
[ActivityImageAttribute(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "myCustomIcon.ico"), true)]
The compiler doesn't like this because:
An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type
Am I stuck with a fixed path? Maybe not... one of the Arguments for the ActivityImageAttribute is a string value for the resourceId. I can add a resource to my project, call it "myCustomIcon", make it public, and rewrite my attribute like this:
[ActivityImageAttribute("myCustomIcon")]
Now, I get the following error:
'Laserfiche.Custom.Activities.Design.ActivityImageAttribute.ActivityImageAttribute(string)' is inaccessible due to its protection level
I'm hoping that I just didn't make something public that needs to be public or that I'm just using the wrong ID. I don't use resource files often so it is likely I'm messing this up.
It is also odd that when I type "ActivityImageAttribute(", four overloads show up including the resourceId overload. As soon as I type anything else, the overloads drop to three and the resourceId overload is gone.
Any ideas on how to implement this? I'm open to other workarounds as well.