상속: IDisposable
예제 #1
0
        public void outlineViewDoubleAction(Cocoa.Object sender)
        {
            BrowserItem bi = outlineView.SelectedItem as BrowserItem;

            try {
                if (bi.node.URL != null)
                {
                    Node   n;
                    string content = "";
                    if (bi.node.tree != null && bi.node.tree.HelpSource != null)
                    {
                        content = bi.node.tree.HelpSource.GetText(bi.node.URL, out n);
                    }
                    if (content == null || content.Equals(""))
                    {
                        content = help_tree.RenderUrl(bi.node.URL, out n);
                    }
                    content = content.Replace("a href='", "a href='http://monodoc/load?");
                    content = content.Replace("a href=\"", "a href=\"http://monodoc/load?");
                    webView.Render(content);
                    addHistoryItem(bi.node.URL);

                    outlineView.ExpandItem(bi);
                }
            } catch (Exception e) { Console.WriteLine("ERROR: " + e); }
        }
        public URLRequest RequestHandler(WebView sender, Cocoa.Object identifier, URLRequest initialRequest, URLResponse urlResponse, WebDataSource datasource)
        {
//		if ( ((URL)(initialRequest.urL)).relativeString.ToString().IndexOf("http://monodoc/load?") == 0) {
            // FIXME
            if (initialRequest.URL.AbsoluteString.IndexOf("http://monodoc/load?") == 0)
            {
                string url     = initialRequest.URL.AbsoluteString.Replace("http://monodoc/load?", "");
                string content = "";
                if (url.StartsWith("edit:"))
                {
//				XmlNode edit_node = EditingUtils.GetNodeFromUrl (url, help_tree);
//				Console.WriteLine (edit_node.InnerXml);
                }

                Node n;
                try {
                    content = help_tree.RenderUrl(url, out n);
                } catch (Exception e) {
                    content = "Exception Rendering the requested URL: " + e;
                }
                if (content != null && !content.Equals(""))
                {
                    content = content.Replace("a href='", "a href='http://monodoc/load?");
                    content = content.Replace("a href=\"", "a href=\"http://monodoc/load?");
                    webView.Render(content);
                    addHistoryItem(url);
                }
                return(null);
            }
            return(initialRequest);
        }
예제 #3
0
        public void ViewTick(Cocoa.Object sender)
        {
            xrotate += 1.0f; if (xrotate > 350.0f)
            {
                xrotate = 0.0f;
            }
            yrotate += 1.0f; if (yrotate > 350.0f)
            {
                yrotate = 0.0f;
            }
            zrotate += 1.0f; if (zrotate > 350.0f)
            {
                zrotate = 0.0f;
            }
            zoom += zoomdelta; if (zoom > 4.9f)
            {
                zoomdelta = -0.1f;
            }
            if (zoom < 0.2f)
            {
                zoomdelta = 0.1f;
            }
#if RECTANGLE
            color1 = SetColor();
            color2 = SetColor();
            color3 = SetColor();
            color4 = SetColor();
#endif
            Draw(viewFrame);
        }
        public int OutlineViewNumberOfChildrenOfItem(OutlineView outlineView, Cocoa.Object item)
        {
            BrowserItem bi    = item as BrowserItem;
            int         count = bi != null ? bi.Count : help_tree.Nodes.Count;

            return(count);
        }
예제 #5
0
 public void EndTimer(Cocoa.Object sender)
 {
     if (timer != null)
     {
         timer.Stop();
         timer = null;
     }
 }
        public bool validateMenuItem(Cocoa.Object sender)
        {
            MenuItem item = (MenuItem)sender;

//		if (item.Action.Equals("goBack:")) return webView.canGoBack;
//		if (item.Action.Equals("goForward:")) return webView.canGoForward;
            return(true);
        }
예제 #7
0
 public void StartTimer(Cocoa.Object sender)
 {
     if (timer == null)
     {
         timer          = new Timer();
         timer.Interval = 0.0;                 //0.025;
         timer.Tick    += new ActionHandler(itsView.ViewTick);
         timer.Start();
     }
 }
        public void goForward(Cocoa.Object sender)
        {
            WebBackForwardList history = webView.BackForwardList;

            if (history.ForwardListCount > 0)
            {
                history.GoForward();
                loadHistoryItem(history.CurrentItem);
            }
        }
        public void UserDidSearch(Cocoa.Object sender)
        {
            string value = searchBox.Value;
            int    index = indexBrowser.SelectedRowInColumn(0);

            if (value != null)
            {
                Console.WriteLine("Searching for {0}", value);
                index = IndexDataSource.FindClosest(value);
            }
            indexBrowser.SelectRowInColumn(index, 0);
        }
예제 #10
0
        public void browserDoubleAction(Cocoa.Object sender)
        {
            IndexEntry entry = IndexDataSource.GetEntry(indexBrowser.SelectedRowInColumn(0));

            if (entry != null)
            {
                Topic  t = entry[0];
                Node   match;
                string content = help_tree.RenderUrl(t.Url, out match);
                content = content.Replace("a href='", "a href='http://monodoc/load?");
                content = content.Replace("a href=\"", "a href=\"http://monodoc/load?");
                webView.Render(content);
                addHistoryItem(t.Url);
            }
        }
예제 #11
0
        public void BeginSheet(string directory, string filename, Cocoa.Window docWindow, SavePanelHandler modalDelegate, System.IntPtr contextInfo)
        {
            if (modalDelegate == null)
            {
                throw new ArgumentNullException("modalDelegate");
            }
            Cocoa.Object target   = (Cocoa.Object)modalDelegate.Target;
            MethodInfo   method   = modalDelegate.Method;
            string       selector = method.Name;

            foreach (ExportAttribute export_attribute in Attribute.GetCustomAttributes(method, typeof(ExportAttribute)))
            {
                if (export_attribute.Selector != null)
                {
                    selector = export_attribute.Selector;
                }
            }
            ObjCMessaging.objc_msgSend(NativeObject, "beginSheetForDirectory:file:modalForWindow:modalDelegate:didEndSelector:contextInfo:", typeof(void), typeof(System.IntPtr), (directory == null) ? IntPtr.Zero : new Cocoa.String(directory).NativeObject, typeof(System.IntPtr), (filename == null) ? IntPtr.Zero : new Cocoa.String(filename).NativeObject, typeof(System.IntPtr), (docWindow == null) ? IntPtr.Zero : docWindow.NativeObject, typeof(System.IntPtr), target.NativeObject, typeof(System.IntPtr), ObjCMethods.sel_getUid(selector), typeof(System.IntPtr), contextInfo);
        }
예제 #12
0
 public void TimerTick(Cocoa.Object sender)
 {
     Console.WriteLine("Timer tick");
     RunLoop.Current.Stop();
 }
예제 #13
0
 public void ExpandItem(Cocoa.Object item)
 {
     ObjCMessaging.objc_msgSend(NativeObject, "expandItem:", typeof(void), typeof(IntPtr), item.NativeObject);
 }
예제 #14
0
 public void OrderFront(Cocoa.Object aSender)
 {
     ObjCMessaging.objc_msgSend(NativeObject, "orderFront:", typeof(void), typeof(IntPtr), aSender.NativeObject);
 }
        public Cocoa.Object OutlineViewObjectValueForTableColumnByItem(OutlineView outlineView, TableColumn tableColumn, Cocoa.Object item)
        {
            BrowserItem bi = item as BrowserItem;

            return(bi == null ? null : bi.ValueAt(tableColumn.Identifier));
        }
        public BrowserItem OutlineViewChildOfItem(OutlineView outlineView, int index, Cocoa.Object item)
        {
            BrowserItem bi = item as BrowserItem;

            if (bi != null)
            {
                bi = bi.ItemAt(index);
            }
            else
            {
                bi = (BrowserItem)items[index];
            }
            return(bi);
        }
예제 #17
0
 public void InterfaceChanged(Cocoa.Object sender)
 {
     itsView.Display();
 }
예제 #18
0
 public TableColumn(Cocoa.Object identifier) : base()
 {
     NativeObject = (IntPtr)ObjCMessaging.objc_msgSend(NativeObject, "initWithIdentifier:", typeof(IntPtr), typeof(IntPtr), identifier.NativeObject);
 }
 public bool OutlineViewIsItemExpandable(OutlineView outlineView, Cocoa.Object item)
 {
     return(OutlineViewNumberOfChildrenOfItem(outlineView, item) > 0);
 }
예제 #20
0
 public void buttonClick(Cocoa.Object sender)
 {
     textBox1.Value = "Button Pushed";
 }
예제 #21
0
 protected void SubscribeToCocoaDelegate(Cocoa.Object aTarget)
 {
     ObjCMessaging.objc_msgSend(NativeObject, "setDelegate:", typeof(void), typeof(System.IntPtr), aTarget.NativeObject);
 }