Inheritance: ElementBase, IEquatable
 private void FillChildInfo(ChildElement child, XElement doc)
 {
     child.HingeOffset  = Single.Parse(doc.Attribute("hingeOffset").Value, CultureInfo.InvariantCulture);
     child.AttachedSide = GetSide(doc.Attribute("attachedToSide").Value);
     child.Height       = Single.Parse(doc.Attribute("panelHeight").Value, CultureInfo.InvariantCulture);
     child.Width        = Single.Parse(doc.Attribute("panelWidth").Value, CultureInfo.InvariantCulture);
 }
Beispiel #2
0
        private static void DownLoadFile(string strWindowTitle)
        {
            IntPtr TargetHandle = FindWindowByCaption(IntPtr.Zero, strWindowTitle);
            AutomationElementCollection ParentElements = AutomationElement.FromHandle(TargetHandle).FindAll(TreeScope.Children, Condition.TrueCondition);

            foreach (AutomationElement ParentElement in ParentElements)
            {
                // Identidfy Download Manager Window in Internet Explorer
                if (ParentElement.Current.ClassName == "Frame Notification Bar")
                {
                    AutomationElementCollection ChildElements = ParentElement.FindAll(TreeScope.Children, Condition.TrueCondition);
                    // Idenfify child window with the name Notification Bar or class name as DirectUIHWND
                    foreach (AutomationElement ChildElement in ChildElements)
                    {
                        if (ChildElement.Current.Name == "Notification bar" || ChildElement.Current.ClassName == "DirectUIHWND")
                        {
                            AutomationElementCollection DownloadCtrls = ChildElement.FindAll(TreeScope.Children, Condition.TrueCondition);
                            foreach (AutomationElement ctrlButton in DownloadCtrls)
                            {
                                //Now invoke the button click whichever you wish
                                if (ctrlButton.Current.Name.ToLower() == "save")
                                {
                                    var invokePattern = ctrlButton.GetCurrentPattern(InvokePattern.Pattern) as InvokePattern;
                                    invokePattern.Invoke();
                                }
                            }
                        }
                    }
                }
            }
        }
Beispiel #3
0
        void Ex01(TestAvaloniaControllers.ITestAvaloniaController controller)
        {
            Given("a data context", () => DataContext   = new object());
            Given("a child element", () => ChildElement = new Button {
                Name = "ChildElement"
            });
            Given("an element that has the child element", () => Element = new TestElement {
                Name = "element", Content = ChildElement, DataContext = DataContext
            });

            When("the controller is added", () => AvaloniaController.GetControllers(Element).Add(controller));
            When("the controller is attached to the element", () => AvaloniaController.GetControllers(Element).AttachTo(Element));

            Then("the data context of the controller should be set", () => controller.DataContext == DataContext);
            Then("the element of the controller should be null", () => controller.Element == null);
            Then("the child element of the controller should be null", () => controller.ChildElement == null);

            When("the element is attached to the logical tree", () => Element.AttachToLogicalTree());

            Then("the data context of the controller should be set", () => controller.DataContext == DataContext);
            Then("the element of the controller should be set", () => controller.Element == Element);
            Then("the child element of the controller should be set", () => controller.ChildElement == ChildElement);

            EventHandled = false;
            When("the Click event of the child element is raised", () => ChildElement.RaiseEvent(new RoutedEventArgs(Button.ClickEvent, ChildElement)));

            Then("the Click event should be handled", () => EventHandled);
        }
Beispiel #4
0
        public string FormatName(ChildElement member, string typeName, bool isCamelCase)
        {
            var nameParts = member.NameParts.AsEnumerable();

            if (nameParts.First() == "pfn")
            {
                nameParts = nameParts.Skip(1);
            }

            var result = JoinNameParts(nameParts);

            if (isCamelCase)
            {
                return(Normalise(result.FirstToLower()));
            }

            if (result == typeName)
            {
                return(nameParts.Last().FirstToUpper() + "Value");
            }
            else
            {
                return(result);
            }
        }
Beispiel #5
0
        public static void registerType(ModelBuilder modelBuilder)
        {
            ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(typeof(Activity), BPMN_ELEMENT_ACTIVITY).namespaceUri(BPMN20_NS).extendsType(typeof(FlowNode)).abstractType();

            isForCompensationAttribute = typeBuilder.booleanAttribute(BPMN_ATTRIBUTE_IS_FOR_COMPENSATION).defaultValue(false).build();

            startQuantityAttribute = typeBuilder.integerAttribute(BPMN_ATTRIBUTE_START_QUANTITY).defaultValue(1).build();

            completionQuantityAttribute = typeBuilder.integerAttribute(BPMN_ATTRIBUTE_COMPLETION_QUANTITY).defaultValue(1).build();

            defaultAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_DEFAULT).idAttributeReference(typeof(SequenceFlow)).build();

            SequenceBuilder sequenceBuilder = typeBuilder.sequence();

            ioSpecificationChild = sequenceBuilder.element(typeof(IoSpecification)).build();

            propertyCollection = sequenceBuilder.elementCollection(typeof(Property)).build();

            dataInputAssociationCollection = sequenceBuilder.elementCollection(typeof(DataInputAssociation)).build();

            dataOutputAssociationCollection = sequenceBuilder.elementCollection(typeof(DataOutputAssociation)).build();

            resourceRoleCollection = sequenceBuilder.elementCollection(typeof(ResourceRole)).build();

            loopCharacteristicsChild = sequenceBuilder.element(typeof(LoopCharacteristics)).build();

            typeBuilder.build();
        }
        private void FillAttachedElementsInfo(XElement attachedElements, RootElement rootTree, ChildElement childTree)
        {
            if (attachedElements.HasElements)
            {
                if (rootTree != null)
                {
                    rootTree.Childrens = new List <ChildElement>();
                }
                else
                {
                    childTree.Childrens = new List <ChildElement>();
                }
            }
            else
            {
                return;
            }

            foreach (XElement childElementXml in attachedElements.Elements())
            {
                var newChild = new ChildElement();
                if (rootTree != null)
                {
                    rootTree.Childrens.Add(newChild);
                }
                else
                {
                    childTree.Childrens.Add(newChild);
                }
                FillChildInfo(newChild, childElementXml);

                FillAttachedElementsInfo(childElementXml.Element("attachedPanels"), null, newChild);
            }
        }
Beispiel #7
0
 public PageElement()
 {
     Height = 0;
     Width = 0;
     Child = new ChildElement();
     ControlType = "";
     Left = 0;
     Top = 0;
     ZIndex = 0;
     Rotation = 0;
 }
Beispiel #8
0
        public static void registerType(ModelBuilder modelBuilder)
        {
            ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(typeof(Animals), ELEMENT_NAME_ANIMALS).namespaceUri(MODEL_NAMESPACE).instanceProvider(new ModelElementTypeBuilder_ModelTypeInstanceProviderAnonymousInnerClass());

            SequenceBuilder sequence = typeBuilder.sequence();

            descriptionChild = sequence.element(typeof(Description)).build();

            animalColl = sequence.elementCollection(typeof(Animal)).build();

            typeBuilder.build();
        }
Beispiel #9
0
        public static void registerType(ModelBuilder modelBuilder)
        {
            ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(typeof(BpmnDiagram), BPMNDI_ELEMENT_BPMN_DIAGRAM).namespaceUri(BPMNDI_NS).extendsType(typeof(Diagram)).instanceProvider(new ModelTypeInstanceProviderAnonymousInnerClass());

            SequenceBuilder sequenceBuilder = typeBuilder.sequence();

            bpmnPlaneChild = sequenceBuilder.element(typeof(BpmnPlane)).required().build();

            bpmnLabelStyleCollection = sequenceBuilder.elementCollection(typeof(BpmnLabelStyle)).build();

            typeBuilder.build();
        }
Beispiel #10
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void copyModelInstance()
        public virtual void copyModelInstance()
        {
            modelInstance = cloneModelInstance();

            tweety = modelInstance.getModelElementById("tweety");
            daffy  = modelInstance.getModelElementById("daffy");
            daisy  = modelInstance.getModelElementById("daisy");
            plucky = modelInstance.getModelElementById("plucky");
            birdo  = modelInstance.getModelElementById("birdo");

            flightInstructorChild      = (ChildElement <FlightInstructor>)FlyingAnimal.flightInstructorChild.ReferenceSourceCollection;
            flightPartnerRefCollection = FlyingAnimal.flightPartnerRefsColl.ReferenceSourceCollection;
        }
Beispiel #11
0
        public static void registerType(ModelBuilder modelBuilder)
        {
            ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(typeof(Process), BPMN_ELEMENT_PROCESS).namespaceUri(BPMN20_NS).extendsType(typeof(CallableElement)).instanceProvider(new ModelTypeInstanceProviderAnonymousInnerClass());

            processTypeAttribute = typeBuilder.enumAttribute(BPMN_ATTRIBUTE_PROCESS_TYPE, typeof(ProcessType)).defaultValue(ProcessType.None).build();

            isClosedAttribute = typeBuilder.booleanAttribute(BPMN_ATTRIBUTE_IS_CLOSED).defaultValue(false).build();

            isExecutableAttribute = typeBuilder.booleanAttribute(BPMN_ATTRIBUTE_IS_EXECUTABLE).build();

            // TODO: definitionalCollaborationRef

            SequenceBuilder sequenceBuilder = typeBuilder.sequence();

            auditingChild = sequenceBuilder.element(typeof(Auditing)).build();

            monitoringChild = sequenceBuilder.element(typeof(Monitoring)).build();

            propertyCollection = sequenceBuilder.elementCollection(typeof(Property)).build();

            laneSetCollection = sequenceBuilder.elementCollection(typeof(LaneSet)).build();

            flowElementCollection = sequenceBuilder.elementCollection(typeof(FlowElement)).build();

            artifactCollection = sequenceBuilder.elementCollection(typeof(Artifact)).build();

            resourceRoleCollection = sequenceBuilder.elementCollection(typeof(ResourceRole)).build();

            correlationSubscriptionCollection = sequenceBuilder.elementCollection(typeof(CorrelationSubscription)).build();

            supportsCollection = sequenceBuilder.elementCollection(typeof(Supports)).qNameElementReferenceCollection(typeof(Process)).build();

            /// <summary>
            /// camunda extensions </summary>

            camundaCandidateStarterGroupsAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_CANDIDATE_STARTER_GROUPS).@namespace(CAMUNDA_NS).build();

            camundaCandidateStarterUsersAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_CANDIDATE_STARTER_USERS).@namespace(CAMUNDA_NS).build();

            camundaJobPriorityAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_JOB_PRIORITY).@namespace(CAMUNDA_NS).build();

            camundaTaskPriorityAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_TASK_PRIORITY).@namespace(CAMUNDA_NS).build();

            camundaHistoryTimeToLiveAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_HISTORY_TIME_TO_LIVE).@namespace(CAMUNDA_NS).build();

            camundaIsStartableInTasklistAttribute = typeBuilder.booleanAttribute(CAMUNDA_ATTRIBUTE_IS_STARTABLE_IN_TASKLIST).defaultValue(true).@namespace(CAMUNDA_NS).build();

            camundaVersionTagAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_VERSION_TAG).@namespace(CAMUNDA_NS).build();

            typeBuilder.build();
        }
Beispiel #12
0
        public static void registerType(ModelBuilder bpmnModelBuilder)
        {
            ModelElementTypeBuilder typeBuilder = bpmnModelBuilder.defineType(typeof(BaseElement), BPMN_ELEMENT_BASE_ELEMENT).namespaceUri(BPMN20_NS).abstractType();

            idAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_ID).idAttribute().build();

            SequenceBuilder sequenceBuilder = typeBuilder.sequence();

            documentationCollection = sequenceBuilder.elementCollection(typeof(Documentation)).build();

            extensionElementsChild = sequenceBuilder.element(typeof(ExtensionElements)).build();

            typeBuilder.build();
        }
Beispiel #13
0
    public HostElement()
    {
        ChildElement ce;
        Int32        rows = 5;
        Int32        cols = 5;

        for (Int32 i = 0; i < rows; i++)
        {
            for (int j = 0; j < cols; j++)
            {
                ce = new ChildElement();
                this.Children.Add(ce);
            }
        }
    }
Beispiel #14
0
        public string FormatName(ChildElement member, bool isCamelCase)
        {
            var nameParts = member.NameParts.AsEnumerable();

            if (nameParts.First() == "pfn")
            {
                nameParts = nameParts.Skip(1);
            }

            var result = JoinNameParts(nameParts);

            return(isCamelCase
                ? Normalise(result.FirstToLower())
                : result);
        }
Beispiel #15
0
        public static void registerType(ModelBuilder modelBuilder)
        {
            ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(typeof(ResourceRole), BPMN_ELEMENT_RESOURCE_ROLE).namespaceUri(BPMN20_NS).extendsType(typeof(BaseElement)).instanceProvider(new ModelTypeInstanceProviderAnonymousInnerClass());

            nameAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_NAME).build();

            SequenceBuilder sequenceBuilder = typeBuilder.sequence();

            resourceRefChild = sequenceBuilder.element(typeof(ResourceRef)).qNameElementReference(typeof(Resource)).build();

            resourceParameterBindingCollection = sequenceBuilder.elementCollection(typeof(ResourceParameterBinding)).build();

            resourceAssignmentExpressionChild = sequenceBuilder.element(typeof(ResourceAssignmentExpression)).build();

            typeBuilder.build();
        }
Beispiel #16
0
        public static void registerType(ModelBuilder bpmnModelBuilder)
        {
            ModelElementTypeBuilder typeBuilder = bpmnModelBuilder.defineType(typeof(CallableElement), BPMN_ELEMENT_CALLABLE_ELEMENT).namespaceUri(BPMN20_NS).extendsType(typeof(RootElement)).instanceProvider(new ModelTypeInstanceProviderAnonymousInnerClass());

            nameAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_NAME).build();

            SequenceBuilder sequenceBuilder = typeBuilder.sequence();

            supportedInterfaceRefCollection = sequenceBuilder.elementCollection(typeof(SupportedInterfaceRef)).qNameElementReferenceCollection(typeof(Interface)).build();

            ioSpecificationChild = sequenceBuilder.element(typeof(IoSpecification)).build();

            ioBindingCollection = sequenceBuilder.elementCollection(typeof(IoBinding)).build();

            typeBuilder.build();
        }
Beispiel #17
0
        public static void registerType(ModelBuilder modelBuilder)
        {
            ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(typeof(DataAssociation), BPMN_ELEMENT_DATA_ASSOCIATION).namespaceUri(BPMN20_NS).extendsType(typeof(BaseElement)).instanceProvider(new ModelTypeInstanceProviderAnonymousInnerClass());

            SequenceBuilder sequenceBuilder = typeBuilder.sequence();

            sourceRefCollection = sequenceBuilder.elementCollection(typeof(SourceRef)).idElementReferenceCollection(typeof(ItemAwareElement)).build();

            targetRefChild = sequenceBuilder.element(typeof(TargetRef)).required().idElementReference(typeof(ItemAwareElement)).build();

            transformationChild = sequenceBuilder.element(typeof(Transformation)).build();

            assignmentCollection = sequenceBuilder.elementCollection(typeof(Assignment)).build();

            typeBuilder.build();
        }
Beispiel #18
0
        public static void registerType(ModelBuilder modelBuilder)
        {
            ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(typeof(FlowElement), BPMN_ELEMENT_FLOW_ELEMENT).namespaceUri(BPMN20_NS).extendsType(typeof(BaseElement)).abstractType();

            nameAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_NAME).build();

            SequenceBuilder sequenceBuilder = typeBuilder.sequence();

            auditingChild = sequenceBuilder.element(typeof(Auditing)).build();

            monitoringChild = sequenceBuilder.element(typeof(Monitoring)).build();

            categoryValueRefCollection = sequenceBuilder.elementCollection(typeof(CategoryValueRef)).qNameElementReferenceCollection(typeof(CategoryValue)).build();

            typeBuilder.build();
        }
        /// <summary>
        /// This Function delete a child
        /// </summary>
        /// <param name="c"></param>
        public void deleteChild(Child c)
        {
            XElement ChildElement;

            try
            {
                ChildElement = (from p in ChildRoot.Elements()
                                where Convert.ToInt32(p.Element("id").Value) == c.id
                                select p).FirstOrDefault();
                ChildElement.Remove();
                ChildRoot.Save(ChildPath);
            }
            catch
            {
                new Exception("The Child you tried to remove wasnt exist");
            }
        }
Beispiel #20
0
        public void TestElement()
        {
            var    pm = PmFactory.NewPersistenceManager();
            Parent p1 = new Parent();
            Parent p2 = new Parent();

            pm.MakePersistent(p1);
            pm.MakePersistent(p2);
            pm.Save();

            ChildElement ce = new ChildElement();

            pm.MakePersistent(ce);
            p1.ManipulateElement(p2, ce);
            Assert.AreEqual(NDOObjectState.Persistent, p1.NDOObjectState, "Falscher Status 1");
            Assert.AreEqual(NDOObjectState.PersistentDirty, p2.NDOObjectState, "Falscher Status 2");
        }
Beispiel #21
0
        public static void registerType(ModelBuilder modelBuilder)
        {
            ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(typeof(ConditionalEventDefinition), BPMN_ELEMENT_CONDITIONAL_EVENT_DEFINITION).namespaceUri(BPMN20_NS).extendsType(typeof(EventDefinition)).instanceProvider(new ModelTypeInstanceProviderAnonymousInnerClass());

            SequenceBuilder sequenceBuilder = typeBuilder.sequence();

            conditionChild = sequenceBuilder.element(typeof(Condition)).required().build();

            /// <summary>
            /// camunda extensions </summary>

            camundaVariableName = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_VARIABLE_NAME).@namespace(CAMUNDA_NS).build();

            camundaVariableEvents = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_VARIABLE_EVENTS).@namespace(CAMUNDA_NS).build();

            typeBuilder.build();
        }
Beispiel #22
0
        public static void registerType(ModelBuilder modelBuilder)
        {
            ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(typeof(Bird), ELEMENT_NAME_BIRD).namespaceUri(MODEL_NAMESPACE).extendsType(typeof(FlyingAnimal)).instanceProvider(new ModelElementTypeBuilder_ModelTypeInstanceProviderAnonymousInnerClass());

            SequenceBuilder sequence = typeBuilder.sequence();

            eggColl = sequence.elementCollection(typeof(Egg)).minOccurs(0).maxOccurs(6).build();

            spouseRefsColl = sequence.element(typeof(SpouseRef)).qNameElementReference(typeof(Bird)).build();

            guardEggRefCollection = sequence.elementCollection(typeof(GuardEgg)).idsElementReferenceCollection(typeof(Egg)).build();

            canHazExtendedWings_Renamed = typeBuilder.booleanAttribute("canHazExtendedWings").@namespace(TestModelConstants.NEWER_NAMESPACE).build();

            wings = sequence.element(typeof(Wings)).build();

            typeBuilder.build();
        }
Beispiel #23
0
        public bool RemoveChild(int id)
        {
            XElement ChildElement;

            try
            {
                ChildElement = (from p in ChildRoot.Elements()
                                where Convert.ToInt32(p.Element("id").Value) == id
                                select p).FirstOrDefault();
                ChildElement.Remove();
                ChildRoot.Save(ChildPath);
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Beispiel #24
0
        public static void registerType(ModelBuilder modelBuilder)
        {
            ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(typeof(Participant), BPMN_ELEMENT_PARTICIPANT).namespaceUri(BPMN20_NS).extendsType(typeof(BaseElement)).instanceProvider(new ModelTypeInstanceProviderAnonymousInnerClass());

            nameAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_NAME).build();

            processRefAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_PROCESS_REF).qNameAttributeReference(typeof(Process)).build();

            SequenceBuilder sequenceBuilder = typeBuilder.sequence();

            interfaceRefCollection = sequenceBuilder.elementCollection(typeof(InterfaceRef)).qNameElementReferenceCollection(typeof(Interface)).build();

            endPointRefCollection = sequenceBuilder.elementCollection(typeof(EndPointRef)).qNameElementReferenceCollection(typeof(EndPoint)).build();

            participantMultiplicityChild = sequenceBuilder.element(typeof(ParticipantMultiplicity)).build();

            typeBuilder.build();
        }
Beispiel #25
0
        public static void registerType(ModelBuilder modelBuilder)
        {
            ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(typeof(ThrowEvent), BPMN_ELEMENT_THROW_EVENT).namespaceUri(BPMN20_NS).extendsType(typeof(Event)).abstractType();

            SequenceBuilder sequenceBuilder = typeBuilder.sequence();

            dataInputCollection = sequenceBuilder.elementCollection(typeof(DataInput)).build();

            dataInputAssociationCollection = sequenceBuilder.elementCollection(typeof(DataInputAssociation)).build();

            inputSetChild = sequenceBuilder.element(typeof(InputSet)).build();

            eventDefinitionCollection = sequenceBuilder.elementCollection(typeof(EventDefinition)).build();

            eventDefinitionRefCollection = sequenceBuilder.elementCollection(typeof(EventDefinitionRef)).qNameElementReferenceCollection(typeof(EventDefinition)).build();

            typeBuilder.build();
        }
Beispiel #26
0
        public static void registerType(ModelBuilder modelBuilder)
        {
            ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(typeof(Lane), BPMN_ELEMENT_LANE).namespaceUri(BPMN20_NS).extendsType(typeof(BaseElement)).instanceProvider(new ModelTypeInstanceProviderAnonymousInnerClass());

            nameAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_NAME).build();

            partitionElementRefAttribute = typeBuilder.stringAttribute(BPMN_ATTRIBUTE_PARTITION_ELEMENT_REF).qNameAttributeReference(typeof(PartitionElement)).build();

            SequenceBuilder sequenceBuilder = typeBuilder.sequence();

            partitionElementChild = sequenceBuilder.element(typeof(PartitionElement)).build();

            flowNodeRefCollection = sequenceBuilder.elementCollection(typeof(FlowNodeRef)).idElementReferenceCollection(typeof(FlowNode)).build();

            childLaneSetChild = sequenceBuilder.element(typeof(ChildLaneSet)).build();



            typeBuilder.build();
        }
Beispiel #27
0
        public static void registerType(ModelBuilder modelBuilder)
        {
            ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(typeof(CatchEvent), BPMN_ELEMENT_CATCH_EVENT).namespaceUri(BPMN20_NS).extendsType(typeof(Event)).abstractType();

            parallelMultipleAttribute = typeBuilder.booleanAttribute(BPMN_ATTRIBUTE_PARALLEL_MULTIPLE).defaultValue(false).build();

            SequenceBuilder sequenceBuilder = typeBuilder.sequence();

            dataOutputCollection = sequenceBuilder.elementCollection(typeof(DataOutput)).build();

            dataOutputAssociationCollection = sequenceBuilder.elementCollection(typeof(DataOutputAssociation)).build();

            outputSetChild = sequenceBuilder.element(typeof(OutputSet)).build();

            eventDefinitionCollection = sequenceBuilder.elementCollection(typeof(EventDefinition)).build();

            eventDefinitionRefCollection = sequenceBuilder.elementCollection(typeof(EventDefinitionRef)).qNameElementReferenceCollection(typeof(EventDefinition)).build();

            typeBuilder.build();
        }
Beispiel #28
0
        public static void registerType(ModelBuilder modelBuilder)
        {
            ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(typeof(CamundaTaskListener), CAMUNDA_ELEMENT_TASK_LISTENER).namespaceUri(CAMUNDA_NS).instanceProvider(new ModelTypeInstanceProviderAnonymousInnerClass());

            camundaEventAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_EVENT).@namespace(CAMUNDA_NS).build();

            camundaClassAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_CLASS).@namespace(CAMUNDA_NS).build();

            camundaExpressionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_EXPRESSION).@namespace(CAMUNDA_NS).build();

            camundaDelegateExpressionAttribute = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_DELEGATE_EXPRESSION).@namespace(CAMUNDA_NS).build();

            SequenceBuilder sequenceBuilder = typeBuilder.sequence();

            camundaFieldCollection = sequenceBuilder.elementCollection(typeof(CamundaField)).build();

            camundaScriptChild = sequenceBuilder.element(typeof(CamundaScript)).build();

            typeBuilder.build();
        }
Beispiel #29
0
        public static void registerType(ModelBuilder modelBuilder)
        {
            ModelElementTypeBuilder typeBuilder = modelBuilder.defineType(typeof(MultiInstanceLoopCharacteristics), BPMN_ELEMENT_MULTI_INSTANCE_LOOP_CHARACTERISTICS).namespaceUri(BPMN20_NS).extendsType(typeof(LoopCharacteristics)).instanceProvider(new ModelTypeInstanceProviderAnonymousInnerClass());

            isSequentialAttribute = typeBuilder.booleanAttribute(BPMN_ELEMENT_IS_SEQUENTIAL).defaultValue(false).build();

            behaviorAttribute = typeBuilder.enumAttribute(BPMN_ELEMENT_BEHAVIOR, typeof(MultiInstanceFlowCondition)).defaultValue(MultiInstanceFlowCondition.All).build();

            oneBehaviorEventRefAttribute = typeBuilder.stringAttribute(BPMN_ELEMENT_ONE_BEHAVIOR_EVENT_REF).qNameAttributeReference(typeof(EventDefinition)).build();

            noneBehaviorEventRefAttribute = typeBuilder.stringAttribute(BPMN_ELEMENT_NONE_BEHAVIOR_EVENT_REF).qNameAttributeReference(typeof(EventDefinition)).build();

            SequenceBuilder sequenceBuilder = typeBuilder.sequence();

            loopCardinalityChild = sequenceBuilder.element(typeof(LoopCardinality)).build();

            loopDataInputRefChild = sequenceBuilder.element(typeof(LoopDataInputRef)).qNameElementReference(typeof(DataInput)).build();

            loopDataOutputRefChild = sequenceBuilder.element(typeof(LoopDataOutputRef)).qNameElementReference(typeof(DataOutput)).build();

            outputDataItemChild = sequenceBuilder.element(typeof(OutputDataItem)).build();

            inputDataItemChild = sequenceBuilder.element(typeof(InputDataItem)).build();

            complexBehaviorDefinitionCollection = sequenceBuilder.elementCollection(typeof(ComplexBehaviorDefinition)).build();

            completionConditionChild = sequenceBuilder.element(typeof(CompletionCondition)).build();

            camundaAsyncAfter = typeBuilder.booleanAttribute(CAMUNDA_ATTRIBUTE_ASYNC_AFTER).@namespace(CAMUNDA_NS).defaultValue(false).build();

            camundaAsyncBefore = typeBuilder.booleanAttribute(CAMUNDA_ATTRIBUTE_ASYNC_BEFORE).@namespace(CAMUNDA_NS).defaultValue(false).build();

            camundaExclusive = typeBuilder.booleanAttribute(CAMUNDA_ATTRIBUTE_EXCLUSIVE).@namespace(CAMUNDA_NS).defaultValue(true).build();

            camundaCollection = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_COLLECTION).@namespace(CAMUNDA_NS).build();

            camundaElementVariable = typeBuilder.stringAttribute(CAMUNDA_ATTRIBUTE_ELEMENT_VARIABLE).@namespace(CAMUNDA_NS).build();

            typeBuilder.build();
        }
Beispiel #30
0
        async Task Ex01(TestUwpControllers.ITestUwpController controller)
        {
            await RunAsync(() =>
            {
                Given("a data context", () => DataContext   = new object());
                Given("a child element", () => ChildElement = new TestElement {
                    Name = "childElement"
                });
                Given("an element that has the child element", () => Element = new TestElement {
                    Name = "element", Content = ChildElement, DataContext = DataContext
                });

                When("the controller is added", () => UwpController.GetControllers(Element).Add(controller));
                When("the controller is attached to the element", () => UwpController.GetControllers(Element).AttachTo(Element));

                Then("the data context of the controller should be set", () => controller.DataContext == DataContext);
                Then("the element of the controller should be null", () => controller.Element == null);
                Then("the child element of the controller should be null", () => controller.ChildElement == null);
            });

            EventHandled = false;
            When("the element is set to the content of the window", async() => await SetWindowContent(Element));

            Then("the data context of the controller should be set", () => controller.DataContext == DataContext);
            Then("the element of the controller should be set", () => controller.Element == Element);
            Then("the child element of the controller should be set", () => controller.ChildElement == ChildElement);
            Then("the event should be handled", () => EventHandled);

            await RunAsync(() =>
            {
                EventHandled = false;
                When("the Changed event of the child element is raised", () => ChildElement.RaiseChanged());
                Then("the Changed event should be handled", () => EventHandled);

                EventHandled = false;
                When("the data context of the child element should be set", () => ChildElement.DataContext = new object());
                Then("the DataContextChanged event should be handled", () => EventHandled);
            });
        }
Beispiel #31
0
        /// <summary>
        /// Measures the child element of a Viewbox to prepare for arranging
        /// it during the ArrangeOverride pass.
        /// </summary>
        /// <remarks>
        /// Viewbox measures it's child at an infinite constraint; it allows the child to be however large it so desires.
        /// The child's returned size will be used as it's natural size for scaling to Viewbox's size during Arrange.
        /// </remarks>
        /// <param name="availableSize">
        /// An upper limit Size that should not be exceeded.
        /// </param>
        /// <returns>The target Size of the element.</returns>
        protected override Size MeasureOverride(Size availableSize)
        {
            Size size = new Size();

            if (Child != null)
            {
                Debug.Assert(ChildElement != null, "The required template part ChildElement was not found!");

                // Get the child's desired size
                ChildElement.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
                Size desiredSize = ChildElement.DesiredSize;

                // Determine how much we should scale the child
                Size scale = ComputeScaleFactor(availableSize, desiredSize);
                Debug.Assert(!double.IsPositiveInfinity(scale.Width), "The scale scaleX should not be infinite.");
                Debug.Assert(!double.IsPositiveInfinity(scale.Height), "The scale scaleY should not be infinite.");

                // Determine the desired size of the Viewbox
                size.Width  = scale.Width * desiredSize.Width;
                size.Height = scale.Height * desiredSize.Height;
            }
            return(size);
        }
Beispiel #32
0
            /// <summary>
            /// a class for determining if it is equal with its self
            /// </summary>
            /// <param name="ce">the childern elements</param>
            /// <returns>if it was true or not</returns>
            public bool Equals(ChildElement ce)
            {
                if (
                    this.Brush == ce.Brush &&
                    this.Document == ce.Document &&
                    this.Fill == ce.Fill &&
                    this.BackgroundColor == ce.BackgroundColor &&
                    this.BorderThickness == ce.BorderThickness &&
                    this.BorderColor == ce.BorderColor &&
                    this.Image == ce.Image

                    )
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }