public BookmarkDataSource (IList<BookmarkManager.Entry> entries, BookmarkManager manager)
			{
				this.entries = entries;
				this.manager = manager;
			}
		public BookmarkPopoverController (NSPopover popover, BookmarkManager.Entry entry) : base ("BookmarkPopover", NSBundle.MainBundle)
		{
			this.parentPopover = popover;
			this.entry = entry;
			Initialize ();
		}
Beispiel #3
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
            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;
        }
 public BookmarkDataSource(IList <BookmarkManager.Entry> entries, BookmarkManager manager)
 {
     this.entries = entries;
     this.manager = manager;
 }
Beispiel #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);
        }