Пример #1
0
        public static System.Func<MyMagnifier> CreateFreezableMagnifier(IHTMLImage i, string zoom_src)
        {
            var x =  new MyMagnifier(i, zoom_src, 180, 4, 6);

            System.Action<IEvent> click =
                (ev) =>
                {
                    x.Enabled = !x.Enabled;
                    x.UpdateTo(ev);
                };

            i.onclick += (ev) => { click(ev); };
            x.Click += (ev) =>{ click(ev); };

            return () => x;
        }
Пример #2
0
        public static System.Func<MyMagnifier> CreateClickableMagnifier(IHTMLImage i, string zoom_src)
        {
            var x = default(MyMagnifier);

            System.Action create =
                () =>
                {
                    x = new MyMagnifier(i, zoom_src, 180, 4, 6);

                    x.Click +=
                         delegate
                         {
                             if (x != null)
                             {
                                 x.Dispose();
                                 x = null;
                             }
                         };
                };


            create();

            i.onclick +=
                (ev) =>
                {
                    if (x == null)
                    {
                        create();
                        x.UpdateTo(ev);
                    }
                };

            return () => x;
        }