public CompilationMethod GetRemoveMethod()
		{
			if (InternalRemoveMethod == null)
			{
				var Remove = Convert.ToInt32(this.Data.Element(CompilationXNames.Remove).Value);

				InternalRemoveMethod = this.DeclaringType.GetMethods().Single(k => k.MetadataToken == Remove);
			}

			return InternalRemoveMethod;
		}
Exemplo n.º 2
0
        public CompilationMethod GetRemoveMethod()
        {
            if (InternalRemoveMethod == null)
            {
                var Remove = Convert.ToInt32(this.Data.Element(CompilationXNames.Remove).Value);

                InternalRemoveMethod = this.DeclaringType.GetMethods().Single(k => k.MetadataToken == Remove);
            }

            return(InternalRemoveMethod);
        }
		public CompilationMethod GetGetMethod()
		{
			if (InternalGetMethod == null)
			{
				var GetElement = this.Data.Element(CompilationXNames.Get);

				if (GetElement != null)
				{
					var Get = Convert.ToInt32(GetElement.Value);

					InternalGetMethod = this.DeclaringType.GetMethods().FirstOrDefault(k => k.MetadataToken == Get);
				}
			}

			return InternalGetMethod;
		}
Exemplo n.º 4
0
        public CompilationMethod GetGetMethod()
        {
            if (InternalGetMethod == null)
            {
                var GetElement = this.Data.Element(CompilationXNames.Get);

                if (GetElement != null)
                {
                    var Get = Convert.ToInt32(GetElement.Value);

                    InternalGetMethod = this.DeclaringType.GetMethods().FirstOrDefault(k => k.MetadataToken == Get);
                }
            }

            return(InternalGetMethod);
        }
        private static void AddTypeMethod(IHTMLDiv parent, CompilationMethod type, Action<string> UpdateLocation)
        {
            if (type == null)
                return;

            var div = new IHTMLDiv().AttachTo(parent);

            div.style.marginTop = "0.1em";
            div.style.fontFamily = ScriptCoreLib.JavaScript.DOM.IStyle.FontFamilyEnum.Verdana;
            div.style.whiteSpace = ScriptCoreLib.JavaScript.DOM.IStyle.WhiteSpaceEnum.nowrap;


            var i = new PublicMethod().AttachTo(div);

            i.style.verticalAlign = "middle";
            i.style.marginRight = "0.5em";

            var w = new StringBuilder();

            w.Append(type.Name);

            w.Append("(");

            type.GetParameters().ForEach(
                (p, pi) =>
                {
                    if (pi > 0)
                        w.Append(", ");

                    w.Append(p.Name);
                }
            );

            w.Append(")");


            var s = new IHTMLAnchor { innerText = w.ToString() }.AttachTo(div);


            s.href = "#";
            s.style.textDecoration = "none";
            s.style.color = JSColor.System.WindowText;

            Action onclick = delegate
            {

            };

            s.onclick +=
                e =>
                {
                    e.PreventDefault();

                    s.focus();

                    UpdateLocation(type.Name);

                    onclick();
                };

            s.onfocus +=
                delegate
                {

                    s.style.backgroundColor = JSColor.System.Highlight;
                    s.style.color = JSColor.System.HighlightText;
                };

            s.onblur +=
                delegate
                {

                    s.style.backgroundColor = JSColor.None;
                    s.style.color = JSColor.System.WindowText;
                };


            onclick =
                delegate
                {
                    //var children = new IHTMLDiv().AttachTo(div);

                    //children.style.paddingLeft = "2em";

                    //a.GetTypes().ForEach(
                    //    (Current, Next) =>
                    //    {
                    //        AddType(GetNamespaceContainer(children, Current), Current, UpdateLocation);

                    //        ScriptCoreLib.Shared.Avalon.Extensions.AvalonSharedExtensions.AtDelay(
                    //            50,
                    //            Next
                    //        );
                    //    }
                    //);


                    var NextClickHide = default(Action);
                    var NextClickShow = default(Action);

                    NextClickHide =
                        delegate
                        {
                            //children.Hide();

                            onclick = NextClickShow;
                        };

                    NextClickShow =
                        delegate
                        {
                            //children.Show();

                            onclick = NextClickHide;
                        };


                    onclick = NextClickHide;
                };
        }