Question: Sometimes I encounter cases where I have to attach a method to a delegate but the signature doesn't match, like trying to attach abc down there to somedelegate with the string parameter being "hi".

```
public class test
{
   //...
   public void abc(int i, string x)
   {
      //Do Something
   }
   //...
}
public class test2
{
   somedelegate x;
   //...
   public test2()
   {
      //Do Something
      test y = new test();
      x += y.abc(,"hi");
   }
   delegate void somedelegate(int i);
}

```

I can work it around by creating another delegate with the correct signature then attaching it but it seems so unnecessarily complex. Can you do something like this in C#? Thanks.

EDIT: I guess there closest to what I wanted to achieve is:

```
x += (int i) => abc(i, "hi");

```

Answer: 
Bringing this question up to date by providing this answer.

`appdmg` is a simple, easy-to-use, open-source command line program that creates dmg-files from a simple json specification. Take a look at the readme at the official website:

<https://github.com/LinusU/node-appdmg>

Quick example:

1. Install appdmg

```
npm install -g appdmg

```
2. Write a json file (`spec.json`)

```
{
  "title": "Test Title",
  "background": "background.png",
  "icon-size": 80,
  "contents": [
    { "x": 192, "y": 344, "type": "file", "path": "TestApp.app" },
    { "x": 448, "y": 344, "type": "link", "path": "/Applications" }
  ]
}

```
3. Run program

```
appdmg spec.json test.dmg

```

(disclaimer. I'm the creator of appdmg)
It's fairly easy - the basic idea is that you create a blank image using **Disk Utility** (make it big enough to at least hold your stuff - exact size doesn't matter), open that image using **Finder**, put your stuff in and arrange it the way you want it (use right-click and **Show View Options** to set things like icon size or background image). That's almost it - all that remains is to convert that r/w image into a compressed image: eject it and use *Convert* in **Disk Utility** to convert it into a compressed image.