Esempio n. 1
0
		public AppDelegate ()
		{
			PrepareCache ();
			ExtractImages ();
			controller = new MonodocDocumentController ();
			
			// Some UI feature we use rely on Lion, so special case it
			try {
				var version = new NSDictionary ("/System/Library/CoreServices/SystemVersion.plist");
				isOnLion = version.ObjectForKey (new NSString ("ProductVersion")).ToString ().StartsWith ("10.7");
			} catch {}
			
			// Load documentation
			Root = RootTree.LoadTree (null);
			
			var macDocPath = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "macdoc");
			if (!Directory.Exists (macDocPath))
				Directory.CreateDirectory (macDocPath);
			IndexUpdateManager = new IndexUpdateManager (Root.HelpSources.Cast<HelpSource> ().Select (hs => Path.Combine (hs.BaseFilePath, hs.Name + ".zip")).Where (File.Exists),
			                                             macDocPath);
			BookmarkManager = new BookmarkManager (macDocPath);
			AppleDocHandler = new AppleDocHandler ("/Library/Frameworks/Mono.framework/Versions/Current/etc/");
			
			// Configure the documentation rendering.
			SettingsHandler.Settings.EnableEditing = false;
			SettingsHandler.Settings.preferred_font_size = 200;
			HelpSource.use_css = true;
		}
Esempio n. 2
0
        public AppDelegate()
        {
            PrepareCache();
            ExtractImages();
            controller = new MonodocDocumentController();

            // Some UI feature we use rely on Lion or better, so special case it
            try {
                var version    = new NSDictionary("/System/Library/CoreServices/SystemVersion.plist");
                var osxVersion = Version.Parse(version.ObjectForKey(new NSString("ProductVersion")).ToString());
                isOnLion = osxVersion.Major == 10 && osxVersion.Minor >= 7;
            } catch {}

            // Load documentation
            var args = Environment.GetCommandLineArgs();
            IEnumerable <string> extraDocs = null, extraUncompiledDocs = null;

            if (args != null && args.Length > 1)
            {
                var extraDirs = args.Skip(1);
                extraDocs = extraDirs
                            .Where(d => d.StartsWith("+"))
                            .Select(d => d.Substring(1))
                            .Where(d => Directory.Exists(d));
                extraUncompiledDocs = extraDirs
                                      .Where(d => d.StartsWith("@"))
                                      .Select(d => d.Substring(1))
                                      .Where(d => Directory.Exists(d));
            }

            if (extraUncompiledDocs != null)
            {
                foreach (var dir in extraUncompiledDocs)
                {
                    RootTree.AddUncompiledSource(dir);
                }
            }

            if (ConfigurationManager.AppSettings == null)
            {
                Logger.Log("Setting default settings because ConfigurationManager.AppSettings is null");
                var keyValueConfigurationCollection = new KeyValueConfigurationCollection();
                keyValueConfigurationCollection.Add("docPath", "/Library/Frameworks/Mono.framework/Versions/Current/lib/monodoc/");
                keyValueConfigurationCollection.Add("docExternalPath", "");
                typeof(Config).GetField("exeConfig", BindingFlags.NonPublic | BindingFlags.Static).SetValue(null, keyValueConfigurationCollection);
                Lucene.Net.Support.AppSettings.Set("java.version", "");
                Lucene.Net.Support.AppSettings.Set("java.vendor", "");
            }

            Root = RootTree.LoadTree();

            if (extraDocs != null)
            {
                foreach (var dir in extraDocs)
                {
                    Root.AddSource(dir);
                }
            }

            var macDocPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "macdoc");

            if (!Directory.Exists(macDocPath))
            {
                Directory.CreateDirectory(macDocPath);
            }
            var helpSources = Root.HelpSources
                              .Cast <HelpSource> ()
                              .Where(hs => !string.IsNullOrEmpty(hs.BaseFilePath) && !string.IsNullOrEmpty(hs.Name))
                              .Select(hs => Path.Combine(hs.BaseFilePath, hs.Name + ".zip"))
                              .Where(File.Exists);

            IndexUpdateManager = new IndexUpdateManager(helpSources,
                                                        macDocPath);
            BookmarkManager = new BookmarkManager(macDocPath);
        }
        public AppDelegate()
        {
            PrepareCache();
            ExtractImages();
            controller = new MonodocDocumentController();

            // Some UI feature we use rely on Lion, so special case it
            try
            {
                var version = new NSDictionary("/System/Library/CoreServices/SystemVersion.plist");
                isOnLion = version.ObjectForKey(new NSString("ProductVersion")).ToString().StartsWith("10.7");
            }
            catch {}

            // Load documentation
            var args = Environment.GetCommandLineArgs();
            IEnumerable <string> extraDocs = null, extraUncompiledDocs = null;

            if (args != null && args.Length > 1)
            {
                var extraDirs = args.Skip(1);
                extraDocs = extraDirs
                            .Where(d => d.StartsWith("+"))
                            .Select(d => d.Substring(1))
                            .Where(d => Directory.Exists(d));
                extraUncompiledDocs = extraDirs
                                      .Where(d => d.StartsWith("@"))
                                      .Select(d => d.Substring(1))
                                      .Where(d => Directory.Exists(d));
            }

            if (extraUncompiledDocs != null)
            {
                foreach (var dir in extraUncompiledDocs)
                {
                    RootTree.UncompiledHelpSources.Add(dir);
                }
            }

            Root = RootTree.LoadTree(null);

            if (extraDocs != null)
            {
                foreach (var dir in extraDocs)
                {
                    Root.AddSource(dir);
                }
            }

            var macDocPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "macdoc");

            if (!Directory.Exists(macDocPath))
            {
                Directory.CreateDirectory(macDocPath);
            }
            var helpSources = Root.HelpSources
                              .Cast <HelpSource> ()
                              .Where(hs => !string.IsNullOrEmpty(hs.BaseFilePath) && !string.IsNullOrEmpty(hs.Name))
                              .Select(hs => Path.Combine(hs.BaseFilePath, hs.Name + ".zip"))
                              .Where(File.Exists);

            IndexUpdateManager = new IndexUpdateManager(helpSources,
                                                        macDocPath);
            BookmarkManager = new BookmarkManager(macDocPath);
            AppleDocHandler = new AppleDocHandler("/Library/Frameworks/Mono.framework/Versions/Current/etc/");

            // Configure the documentation rendering.
            SettingsHandler.Settings.EnableEditing       = false;
            SettingsHandler.Settings.preferred_font_size = 200;
            HelpSource.use_css = true;
        }
Esempio n. 4
0
		public AppDelegate ()
		{
			PrepareCache ();
			ExtractImages ();
			controller = new MonodocDocumentController ();
			
			// Some UI feature we use rely on Lion or better, so special case it
			try {
				var version = new NSDictionary ("/System/Library/CoreServices/SystemVersion.plist");
				var osxVersion = Version.Parse (version.ObjectForKey (new NSString ("ProductVersion")).ToString ());
				isOnLion = osxVersion.Major == 10 && osxVersion.Minor >= 7;
			} catch {}
			
			// Load documentation
			var args = Environment.GetCommandLineArgs ();
			IEnumerable<string> extraDocs = null, extraUncompiledDocs = null;
			if (args != null && args.Length > 1) {
				var extraDirs = args.Skip (1);
				extraDocs = extraDirs
					.Where (d => d.StartsWith ("+"))
					.Select (d => d.Substring (1))
					.Where (d => Directory.Exists (d));
				extraUncompiledDocs = extraDirs
					.Where (d => d.StartsWith ("@"))
					.Select (d => d.Substring (1))
					.Where (d => Directory.Exists (d));
			}

			if (extraUncompiledDocs != null)
				foreach (var dir in extraUncompiledDocs)
					RootTree.UncompiledHelpSources.Add (dir);

			Root = RootTree.LoadTree (null);

			if (extraDocs != null)
				foreach (var dir in extraDocs)
					Root.AddSource (dir);
			
			var macDocPath = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData), "macdoc");
			if (!Directory.Exists (macDocPath))
				Directory.CreateDirectory (macDocPath);
			var helpSources = Root.HelpSources
				.Cast<HelpSource> ()
				.Where (hs => !string.IsNullOrEmpty (hs.BaseFilePath) && !string.IsNullOrEmpty (hs.Name))
				.Select (hs => Path.Combine (hs.BaseFilePath, hs.Name + ".zip"))
				.Where (File.Exists);
			IndexUpdateManager = new IndexUpdateManager (helpSources,
			                                             macDocPath);
			BookmarkManager = new BookmarkManager (macDocPath);
			AppleDocHandler = new AppleDocHandler ("/Library/Frameworks/Mono.framework/Versions/Current/etc/");
			
			// Configure the documentation rendering.
			SettingsHandler.Settings.EnableEditing = false;
			SettingsHandler.Settings.preferred_font_size = 200;
			HelpSource.use_css = true;
		}
Esempio n. 5
0
        public AppDelegate()
        {
            PrepareCache();
            ExtractImages();
            controller = new MonodocDocumentController();

            // Some UI feature we use rely on Lion or better, so special case it
            try {
                var version    = new NSDictionary("/System/Library/CoreServices/SystemVersion.plist");
                var osxVersion = Version.Parse(version.ObjectForKey(new NSString("ProductVersion")).ToString());
                isOnLion = osxVersion.Major == 10 && osxVersion.Minor >= 7;
            } catch {}

            // Load documentation
            var args = Environment.GetCommandLineArgs();
            IEnumerable <string> extraDocs = null, extraUncompiledDocs = null;

            if (args != null && args.Length > 1)
            {
                var extraDirs = args.Skip(1);
                extraDocs = extraDirs
                            .Where(d => d.StartsWith("+"))
                            .Select(d => d.Substring(1))
                            .Where(d => Directory.Exists(d));
                extraUncompiledDocs = extraDirs
                                      .Where(d => d.StartsWith("@"))
                                      .Select(d => d.Substring(1))
                                      .Where(d => Directory.Exists(d));
            }

            if (extraUncompiledDocs != null)
            {
                foreach (var dir in extraUncompiledDocs)
                {
                    RootTree.AddUncompiledSource(dir);
                }
            }

            Root = RootTree.LoadTree();

            if (extraDocs != null)
            {
                foreach (var dir in extraDocs)
                {
                    Root.AddSource(dir);
                }
            }

            var macDocPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "macdoc");

            if (!Directory.Exists(macDocPath))
            {
                Directory.CreateDirectory(macDocPath);
            }
            var helpSources = Root.HelpSources
                              .Cast <HelpSource> ()
                              .Where(hs => !string.IsNullOrEmpty(hs.BaseFilePath) && !string.IsNullOrEmpty(hs.Name))
                              .Select(hs => Path.Combine(hs.BaseFilePath, hs.Name + ".zip"))
                              .Where(File.Exists);

            IndexUpdateManager = new IndexUpdateManager(helpSources,
                                                        macDocPath);
            BookmarkManager = new BookmarkManager(macDocPath);
        }