示例#1
0
        public void Foo_forwardref()
        {
            var c = new ClosureType();
            c.__this = this;

            Foo_workflow(c);
        }
示例#2
0
 public CircularArc3PointClose(CgmFile container, CgmPoint p1, CgmPoint p2, CgmPoint p3, ClosureType closureType)
     : this(container)
 {
     P1   = p1;
     P2   = p2;
     P3   = p3;
     Type = closureType;
 }
示例#3
0
        public Closure(MondProgram program, int address, Frame arguments, Frame locals)
        {
            Type = ClosureType.Mond;

            Program = program;
            Address = address;
            Arguments = arguments;
            Locals = locals;
        }
示例#4
0
文件: Closure.cs 项目: xserve98/Mond
        public Closure(MondProgram program, int address, Frame arguments, Frame locals)
        {
            Type = ClosureType.Mond;

            Program   = program;
            Address   = address;
            Arguments = arguments;
            Locals    = locals;
        }
示例#5
0
文件: Closure.cs 项目: krixalis/Mond
        public Closure(int programId, int address, Frame arguments, Frame locals)
        {
            Type = ClosureType.Mond;

            ProgramId = programId;
            Address = address;
            Arguments = arguments;
            Locals = locals;
        }
示例#6
0
        static void Foo_workflow(ClosureType e)
        {
            var foo = e.__this.foo;

            foo++;
            ; ;

            e.__this.foo = foo;
        }
示例#7
0
        public override void ReadFromBinary(IBinaryReader reader)
        {
            base.ReadFromBinary(reader);

            var type = reader.ReadEnum();

            if (type == 0)
            {
                Type = ClosureType.PIE;
            }
            else if (type == 1)
            {
                Type = ClosureType.CHORD;
            }
            else
            {
                reader.Unsupported("unsupported closure type " + type);
                Type = ClosureType.CHORD;
            }
        }
示例#8
0
文件: Scope.cs 项目: taekun/lens
        /// <summary>
        /// Creates entities for current scope when it has been left.
        /// </summary>
        public void FinalizeSelf(Context ctx)
        {
            var gen     = ctx.CurrentMethod.Generator;
            var closure = findScope(s => s.ClosureType != null);

            // create entities for variables to be excluded
            foreach (var curr in Locals.Values)
            {
                if (curr.IsConstant && curr.IsImmutable && ctx.Options.UnrollConstants)
                {
                    continue;
                }

                if (curr.IsClosured)
                {
                    curr.ClosureFieldName = ctx.Unique.ClosureFieldName(curr.Name);
                    var field = closure.ClosureType.CreateField(curr.ClosureFieldName, curr.Type);
                    field.Kind = TypeContentsKind.Closure;
                }
                else
                {
                    curr.LocalBuilder = gen.DeclareLocal(curr.Type);
                }
            }

            if (ClosureType != null)
            {
                if (ClosureReferencesOuter)
                {
                    // create "Parent" field in the closure type
                    var parentType = findScope(s => s.ClosureType != null, OuterScope).ClosureType;
                    ClosureType.CreateField(EntityNames.ParentScopeFieldName, parentType.TypeInfo);
                }

                ClosureVariable = ctx.CurrentMethod.Generator.DeclareLocal(ClosureType.TypeInfo);
            }
        }
示例#9
0
        public override void Copy(IDataObject data, ICollection <ModelElement> elements, ClosureType closureType, PointF sourcePosition)
        {
            int i = 5;

            base.Copy(data, elements, closureType, sourcePosition);
        }
示例#10
0
        protected override void AddCustomFormat(IDataObject data, ICollection <ModelElement> elements, ClosureType closureType, PointF sourcePosition)
        {
            int i = 5;

            base.AddCustomFormat(data, elements, closureType, sourcePosition);
        }
        /// <summary>
        /// Create an EGP to add to the clipboard.
        /// Called when the elements to be copied or dragged have been
        /// collected into an ElementGroup and after the roots have been marked.
        /// This override ensures that the shapes and connectors of each element and relationship are included.
        /// </summary>
        /// <param name="elementGroup">Group of elements and maybe shapes</param>
        /// <param name="elements">The original set of elements to be added, not including children, relationships, etc. Typically, the current selection.</param>
        /// <param name="closureType">Copy or Delete - specifies which propagation scheme to follow</param>
        /// <returns>EGP </returns>
        protected override ElementGroupPrototype CreateElementGroupPrototype(ElementGroup elementGroup, ICollection <ModelElement> elements, ClosureType closureType)
        {
            // Get the elements already in the group:
            ModelElement[] mels = elementGroup.ModelElements
                                  .Concat(elementGroup.ElementLinks) // Omit if the paste target is not the diagram.
                                  .ToArray();

            // Get their shapes and connectors:
            IEnumerable <PresentationElement> shapes =
                mels.SelectMany(mel =>
                                PresentationViewsSubject.GetPresentation(mel));

            elementGroup.AddRange(shapes, true);

            return(base.CreateElementGroupPrototype(elementGroup, elements, closureType));
        }
        /// <summary>
        /// Called on copy, cut or drag.
        /// For a copy or cut, the supplied elements are the model elements, and the call comes, via AddGroupFormat, from ClipboardCommands.ProcessOnMenuCopy().
        /// For a drag operation, the elements are the selected shapes and connectors, and the call comes from Diagram.DoDragDrop, if CanMove or CanCopy are true.
        /// In the drag case, we want to add the model elements so that we can do a copy
        /// if the user presses CTRL while dragging.
        ///
        /// See http://msdn.microsoft.com/library/ff521398.aspx
        /// </summary>
        /// <param name="shapeOrModelElements">The shape or model elements being copied - usually the current selection.</param>
        /// <param name="closureType">Copy or Delete</param>
        /// <returns>Group to be stored in the clipboard.</returns>
        protected override ElementGroup CreateElementGroup(ICollection <ModelElement> shapeOrModelElements, ClosureType closureType)
        {
            // CreateElementGroup respects the settings of PropagateCopy.
            // Notice that we have set PropagateCopy on the roles from components to the terminals,
            // so that terminals will always be copied along with their parents.

            // Add the specified group of shapes or elements:
            ElementGroup group = base.CreateElementGroup(shapeOrModelElements, closureType);

            // If this a set of shapes, add their model elements:
            if (shapeOrModelElements.FirstOrDefault() is PresentationElement)
            {
                // Get the model elements of the shapes:
                ICollection <ModelElement> modelElements =
                    shapeOrModelElements.OfType <PresentationElement>()
                    // Filter out shapes such as labels that don't have model elements:
                    .Where(pel => pel.ModelElement != null)
                    .Select(pel => pel.ModelElement).ToList();

                ElementGroup melGroup = base.CreateElementGroup(modelElements, closureType);
                group.AddRange(melGroup.GetElements());
            }

            return(group);

            // 2011-03-21 Thanks to Joeul in VMSDK Forum for a bug fix here.
            // http://social.msdn.microsoft.com/Forums/en-US/dslvsarchx/thread/0b0b16d4-6014-4b35-9e5a-e27ea02e0ee3
        }
示例#13
0
文件: Closure.cs 项目: krixalis/Mond
        public Closure(MondInstanceFunction function)
        {
            Type = ClosureType.InstanceNative;

            InstanceNativeFunction = function;
        }
示例#14
0
文件: Closure.cs 项目: krixalis/Mond
        public Closure(MondFunction function)
        {
            Type = ClosureType.Native;

            NativeFunction = function;
        }
示例#15
0
 public EllipticalArcClose(CgmFile container, ClosureType type, double startX, double startY, double endX, double endY, CgmPoint center, CgmPoint first, CgmPoint second)
     : this(container)
 {
     ClosureType = type;
     SetValues(startX, startY, endX, endY, center, first, second);
 }
示例#16
0
文件: Closure.cs 项目: xserve98/Mond
        public Closure(MondFunction function)
        {
            Type = ClosureType.Native;

            NativeFunction = function;
        }
示例#17
0
        protected override ElementGroup CreateElementGroup(ICollection <ModelElement> elements, ClosureType closureType)
        {
            int i = 5;

            return(base.CreateElementGroup(elements, closureType));
        }
示例#18
0
文件: Closure.cs 项目: xserve98/Mond
        public Closure(MondInstanceFunction function)
        {
            Type = ClosureType.InstanceNative;

            InstanceNativeFunction = function;
        }
示例#19
0
 public CircularArcCentreClose(CgmFile container, CgmPoint center, double startDeltaX, double startDeltaY, double endDeltaX, double endDeltaY, double radius, ClosureType closure)
     : this(container)
 {
     SetValues(center, startDeltaX, startDeltaY, endDeltaX, endDeltaY, radius);
     Type = closure;
 }