void Interop.IElementNamespaceFactoryCallback.Resolve(string namespaceName, string tagName, string attributes, Interop.IElementNamespace pNamespace) { namespaceName = namespaceName.ToLower(); if (this._registeredNamespaces.Contains(namespaceName)) { if (this._referenceManager == null) { IServiceProvider serviceProvider = this._editor.ServiceProvider; this._referenceManager = (IWebFormReferenceManager) serviceProvider.GetService(typeof(IWebFormReferenceManager)); } if (this._referenceManager != null) { Type objectType = this._referenceManager.GetObjectType(namespaceName, tagName); if (objectType != null) { int lFlags = 0; PersistChildrenAttribute attribute = (PersistChildrenAttribute) TypeDescriptor.GetAttributes(objectType)[typeof(PersistChildrenAttribute)]; if (!attribute.Persist || (objectType == typeof(UserControl))) { lFlags |= 2; } pNamespace.AddTag(tagName, lFlags); } } } }
public static Element GetWrapper(Interop.IHTMLElement element, HtmlControl owner) { Type type; Element element2; string str = element.GetTagName().ToLower(); if (!str.Equals("input")) { type = (Type) wrapperTable[str]; } else { object[] pvars = new object[1]; element.GetAttribute("type", 1, pvars); string str2 = pvars[0].ToString().ToLower(); if (str2.Equals("button")) { type = (Type) wrapperTable["inputbutton"]; } else { type = (Type) wrapperTable[str2]; } } if (type != null) { element2 = (Element) type.GetConstructor(BindingFlags.NonPublic | BindingFlags.Instance, null, new Type[] { typeof(Interop.IHTMLElement) }, null).Invoke(new object[] { element }); } else { element2 = new Element(element); } element2.Owner = owner; return element2; }
protected override object CreateElementWrapper(Interop.IHTMLElement element) { object[] pvars = new object[1]; element.GetAttribute("RuntimeComponent", 1, pvars); object obj2 = pvars[0]; if ((obj2 != null) && !(obj2 is DBNull)) { return obj2; } return base.CreateElementWrapper(element); }
public int ActivateMe(Interop.IOleDocumentView pViewToActivate) { if (pViewToActivate == null) { return -2147024809; } Interop.COMRECT rect = new Interop.COMRECT(); Interop.GetClientRect(this.hostControl.Handle, rect); this.tridentView = pViewToActivate; this.tridentView.SetInPlaceSite(this); this.tridentView.UIActivate(1); this.tridentView.SetRect(rect); this.tridentView.Show(1); return 0; }
public int Do(Interop.IOleUndoManager undoManager) { try { for (int i = 0; i < this._numUndos; i++) { this._undoUnits[i].Do(undoManager); } } catch (Exception exception) { MessageBox.Show(exception.ToString(), "Exception in Do"); } return 0; }
Interop.IElementBehavior Interop.IElementBehaviorFactory.FindBehavior(string bstrBehavior, string bstrBehaviorUrl, Interop.IElementBehaviorSite pSite) { Behavior behavior = null; if (this._referenceManager != null) { string scopeName = ((Interop.IHTMLElement2) pSite.GetElement()).GetScopeName(); string typeName = bstrBehavior; this._referenceManager.GetObjectType(scopeName, typeName); } if (behavior == null) { behavior = new Behavior(this._editor); } return behavior; }
int Interop.IInternetProtocol.Start(string szUrl, Interop.IInternetProtocolSink protocolSink, IntPtr bindInfo, int grfPI, int dwReserved) { string str = szUrl; int index = str.IndexOf(":"); this._realUrl = str.Substring(index + 1, (str.Length - index) - 1); string s = (string) HtmlControl.UrlMap[this._realUrl]; if (s.Length == 0) { s = "<html><head></head><body></body></html>"; } this._data = ProtocolHandler.ContentEncoding.GetBytes(s); this._index = 0; this._length = this._data.Length; int grfBSCF = 13; protocolSink.ReportData(grfBSCF, (uint) this._length, (uint) this._length); return 0; }
void Interop.IHTMLPainter.GetPainterInfo(Interop.HTML_PAINTER_INFO htmlPainterInfo) { htmlPainterInfo.lFlags = 2; htmlPainterInfo.lZOrder = 4; htmlPainterInfo.iidDrawObject = Guid.Empty; htmlPainterInfo.rcBounds.left = 0; htmlPainterInfo.rcBounds.top = 0; htmlPainterInfo.rcBounds.right = 0; htmlPainterInfo.rcBounds.bottom = 0; }
public int TranslateAccelerator(Interop.COMMSG msg, ref Guid group, int nCmdID) { return 1; }
public bool TranslateAccelarator(Interop.COMMSG msg) { return ((this.activeObject != null) && (this.activeObject.TranslateAccelerator(msg) != 1)); }
public int ShowContextMenu(int dwID, Interop.POINT pt, object pcmdtReserved, object pdispReserved) { ShowContextMenuEventArgs e = new ShowContextMenuEventArgs(this.hostControl.PointToClient(new Point(pt.x, pt.y)), false); try { this.hostControl.OnShowContextMenu(e); } catch { } return 0; }
public void SetActiveObject(Interop.IOleInPlaceActiveObject pActiveObject, string pszObjName) { this.activeObject = pActiveObject; }
public void GetBorder(Interop.COMRECT lprectBorder) { throw new COMException(string.Empty, -2147467263); }
public int FilterDataObject(Interop.IOleDataObject pDO, out Interop.IOleDataObject ppDORet) { ppDORet = null; return -2147467263; }
internal FormElement(Interop.IHTMLElement peer) : base(peer) { }
public int ResizeBorder(Interop.COMRECT rect, Interop.IOleInPlaceUIWindow doc, bool fFrameWindow) { return -2147467263; }
public int Scroll(Interop.tagSIZE scrollExtant) { return -2147467263; }
public int GetContainer(out Interop.IOleContainer ppContainer) { ppContainer = this; return 0; }
public void SetBorderSpace(Interop.COMRECT pborderwidths) { throw new COMException(string.Empty, -2147467263); }
public int GetDropTarget(Interop.IOleDropTarget pDropTarget, out Interop.IOleDropTarget ppDropTarget) { if (this._dropTarget == null) { HtmlEditor hostControl = this.hostControl as HtmlEditor; if (hostControl != null) { DataObjectConverter dataObjectConverter = hostControl.DataObjectConverter; if (dataObjectConverter != null) { this._dropTarget = new DropTarget(hostControl, dataObjectConverter, pDropTarget); } } } ppDropTarget = this._dropTarget; if (this._dropTarget != null) { return 0; } return -2147467263; }
public int ShowUI(int dwID, Interop.IOleInPlaceActiveObject activeObject, Interop.IOleCommandTarget commandTarget, Interop.IOleInPlaceFrame frame, Interop.IOleInPlaceUIWindow doc) { return 0; }
public int GetHostInfo(Interop.DOCHOSTUIINFO info) { info.dwDoubleClick = 0; int num = 0; if (this.hostControl.AllowInPlaceNavigation) { num |= 0x10000; } if (!this.hostControl.Border3d) { num |= 4; } if (!this.hostControl.ScriptEnabled) { num |= 0x10; } if (!this.hostControl.ScrollBarsEnabled) { num |= 8; } if (this.hostControl.FlatScrollBars) { num |= 0x80; } if (this.hostControl.EnableTheming) { num |= 0x40000; } else { num |= 0x80000; } info.dwFlags = num; return 0; }
public int TranslateAccelerator(Interop.COMMSG lpmsg, short wID) { return 1; }
public void GetWindowContext(out Interop.IOleInPlaceFrame ppFrame, out Interop.IOleInPlaceUIWindow ppDoc, Interop.COMRECT lprcPosRect, Interop.COMRECT lprcClipRect, Interop.tagOIFI lpFrameInfo) { ppFrame = this; ppDoc = null; Interop.GetClientRect(this.hostControl.Handle, lprcPosRect); Interop.GetClientRect(this.hostControl.Handle, lprcClipRect); lpFrameInfo.cb = Marshal.SizeOf(typeof(Interop.tagOIFI)); lpFrameInfo.fMDIApp = 0; lpFrameInfo.hwndFrame = this.hostControl.Handle; lpFrameInfo.hAccel = Interop.NullIntPtr; lpFrameInfo.cAccelEntries = 0; }
public DropTarget(HtmlControl owner, DataObjectConverter converter, Interop.IOleDropTarget originalDropTarget) { this._owner = owner; this._converter = converter; this._originalDropTarget = originalDropTarget; }
public void InsertMenus(IntPtr hmenuShared, Interop.tagOleMenuGroupWidths lpMenuWidths) { throw new COMException(string.Empty, -2147467263); }
void Interop.IHTMLEditHost.SnapRect(Interop.IHTMLElement pElement, Interop.COMRECT rcNew, int nHandle) { if (this._snapEnabled) { switch (nHandle) { case 0: { int num = rcNew.right - rcNew.left; int num2 = rcNew.bottom - rcNew.top; rcNew.top = ((rcNew.top + this._halfGridSize) / this._gridSize) * this._gridSize; rcNew.left = ((rcNew.left + this._halfGridSize) / this._gridSize) * this._gridSize; rcNew.bottom = rcNew.top + num2; rcNew.right = rcNew.left + num; return; } case 1: rcNew.top = ((rcNew.top + this._halfGridSize) / this._gridSize) * this._gridSize; return; case 2: rcNew.left = ((rcNew.left + this._halfGridSize) / this._gridSize) * this._gridSize; return; case 3: rcNew.bottom = ((rcNew.bottom + this._halfGridSize) / this._gridSize) * this._gridSize; return; case 4: rcNew.right = ((rcNew.right + this._halfGridSize) / this._gridSize) * this._gridSize; return; case 5: rcNew.top = ((rcNew.top + this._halfGridSize) / this._gridSize) * this._gridSize; rcNew.left = ((rcNew.left + this._halfGridSize) / this._gridSize) * this._gridSize; return; case 6: rcNew.top = ((rcNew.top + this._halfGridSize) / this._gridSize) * this._gridSize; rcNew.right = ((rcNew.right + this._halfGridSize) / this._gridSize) * this._gridSize; return; case 7: rcNew.bottom = ((rcNew.bottom + this._halfGridSize) / this._gridSize) * this._gridSize; rcNew.left = ((rcNew.left + this._halfGridSize) / this._gridSize) * this._gridSize; return; case 8: rcNew.bottom = ((rcNew.bottom + this._halfGridSize) / this._gridSize) * this._gridSize; rcNew.right = ((rcNew.right + this._halfGridSize) / this._gridSize) * this._gridSize; return; } } }
public void OnDataChange(Interop.FORMATETC pFormat, Interop.STGMEDIUM pStg) { }
void Interop.IElementBehavior.Init(Interop.IElementBehaviorSite pBehaviorSite) { this.behaviorSite = pBehaviorSite; this.paintSite = (Interop.IHTMLPaintSite) this.behaviorSite; }
public int OnPosRectChange(Interop.COMRECT lprcPosRect) { return 0; }