public static object GetBoundMember(HtmlDocument doc, string name) { HtmlElement result = doc.GetElementById(name); if (result == null) { return OperationFailed.Value; } return result; }
public void Page_Loaded(object o, EventArgs e) { // Required to initialize variables InitializeComponent(); try { document = HtmlPage.Document; _container = FindName("parentCanvas") as Canvas; BindEvents(); AuthorRepository rep = new AuthorRepository(); ItemRepository repItem = new ItemRepository(); ConceptRepository repConcepts = new ConceptRepository(); IList<Person> persons = rep.GetAuthors(); _grid = FindName("grid") as TimeLineGrid; _grid.StopUpdate(); _grid.Width = Width - 30; _grid.Height = Height; _grid.StartYear = _grid.StartViewYear = TimeLineHelper.GetMinYear(persons); _grid.EndYear = _grid.EndViewYear = TimeLineHelper.GetMaxYear(persons); _grid.Persons = persons; List<Book> books = new List<Book>(); List<Seminar> seminars = new List<Seminar>(); foreach (Person person in persons) { _grid.Timemarkers.Add(person.Born.Year); _grid.Timemarkers.Add(person.Dead.Year); books.AddRange(repItem.GetBooks(person.Guid)); seminars.AddRange(repItem.GetSeminars(person.Guid)); } _grid.Books = books; _grid.Seminars = seminars; _grid.Concepts = repConcepts.GetConcepts(); _grid.StartUpdate(); WebApplication.Current.RegisterScriptableObject("basic", this); } catch (Exception ex) { Debug.WriteLine(ex.Message); } }
public MainPage() { InitializeComponent(); UIThread.Dispatcher = Dispatcher; _document = HtmlPage.Document; try { Log("Connecting back to malaria server (" + Hostname + ":" + Port + ")..."); _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); var args = new SocketAsyncEventArgs { RemoteEndPoint = new DnsEndPoint(Hostname, Port, AddressFamily.InterNetwork) }; args.Completed += OnConnected; _socket.ConnectAsync(args); } catch (Exception ex) { Log(ex.Message); } }
public void Page_Loaded(object o, EventArgs e) { // Required to initialize variables //InitializeComponent(); // Register javascript scope. HtmlPage.RegisterScriptableObject("PiePage", this); _htmlDocument = HtmlPage.Document; // Initial properties _chartValue = new Collection<SectorData>(); // Get chart value. GetJSONData(); //GetChartValue(); //InitializeChart(); }
public void UpdateTriggers() { doc = HtmlPage.Document; if (hrefs != null) { foreach (var href in hrefs) { href.DetachEvent("onclick", OnHtmlLinkClick); } } hrefs = from c in doc.GetElementsByTagName("a").Cast<HtmlElement>() where c.GetAttribute("class") != null where c.GetAttribute("class").Contains("silverlight") select c; foreach (HtmlElement el in hrefs) { el.AttachEvent("onclick", OnHtmlLinkClick); } }
void initOptions() { // load the options html into the known iframe src var parent = window.GetProperty("parent") as ScriptObject; var parentDocument = parent.GetProperty("document") as HtmlDocument; var optionsIFrame = parentDocument.GetElementById("options"); optionsIFrame.SetAttribute("src", "Lesson14.html"); optionsIFrame.AttachEvent("onload", delegate(object sender, EventArgs args) { optionsDocument = optionsIFrame.GetProperty("contentDocument") as HtmlDocument; // Resize the options iframe height to the options html height var optionsBody = optionsDocument.GetProperty("body") as HtmlElement; var optionsHeight = optionsBody.GetProperty("scrollHeight"); optionsIFrame.SetAttribute("height", optionsHeight + "px"); }); }
public static void SetMember(HtmlDocument doc, string name, object value) { HtmlElementExtension.SetMember(doc.DocumentElement, name, value); }
public static object GetBoundMember(HtmlDocument doc, string name) { return (object)doc.GetElementById(name) ?? HtmlElementExtension.GetBoundMember(doc.DocumentElement, name); }
public static object GetBoundMember (HtmlDocument doc, string name) { throw new NotImplementedException (); }
private void IntializeHandlersHtml() { if (!_iframeInitialized) { if (_htmlIframeWindow == null && _htmlIframeEditorElement != null) _htmlIframeWindow = _htmlIframeEditorElement.GetProperty("contentWindow") as HtmlWindow; if (_htmlIframeWindow == null || _htmlIframeWindow.GetProperty("IsReady") == null) return; if (_htmlIframeDocument == null) _htmlIframeDocument = _htmlIframeWindow.GetProperty("document") as HtmlDocument; _htmlIframeDocument.AttachEvent("keydown", HandleHtmlKeyDown); if (this.IsBrowserIE) { _htmlIframeWindow.AttachEvent("focus", HandleHtmlFocus); _htmlIframeWindow.AttachEvent("blur", HandleHtmlBlur); } else { _htmlIframeDocument.AttachEvent("focus", HandleHtmlFocus); _htmlIframeDocument.AttachEvent("blur", HandleHtmlBlur); } _iframeInitialized = true; } }
private void RemoveHtml() { RemoveHandlersHtml(); Application.Current.RootVisual.MouseMove -= new MouseEventHandler(RootVisual_MouseMove); //System.Windows.Browser.HtmlPage.Document.Body.RemoveChild(_htmlDivContainerElement); if (_htmlDivContainerElement != null) HtmlContainer.RemoveChild(_htmlDivContainerElement); _htmlAnchorFocusElement = null; _htmlIframeDocument = null; _htmlIframeWindow = null; _htmlIframeEditorElement = null; _htmlDivContainerElement = null; }