Does a types accessibility depend on the file it's contained in?
<p>If I declare an interface, or a type as private in one file, is it private to that file or the namespace?</p>

<p>The compiler generates an error for File2: 'Error 14 Inconsistent accessibility: parameter type 'DIDemo1.IImageRepository' is less accessible than method 'DIDemo1.ImageGetter.ImageGetter(DIDemo1.IImageRepository)'</p>

<p>What I don't understand is that MyClass can use the interface but ImageGetter class cannot.</p>

<p>File1:</p>

<pre><code>namespace DIDemo1 {

    interface IImageRepository {

        Image[] GetImages();
    }

    public class MyClass : IImageRepository {

        #region IImageRepository Members

        public Image[] GetImages() {
            return new Image[] { };
        }

        #endregion
    }
}
</code></pre>

<p>File2:</p>

<pre><code>namespace DIDemo1 {

    public class ImageGetter {

        IImageRepository _repo;

        public ImageGetter(IImageRepository repository) {
            _repo = repository;
        }

        public Image[] GetImages() {

            return _repo.GetImages();
        }
    }
}
</code></pre>
