1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- using System;
- using System.IO;
- namespace CassiniDev
- {
-
-
-
-
-
-
-
-
-
- public class LocalContentLocator : IContentLocator
- {
- #region IContentLocator Members
- public string LocateContent()
- {
- var path = Environment.CurrentDirectory;
- while (!Directory.Exists(Path.Combine(path + "", "web")) &&
- !Directory.Exists(Path.Combine(path + "", @"deploy\web")))
- {
- path = Path.GetDirectoryName(path);
- }
- if (Directory.Exists(Path.Combine(path + "", "web")))
- {
- path = Path.Combine(path + "", "web");
- }
- else if (Directory.Exists(Path.Combine(path + "", @"deploy\web")))
- {
- path = Path.Combine(path + "", @"deploy\web");
- }
- else
- {
- throw new Exception("could not find content");
- }
- return path;
- }
- #endregion
- }
- }
|