Exemplo n.º 1
0
 internal void OnBehaviorDetach()
 {
     if (_eventSink != null)
     {
         _eventSink.Disconnect();
         _eventSink = null;
     }
     _element      = null;
     _viewElement  = null;
     _behaviorSite = null;
     //_editor = null;
 }
Exemplo n.º 2
0
 void Interop.IElementBehavior.Init(Interop.IElementBehaviorSite pBehaviorSite)
 {
     this.behaviorSite = pBehaviorSite;
     this.paintSite = (Interop.IHTMLPaintSite) this.behaviorSite;
 }
Exemplo n.º 3
0
 void Interop.IElementBehavior.Detach()
 {
     this.paintSite = null;
     this.behaviorSite = null;
 }
Exemplo n.º 4
0
    void Interop.IElementBehavior.Init(Interop.IElementBehaviorSite site)
    {
        Dictionary <string, int> dictionary1;
        string text2;
        string text3;
        string text4;
        int    num1;

        this.behaviorSite = site;
        if (4 == 0)
        {
            goto Label_01AE;
        }
        this.attachedElement = (Interop.IHTMLElement2)site.GetElement();
        this.paintSite       = (Interop.IHTMLPaintSite) this.behaviorSite;
        IConnectionPointContainer container1 = (IConnectionPointContainer)this.attachedElement;
        Guid   guid1 = Guid.Empty;
        string text1 = container1.GetType().Name;

        if (text1.EndsWith("Class"))
        {
            text2 = container1.GetType().Name.Substring(0, text1.Length - 5) + "Events2";
            if (text1 == "HTMLInputElementClass")
            {
                goto Label_03D4;
            }
            if ((((uint)num1) + ((uint)num1)) <= uint.MaxValue)
            {
                goto Label_022E;
            }
            if ((((uint)num1) <= uint.MaxValue) && ((((uint)num1) | uint.MaxValue) == 0))
            {
                goto Label_012B;
            }
            goto Label_024A;
        }
        return;

Label_00D9:
        if ((0 == 0) && ((((uint)num1) & 0) == 0))
        {
            goto Label_0107;
        }
Label_00DC:
        //if (<PrivateImplementationDetails>{FDFC6380-7665-4920-BE96-D8D7777662F6}.$$method0x6000139-1.TryGetValue(text4, out num1))
        {
            switch (num1)
            {
            case 0:
                text2 = "HTMLInputTextElementEvents2";
                if (4 != 0)
                {
                    if ((((uint)num1) - ((uint)num1)) >= 0)
                    {
                    }
                    goto Label_0107;
                }
                if (0 == 0)
                {
                    goto Label_02C9;
                }
                if (-2147483648 != 0)
                {
                    goto Label_03D4;
                }
                goto Label_0360;

            case 1:
                text2 = "HTMLOptionButtonElementEvents2";
                goto Label_0107;

            case 2:
                text2 = "HTMLButtonElementEvents2";
                goto Label_0107;

            case 3:
                goto Label_02C9;

            case 4:
                text2 = "HTMLElementEvents2";
                goto Label_0107;

            case 5:
                throw new NotImplementedException("dunno correct class");

            case 6:
                text2 = "HTMLInputTextElementEvents2";
                goto Label_0107;
            }
        }
Label_0107:
        text3 = "mshtml." + text2 + ", Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a";
        if (((((uint)num1) + ((uint)num1)) <= uint.MaxValue) && ((((uint)num1) + ((uint)num1)) < 0))
        {
            goto Label_016C;
        }
        Type type1 = Type.GetType(text3);

        try
        {
            guid1 = type1.GUID;
            container1.FindConnectionPoint(ref guid1, out this.x09a9fe7720941e5b);
            this.x09a9fe7720941e5b.Advise(this.myEvents, out this.xc151a99213d76447);
            this.myEvents.ElementEvent += new ElementEventHandler(this.eventHandler);
        }
        catch
        {
            MessageBox.Show("Could not attach events for " + ((Interop.IHTMLElement) this.attachedElement).outerHTML);
        }
        return;

Label_011E:
        if (text1 == "HTMLDivElementClass")
        {
            goto Label_016C;
        }
Label_012B:
        if (text1 != "HTMLSpanElementClass")
        {
            goto Label_0107;
        }
        text2 = "HTMLElementEvents2";
        goto Label_00D9;
Label_016C:
        text2 = "HTMLElementEvents2";
        goto Label_0107;
Label_0177:
        if (text1 == "HTMLAnchorElementClass")
        {
            text2 = "HTMLAnchorEvents2";
            if (((uint)num1) >= 0)
            {
                goto Label_0107;
            }
            if ((((uint)num1) - ((uint)num1)) < 0)
            {
                goto Label_00D9;
            }
            if ((((uint)num1) | 1) != 0)
            {
                goto Label_01AE;
            }
            goto Label_022E;
        }
        if ((((uint)num1) + ((uint)num1)) > uint.MaxValue)
        {
            if (0 != 0)
            {
                goto Label_0177;
            }
            goto Label_011E;
        }
        if (((uint)num1) <= uint.MaxValue)
        {
            goto Label_011E;
        }
        goto Label_016C;
Label_01AE:
        if ((((uint)num1) | 15) == 0)
        {
            goto Label_022E;
        }
        if (0xff != 0)
        {
            goto Label_0177;
        }
Label_01CD:
        if ((((uint)num1) & 0) != 0)
        {
            goto Label_01AE;
        }
        goto Label_0177;
Label_022E:
        if (text1 != "HTMLGenericElementClass")
        {
            if (-1 != 0)
            {
                goto Label_01CD;
            }
            goto Label_0107;
        }
Label_024A:
        text2 = "HTMLElementEvents2";
        goto Label_0107;
Label_02C9:
        text2 = "HTMLElementEvents2";
        goto Label_0107;
Label_0360:
        dictionary1 = new Dictionary <string, int>(7);
        dictionary1.Add("text", 0);
        dictionary1.Add("option", 1);
        dictionary1.Add("button", 2);
        dictionary1.Add("submit", 3);
        dictionary1.Add("radio", 4);
        dictionary1.Add("image", 5);
        dictionary1.Add("hidden", 6);
        //<PrivateImplementationDetails>{FDFC6380-7665-4920-BE96-D8D7777662F6}.$$method0x6000139-1 = dictionary1;
        goto Label_00DC;
Label_03D4:
        if ((text4 = ((HTMLInputElementClass)container1).type) == null)
        {
            goto Label_0107;
        }
        //if (<PrivateImplementationDetails>{FDFC6380-7665-4920-BE96-D8D7777662F6}.$$method0x6000139-1 == null)
        {
            goto Label_0360;
        }
        goto Label_00DC;
    }
Exemplo n.º 5
0
 Interop.IElementBehavior Interop.IElementBehaviorFactory.FindBehavior(string xf97dfec4f6339176, string xe88e5ca6e9a3f0d2, Interop.IElementBehaviorSite xef78be42e0560c9f)
 {
     return(this);
 }
Exemplo n.º 6
0
 private void OnBehaviorInit(Interop.IElementBehaviorSite behaviorSite)
 {
     this._behaviorSite = behaviorSite;
     this._paintSite = (Interop.IHTMLPaintSite) this._behaviorSite;
     this._element = this._behaviorSite.GetElement();
     behaviorSite.RegisterNotification(0);
     behaviorSite.RegisterNotification(3);
     behaviorSite.RegisterNotification(4);
     this._eventSink = new EventSink(this);
 }
Exemplo n.º 7
0
 private void OnBehaviorDetach()
 {
     if (this._designer != null)
     {
         this._designer.Behavior = null;
         this._designer = null;
     }
     if (this._eventSink != null)
     {
         this._eventSink.Disconnect();
         this._eventSink = null;
     }
     this._element = null;
     this._viewElement = null;
     this._paintSite = null;
     this._behaviorSite = null;
     this._editor = null;
 }
Exemplo n.º 8
0
 internal void OnBehaviorInit(Interop.IElementBehaviorSite behaviorSite)
 {
     _behaviorSite = behaviorSite;
 }
 /// <summary>
 /// Ctor
 /// </summary>
 /// <param name="t"></param>
 /// <param name="site"></param>
 public BehaviorNotifyEventArgs(BehaviorNotifyType t, Interop.IElementBehaviorSite site)
 {
     this.site = site;
     this.type = t;
 }
Exemplo n.º 10
0
        /// <summary>
        /// this version supports global (per namespace) designers only, for &lt;asp:hyperlink> it is "asp" bstrBehavior contains the
        /// element name, for &lt;asp:hyperlink> it is "hyperlink".
        /// </summary>
        /// <param name="bstrBehavior"></param>
        /// <param name="bstrBehaviorUrl"></param>
        /// <param name="pSite"></param>
        /// <returns></returns>
        Interop.IElementBehavior Interop.IElementBehaviorFactory.FindBehavior(string bstrBehavior, string bstrBehaviorUrl, Interop.IElementBehaviorSite pSite)
        {
            if (saving)
            {
                return(null);
            }
            Interop.IHTMLElement element = pSite.GetElement();
            if (!IsRenderable(element))
            {
                return(null);
            }
            string tagPrefix = ((Interop.IHTMLElement2)element).GetScopeName();

            if (!_registeredBehaviors.ContainsKey(tagPrefix))
            {
                return(null);
            }
            if (_registeredBehaviors[tagPrefix] == null)
            {
                return(null);
            }
            IBaseBehavior o = Activator.CreateInstance(_registeredBehaviors[tagPrefix], _editor) as IBaseBehavior;

            _behaviorInstances.Add(element, o); // just for cleaning up
            string f = String.Concat(tagPrefix, ":", element.GetTagName());

            if (((GuruComponents.Netrix.ElementFactory)((HtmlEditor)this._editor).GenericElementFactory).IsRegistered(f))
            {
                return((IBaseBehavior)o);
            }
            else
            {
                return(null);
            }
        }