public Region
				( Model model
			 	, ElementWrapper redefinedElement
			 	, global::EA.Diagram masterDiagram
			 	, global::EA.Partition partition
			 	, short regionPos = 0
			 	)
		: base(model,redefinedElement.wrappedElement)
		{
			this.redefinedElement = redefinedElement;
			this.masterDiagram = masterDiagram;
			this.partition = partition;
			this._regionPos = regionPos;
			if(redefinedElement is UML.StateMachines.BehaviorStateMachines.StateMachine) {
				_stateMachine = redefinedElement as UML.StateMachines.BehaviorStateMachines.StateMachine;
			}
			else if(redefinedElement is UML.StateMachines.BehaviorStateMachines.State) {
				_state = redefinedElement as UML.StateMachines.BehaviorStateMachines.State;
			}
			else {
				throw new ArgumentException("Only StateMachine or State instances are allowed as owners.","owningElement");
			}
			if(partition != null) {
				if(!string.IsNullOrEmpty(partition.Name) &&
				   partition.Name != "<anonymous>") {
					_name = partition.Name;
				}
				else {
					_name = base.name + "Region" + regionPos.ToString();
				}
			}
			else {
				_name = base.name + "Region";
			}
		}
 public ElementMappingSet(ElementWrapper rootElement,bool source)
 {
     this.wrappedElement = rootElement;
     this.source = source;
     base.name = wrappedElement.name;
     base.mappings = this.getMappings().Cast<MP.Mapping>().ToList();
 }
 public MappingEnd(Element mappedElement,ElementWrapper rootElement)
 {
     this.mappedEnd = mappedElement;
     this.mappingPath = strippedFQN();
     if (rootElement != null && mappingPath.StartsWith(rootElement.fqn))
     {
         this.mappingPath = mappingPath.Remove(0,rootElement.fqn.Length - rootElement.name.Length);
     }
 }
Beispiel #4
0
        public static MappingSet createMappingSet(ElementWrapper sourceRoot, MappingSettings settings)
        {
            //get target mapping root
            ElementWrapper targetRootElement = null;
            var            packageTrace      = sourceRoot.getRelationships <Abstraction>().FirstOrDefault(x => x.source.uniqueID == sourceRoot.uniqueID &&
                                                                                                          x.target is ElementWrapper &&
                                                                                                          x.stereotypes.Any(y => y.name == "trace"));

            if (packageTrace != null)
            {
                targetRootElement = packageTrace.target as ElementWrapper;
            }
            return(createMappingSet(sourceRoot, targetRootElement, settings));
        }
        public static List<Mapping> createNewMappings(TSF.UmlToolingFramework.Wrappers.EA.Attribute attribute,string basepath,ElementWrapper targetRootElement)
        {
            List<Mapping> returnedMappings = new List<Mapping>();
            //connectors from owned attributes
            foreach (ConnectorWrapper mappedConnector in attribute.relationships.OfType<ConnectorWrapper>())
            {
                if (! mappedConnector.taggedValues.Any( x => x.name == mappingSourcePathName && x.tagValue.ToString() != basepath))
                {
                    //get the target base path
                    ConnectorMapping connectorMapping;
                    var targetTV = mappedConnector.taggedValues.FirstOrDefault(x => x.name == mappingTargetPathName);
                    string targetBasePath = string.Empty;
                    if (targetTV != null) targetBasePath = targetTV.tagValue.ToString();
                    if (! string.IsNullOrEmpty(targetBasePath))
                    {
                        connectorMapping = new ConnectorMapping(mappedConnector,basepath,targetBasePath);
                    }
                    else
                    {
                        connectorMapping = new ConnectorMapping(mappedConnector,basepath,targetRootElement);
                    }
                    returnedMappings.Add(connectorMapping);
                }
            }
            //tagged value references from owned attributes
            foreach (TaggedValue mappedTaggedValue in attribute.taggedValues.Where(x => x.tagValue is Element) )
            {
                string mappingSourcePath = getValueForKey(mappingSourcePathName,mappedTaggedValue.comment);
                string targetBasePath = getValueForKey(mappingTargetPathName,mappedTaggedValue.comment);

                //if not filled in or corresponds to the attributeBasePath
                if (string.IsNullOrEmpty(mappingSourcePath) || mappingSourcePath == basepath)
                {
                    TaggedValueMapping tagMapping;
                    if (! string.IsNullOrEmpty(targetBasePath))
                    {
                        tagMapping = new TaggedValueMapping(mappedTaggedValue,basepath,targetBasePath);
                    }
                    else
                    {
                        tagMapping = new TaggedValueMapping(mappedTaggedValue,basepath,targetRootElement);
                    }
                    returnedMappings.Add(tagMapping);
                }
            }
            //add the mappings for the type of the attribute
            var attributeType = attribute.type as ElementWrapper;
            if (attributeType != null) returnedMappings.AddRange(createOwnedMappings(attributeType,basepath + "." + attribute.name));
            return returnedMappings;
        }
        public void ElementWaitForTimeoutTest6()
        {
            var element = new ElementWrapper(new MockIWebElement(), browser);
            var i       = 0;

            element.WaitFor((elm) =>
            {
                if (i++ == 3)
                {
                    return;
                }
                throw new Exception("Not valid.");
            }, 2000, "test timeouted", checkInterval: 100);
        }
Beispiel #7
0
        public static Revit.Elements.Element byName(string name)
        {
            //exceptions
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            //Gets the Print Setting by name
            ViewSheetSet vs = new FilteredElementCollector(DocumentManager.Instance.CurrentDBDocument)
                              .OfClass(typeof(ViewSheetSet))
                              .FirstOrDefault(q => q.Name == name) as ViewSheetSet;
            var dsElement = ElementWrapper.ToDSType(vs, true);

            return(dsElement);
        }
Beispiel #8
0
        private static void PerformSelect2Test(BrowserWrapper browser, ElementWrapper fieldset)
        {
            var select2               = fieldset.Single(".select2");
            var input                 = select2.First("input");
            var result                = fieldset.Single(".result");
            var addItemsButton        = fieldset.ElementAt("button", 0);
            var changeSelectionButton = fieldset.ElementAt("button", 1);
            var submitButton          = fieldset.ElementAt("button", 2);

            // verify the selection at the beginning
            select2.FindElements("li").ThrowIfDifferentCountThan(2);
            result.CheckIfTextEquals("Prague");

            // append tag
            input.SendKeys("Ne");
            input.SendKeys(Keys.Return);
            select2.FindElements("li").ThrowIfDifferentCountThan(3);

            // submit and check the selection on the server
            submitButton.Click().Wait();

            // verify the new tag appeared in the result
            result.CheckIfTextEquals("Prague,New York");

            // check the items offered in the list
            input.Click().Wait();
            browser.FindElements(".select2-container--open li.select2-results__option").ThrowIfDifferentCountThan(4);
            fieldset.Click();

            // add new items to the collection
            addItemsButton.Click().Wait();

            // check the items offered in the list were updated
            input.Click().Wait();
            browser.FindElements(".select2-container--open li.select2-results__option").ThrowIfDifferentCountThan(5);

            // select last item from the list
            browser.Last(".select2-container--open li.select2-results__option").Click();

            // submit and check the selection on the server
            submitButton.Click().Wait();
            result.CheckIfTextEquals("Prague,New York,Berlin");

            // replace the selection on server
            changeSelectionButton.Click().Wait();
            submitButton.Click().Wait();
            result.CheckIfTextEquals("New York,Paris");
        }
        private static ElementWrapper UploadFileByA(ElementWrapper element, string fullFileName)
        {
            element.BrowserWrapper.GetJavaScriptExecutor()
            .ExecuteScript("dotvvm.fileUpload.createUploadId(arguments[0])", element.WebElement);

            var iframe = element.ParentElement.ParentElement.First("iframe", SelectBy.CssSelector);

            element.BrowserWrapper.Browser.SwitchTo().Frame(iframe.WebElement);

            var fileInput = element.BrowserWrapper._GetInternalWebDriver()
                            .FindElement(SelectBy.CssSelector("input[type=file]"));

            fileInput.SendKeys(fullFileName);

            element.Wait(element.ActionWaitTime);
            element.ActivateScope();
            return(element);
        }
        public ConnectorMapping(Element source, Element target, string sourcePath, string targetPath, MappingSettings settings) : base(source, target, sourcePath, targetPath)
        {
            var            sourceAttribute = source as TFS_EA.Attribute;
            var            targetAttribute = target as TFS_EA.Attribute;
            ElementWrapper sourceOwner     = sourceAttribute != null ? sourceAttribute.owner as ElementWrapper : source as ElementWrapper;
            ElementWrapper targetOwner     = targetAttribute != null ? targetAttribute.owner as ElementWrapper: null as ElementWrapper;

            if (sourceOwner != null & targetOwner != null)
            {
                //create the connector
                wrappedConnector = sourceOwner.model.factory.createNewElement <UML.Classes.Kernel.Association>
                                       (sourceOwner, string.Empty) as Association;
                //set source and target
                wrappedConnector.source = source;
                wrappedConnector.target = target;
                wrappedConnector.save();
            }
        }
Beispiel #11
0
        /// <summary>
        /// Creates Space from SAM Analytical Space
        /// </summary>
        /// <param name="space">SAM Analytical Space</param>
        /// <param name="convertSettings">convert Settings</param>
        /// <search>ToRevit, SAM Analytical Space</search>
        public static Revit.Elements.Element ToRevit(SAM.Analytical.Space space, ConvertSettings convertSettings)
        {
            Document document = DocumentManager.Instance.CurrentDBDocument;

            TransactionManager.Instance.EnsureInTransaction(document);

            Autodesk.Revit.DB.Element element = SAM.Analytical.Revit.Convert.ToRevit(space, document, convertSettings);

            TransactionManager.Instance.TransactionTaskDone();

            if (element != null)
            {
                return(ElementWrapper.ToDSType(element, true));
            }
            else
            {
                return(null);
            }
        }
Beispiel #12
0
    public static void ScrollTo(this ElementWrapper element)
    {
        var javascript = @"
            function findPosition(element) {
                var curtop = 0;
                if (element.offsetParent) {
                    do {
                        curtop += element.offsetTop;
                    } while (element = element.offsetParent);
                return [curtop];
                }
            }

            window.scroll(0,findPosition(arguments[0]));
        ";
        var executor   = element.BrowserWrapper.GetJavaScriptExecutor();

        executor.ExecuteScript(javascript, element.WebElement);
    }
Beispiel #13
0
        /// <summary>
        /// Creates HostObject from SAM Analytical Panel
        /// </summary>
        /// <param name="panel">SAM Analytical Panel</param>
        /// <search>ToRevit, SAM Analytical Panel</search>
        public static Revit.Elements.Element ToRevit(SAM.Analytical.Panel panel, ConvertSettings convertSettings)
        {
            Document document = DocumentManager.Instance.CurrentDBDocument;

            TransactionManager.Instance.EnsureInTransaction(document);

            HostObject hostObject = SAM.Analytical.Revit.Convert.ToRevit(panel, document, convertSettings);

            TransactionManager.Instance.TransactionTaskDone();

            if (hostObject != null)
            {
                return(ElementWrapper.ToDSType(hostObject, true));
            }
            else
            {
                return(null);
            }
        }
Beispiel #14
0
        List <Mapping> getMappings()
        {
            //get the connector mappings
            //check if the package has a trace to another package
            ElementWrapper targetRootElement = null;
            var            packageTrace      = this.wrappedPackage.relationships.OfType <Abstraction>().FirstOrDefault(x => x.target is Element && x.stereotypes.Any(y => y.name == "trace"));

            if (packageTrace != null)
            {
                targetRootElement = packageTrace.target as ElementWrapper;
            }
            List <Mapping> returnedMappings = new List <Mapping>();

            foreach (var classElement in wrappedPackage.ownedElements.OfType <ElementWrapper>())
            {
                returnedMappings.AddRange(MappingFactory.createOwnedMappings(classElement, wrappedPackage.name + "." + classElement.name, targetRootElement, true));
            }
            return(returnedMappings);
        }
        public static List<Mapping> createOwnedMappings(ElementWrapper ownerElement,string basepath,ElementWrapper targetRootElement)
        {
            List<Mapping> returnedMappings = new List<Mapping>();
            //connectors to an attribute
            foreach (ConnectorWrapper mappedConnector in ownerElement.relationships.OfType<ConnectorWrapper>()
                     .Where(y => y.targetElement is AttributeWrapper))
            {

                string connectorPath = basepath + "." + getConnectorString(mappedConnector);
                var connectorMapping = new ConnectorMapping(mappedConnector,connectorPath,targetRootElement);
                returnedMappings.Add(connectorMapping);
            }
            //loop owned attributes
            foreach (TSF.UmlToolingFramework.Wrappers.EA.Attribute ownedAttribute in ownerElement.ownedAttributes)
            {
                returnedMappings.AddRange(createNewMappings(ownedAttribute,basepath, targetRootElement));
            }
            return returnedMappings;
        }
Beispiel #16
0
 public Region
     (Model model
     , ElementWrapper redefinedElement
     , global::EA.Diagram masterDiagram
     , global::EA.Partition partition
     , short regionPos = 0
     )
     : base(model, redefinedElement.wrappedElement)
 {
     this.redefinedElement = redefinedElement;
     this.masterDiagram    = masterDiagram;
     this.partition        = partition;
     this._regionPos       = regionPos;
     if (redefinedElement is UML.StateMachines.BehaviorStateMachines.StateMachine)
     {
         _stateMachine = redefinedElement as UML.StateMachines.BehaviorStateMachines.StateMachine;
     }
     else if (redefinedElement is UML.StateMachines.BehaviorStateMachines.State)
     {
         _state = redefinedElement as UML.StateMachines.BehaviorStateMachines.State;
     }
     else
     {
         throw new ArgumentException("Only StateMachine or State instances are allowed as owners.", "owningElement");
     }
     if (partition != null)
     {
         if (!string.IsNullOrEmpty(partition.Name) &&
             partition.Name != "<anonymous>")
         {
             _name = partition.Name;
         }
         else
         {
             _name = base.name + "Region" + regionPos.ToString();
         }
     }
     else
     {
         _name = base.name + "Region";
     }
 }
Beispiel #17
0
        /// <summary>
        /// Gets the Chart Dash page.
        /// </summary>
        /// <param name="mainPage">The main page.</param>
        /// <returns>Content Page.</returns>
        private static ContentPage GetChartDashPage(VisualElement mainPage)
        {
            var controls = new ContentPage
            {
                Title = AppResources.PivotItemDashboard,
                Icon  = "dashboard-32.png"
            };

            var lstControls = new ListView
            {
                ItemsSource = Variables.DashList
            };

            lstControls.ItemSelected += async(sender, e) =>
            {
                ElementWrapper obj = e.SelectedItem as ElementWrapper;
                await mainPage.Navigation.PushAsync(new ChartDashPage(obj.ToString()));
            };
            controls.Content = lstControls;
            return(controls);
        }
        /// <summary>
        /// if it doesn't exist yet then we create it new, if it already exists then we update it
        /// </summary>
        /// <param name="ownerPackage">the package where the new items should be created</param>
        /// <param name = "elementType">the type of element to create for new items</param>
        public virtual bool synchronizeToEA(Package ownerPackage, string elementType)
        {
            //first check if it exists already
            string sqlGetExistingElement = @"select o.Object_ID from (t_object o 
											inner join t_objectproperties tv on o.Object_ID = tv.Object_ID)
											where tv.[Property] = 'TFS_ID'
											and tv.[Value] = '"                                             + this.ID + "'";
            //TODO: get elements by query
            var elementToWrap = ownerPackage.model.getElementWrappersByQuery(sqlGetExistingElement).FirstOrDefault();

            if (elementToWrap == null)
            {
                //element does not exist, create a new one
                elementToWrap = ownerPackage.addOwnedElement <ElementWrapper>(this.title, elementType);
            }
            if (elementToWrap != null)
            {
                this.wrappedElement = elementToWrap;
                this.save();
            }
            //return if this worked
            return(elementToWrap != null);
        }
Beispiel #19
0
        public static List <Mapping> createRootMappings(ElementWrapper root, string basepath)
        {
            //get the owned mappings
            var returnedMappings = MappingFactory.createOwnedMappings(root, basepath, false);

            //get the mappings of all associated elements
            foreach (var assocation in root.relationships
                     .OfType <Association>()
                     .Where(x => x.source.Equals(root)))
            {
                var targetElement = assocation.target as ElementWrapper;
                if (targetElement != null)
                {
                    returnedMappings.AddRange(createRootMappings(targetElement, basepath + "." + getConnectorString(assocation)));
                }
            }
            //get the owned mappings of all owned elements
            foreach (var ownedElement in root.ownedElements.OfType <ElementWrapper>())
            {
                returnedMappings.AddRange(createRootMappings(ownedElement, basepath + "." + ownedElement.name));
            }
            return(returnedMappings);
        }
 public DiagramObjectWrapper(Model model, ElementWrapper element,
                             Diagram diagram) 
   : this(model, diagram.getdiagramObjectForElement(element)) 
 {}
 public static List<Mapping> createRootMappings(ElementWrapper root,string basePath)
 {
     //get the owned mappings
     var returnedMappings =  MappingFactory.createOwnedMappings(root,basePath);
     //get the mappings of all associated elements
     foreach (var assocation in root.relationships
              					.OfType<Association>()
              					.Where (x => x.source.Equals(root)))
     {
         var targetElement = assocation.target as ElementWrapper;
         if (targetElement != null) returnedMappings.AddRange(createRootMappings(targetElement,basePath + "." + getConnectorString(assocation)));
     }
     return returnedMappings;
 }
Beispiel #22
0
        /// <summary>
        /// Duplicates A Sheet.
        /// </summary>
        /// <param name="sheet">The Sheet to be Duplicated.</param>
        /// <param name="duplicateWithContents">Set to true that Duplicate sheet with contents</param>
        /// <param name="duplicateWithView">Set to true that Duplicate sheet with views.</param>
        /// <param name="viewDuplicateOption">Enter View Duplicate Option: 0 = Duplicate. 1 = AsDependent. 2 = WithDetailing.</param>
        /// <param name="prefix"></param>
        /// <param name="suffix">When prefix and suffix are both empty, suffix will set a default value - " - Copy".</param>
        /// <returns></returns>
        public static Sheet DuplicateSheet(Sheet sheet, bool duplicateWithContents = false, bool duplicateWithView = false, int viewDuplicateOption = 0, string prefix = "", string suffix = "")
        {
            if (sheet == null)
            {
                throw new ArgumentNullException(nameof(sheet));
            }

            ViewDuplicateOption Option = 0;

            switch (viewDuplicateOption)
            {
            case 0:
                Option = ViewDuplicateOption.Duplicate;
                break;

            case 1:
                Option = ViewDuplicateOption.AsDependent;
                break;

            case 2:
                Option = ViewDuplicateOption.WithDetailing;
                break;

            default:
                throw new ArgumentException(Properties.Resources.ViewDuplicateOptionOutofRange);
            }

            if (String.IsNullOrEmpty(prefix) && String.IsNullOrEmpty(suffix))
            {
                suffix = " - Copy";
            }

            Sheet newSheet = null;

            try
            {
                RevitServices.Transactions.TransactionManager.Instance.EnsureInTransaction(Application.Document.Current.InternalDocument);

                var oldElements             = ElementBinder.GetElementsFromTrace <Autodesk.Revit.DB.Element>(Document);
                List <ElementId> elementIds = new List <ElementId>();
                var newSheetNumber          = prefix + sheet.SheetNumber + suffix;
                var newSheetName            = sheet.SheetName;
                List <Autodesk.Revit.DB.Element> TraceElements = new List <Autodesk.Revit.DB.Element>();

                if (oldElements != null)
                {
                    foreach (var element in oldElements)
                    {
                        elementIds.Add(element.Id);
                        if (element is ViewSheet)
                        {
                            var oldSheet = (element as ViewSheet).ToDSType(false) as Sheet;
                            if (oldSheet.SheetNumber.Equals(newSheetNumber))
                            {
                                if ((duplicateWithView && oldElements.Count() > 1) || (!duplicateWithView && oldElements.Count() == 1))
                                {
                                    newSheet = oldSheet;
                                    TraceElements.AddRange(oldElements);
                                }
                                if (newSheet != null)
                                {
                                    if (duplicateWithContents)
                                    {
                                        DuplicateSheetAnnotations(sheet, newSheet);
                                    }
                                    else
                                    {
                                        DeleteSheetAnnotations(newSheet);
                                    }
                                }
                            }
                        }
                    }
                    if (newSheet == null)
                    {
                        Autodesk.Revit.UI.UIDocument uIDocument = new Autodesk.Revit.UI.UIDocument(Document);
                        var openedViews       = uIDocument.GetOpenUIViews().ToList();
                        var shouldClosedViews = openedViews.FindAll(x => elementIds.Contains(x.ViewId));
                        if (shouldClosedViews.Count > 0)
                        {
                            foreach (var v in shouldClosedViews)
                            {
                                if (uIDocument.GetOpenUIViews().ToList().Count() > 1)
                                {
                                    v.Close();
                                }
                                else
                                {
                                    throw new InvalidOperationException(string.Format(Properties.Resources.CantCloseLastOpenView, v.ToString()));
                                }
                            }
                        }
                        Document.Delete(elementIds);
                    }
                }

                if (newSheet == null && TraceElements.Count == 0)
                {
                    // Create a new Sheet with different SheetNumber
                    var          titleBlockElement    = sheet.TitleBlock.First() as FamilyInstance;
                    FamilySymbol TitleBlock           = titleBlockElement.InternalFamilyInstance.Symbol;
                    FamilyType   titleBlockFamilyType = ElementWrapper.Wrap(TitleBlock, true);

                    if (!CheckUniqueSheetNumber(newSheetNumber))
                    {
                        throw new ArgumentException(String.Format(Properties.Resources.SheetNumberExists, newSheetNumber));
                    }

                    var viewSheet = Autodesk.Revit.DB.ViewSheet.Create(Document, TitleBlock.Id);
                    newSheet = new Sheet(viewSheet);
                    newSheet.InternalSetSheetName(newSheetName);
                    newSheet.InternalSetSheetNumber(newSheetNumber);

                    TraceElements.Add(newSheet.InternalElement);

                    // Copy Annotation Elements from sheet to new sheet by ElementTransformUtils.CopyElements
                    if (duplicateWithContents)
                    {
                        DuplicateSheetAnnotations(sheet, newSheet);
                    }

                    if (duplicateWithView)
                    {
                        // Copy ScheduleSheetInstance except RevisionSchedule from sheet to new sheet by ElementTransformUtils.CopyElements
                        DuplicateScheduleSheetInstance(sheet, newSheet);

                        // Duplicate Viewport in sheet and place on new sheet
                        TraceElements.AddRange(DuplicateViewport(sheet, newSheet, Option, prefix, suffix));
                    }
                }

                ElementBinder.SetElementsForTrace(TraceElements);
                RevitServices.Transactions.TransactionManager.Instance.TransactionTaskDone();
            }
            catch (Exception e)
            {
                if (newSheet != null)
                {
                    newSheet.Dispose();
                }
                throw e;
            }

            return(newSheet);
        }
 public Mapping(Element sourceElement, Element targetElement,string basepath, ElementWrapper targetRoot)
     : this(new MappingEnd(sourceElement,basepath),new MappingEnd(targetElement,targetRoot))
 {
 }
 public ConnectorMapping(ConnectorWrapper wrappedConnector, string basePath, ElementWrapper targetRootElement) : base(wrappedConnector.sourceElement, wrappedConnector.targetElement, basePath, targetRootElement)
 {
     this.wrappedConnector = wrappedConnector;
 }
 public TaggedValueMapping(TaggedValue wrappedTaggedValue,string basePath,ElementWrapper targetRootElement)
     : base((Element)wrappedTaggedValue.owner,wrappedTaggedValue.tagValue as Element,basePath,targetRootElement)
 {
     this.wrappedTaggedValue = wrappedTaggedValue;
 }
Beispiel #26
0
        /// <summary>
        /// create a mappingSet based on the data in the CSV file
        /// </summary>
        /// <param name="model">the model that contains the elements</param>
        /// <param name="filePath">the path to the CSV file</param>
        /// <returns>a mapping set representing the mapping in the file</returns>
        public static MappingSet createMappingSet(Model model, string filePath, MappingSettings settings, ElementWrapper sourceRootElement, ElementWrapper targetRootElement)
        {
            MappingSet newMappingSet = null;
            IEnumerable <CSVMappingRecord> mappingRecords;

            //read the csv file
            using (var textReader = new StreamReader(filePath))
            {
                var csv = new CSV.CsvReader(textReader, false);
                csv.Configuration.RegisterClassMap <CSVMappingRecordMap>();
                csv.Configuration.Delimiter = ";";
                mappingRecords = csv.GetRecords <CSVMappingRecord>();
            }
            //create the new mapping set
            newMappingSet = createMappingSet(sourceRootElement, targetRootElement, settings);
            //remove all existing mappings
            //TODO: warn if mappings exist?
            foreach (var mapping in newMappingSet.mappings)
            {
                mapping.delete();
            }
            //make sure the target node tree has been build
            ((MappingNode)newMappingSet.target).buildNodeTree();
            //now loop the records
            foreach (var csvRecord in mappingRecords)
            {
                EAOutputLogger.log(model, settings.outputName
                                   , $"Parsed source: '{csvRecord.sourcePath}' target: '{csvRecord.targetPath}' logic: '{csvRecord.mappingLogic}'"
                                   , 0, LogTypeEnum.log);
            }
            return(newMappingSet);
            //         int i = 1;
            //Package rootPackage = null;
            //foreach (CSVMappingRecord mappingRecord in parsedFile)
            //{

            //	//find source
            //	var source = findElement(model, mappingRecord.sourcePath, sourceRootElement);
            //	//find target
            //	var target = findElement(model, mappingRecord.targetPath,targetRootElement);
            //	if (source == null )
            //	{
            //		EAOutputLogger.log(model,settings.outputName
            //		                   ,string.Format("Could not find element that matches: '{0}'",mappingRecord.sourcePath)
            //		                   ,0,LogTypeEnum.error);
            //	}
            //	else if( target == null)
            //	{
            //		EAOutputLogger.log(model,settings.outputName
            //		                   ,string.Format("Could not find element that matches: '{0}'",mappingRecord.targetPath)
            //		                   ,0,LogTypeEnum.error);
            //	}
            //	else
            //	{
            //		//first check if the mappingSet is already created
            //		if (newMappingSet == null)
            //		{
            //			//determine if this should be a PackageMappingSet or an ElementMappingSet
            //			if (sourceRootElement is Package)
            //			{
            //				rootPackage = sourceRootElement as Package;
            //				//newMappingSet = new PackageMappingSet(sourceRootElement as Package);
            //			}
            //			else if (sourceRootElement is ElementWrapper)
            //			{
            //				rootPackage = sourceRootElement.owningPackage as Package;
            //				//newMappingSet = new ElementMappingSet(sourceRootElement as ElementWrapper);
            //			}
            //			else
            //			{
            //				rootPackage = source.owningPackage as Package;
            //				//newMappingSet = new PackageMappingSet((Package)source.owningPackage);
            //			}

            //		}
            //		MappingLogic newMappingLogic = null;
            //		//check if there is any mapping logic
            //		if (! string.IsNullOrEmpty(mappingRecord.mappingLogic))
            //		{
            //			if (settings.useInlineMappingLogic)
            //			{
            //				newMappingLogic = new MappingLogic(mappingRecord.mappingLogic);
            //			}
            //			else
            //			{
            //				 //Check fo an existing mapping logic
            //				 newMappingLogic = getExistingMappingLogic(model, settings, mappingRecord.mappingLogic, rootPackage);

            //				 if (newMappingLogic == null)
            //				 {

            //					 var mappingElement = model.factory.createNewElement(rootPackage, "mapping logic " + i,settings.mappingLogicType) as ElementWrapper;
            //					 if (mappingElement != null)
            //					 {
            //					    //increase counter for new mapping element name
            //				        i++;
            //					    mappingElement.notes = mappingRecord.mappingLogic;
            //					    mappingElement.save();
            //					    //create the mappingLogic
            //					    newMappingLogic = new MappingLogic(mappingElement);
            //					 }
            //					 else
            //					 {
            //					    //else we create an inline mapping logic anyway
            //					    newMappingLogic = new MappingLogic(mappingRecord.mappingLogic);
            //					 }
            //				 }
            //			}
            //		}
            //		Mapping newMapping = null;
            //		var sourceAssociationEnd = source as AssociationEnd;
            //		var targetAssociationEnd = target as AssociationEnd;
            //		//create the new mapping
            //		//we can't create connector mappings for mappings to or from associations so we have to use tagged value mappings for those.
            //		if (settings.useTaggedValues
            //		   || sourceAssociationEnd != null || targetAssociationEnd != null)
            //		{
            //			//if the source or target are associationEnds then we replace them by their association
            //			if (sourceAssociationEnd != null) source = sourceAssociationEnd.association as Element;
            //			if (targetAssociationEnd != null) target = targetAssociationEnd.association as Element;
            //			//newMapping = new TaggedValueMapping(source,target,mappingRecord.sourcePath,mappingRecord.targetPath,settings);
            //		}
            //		else
            //		{
            //			//newMapping = new ConnectorMapping(source,target,mappingRecord.sourcePath,mappingRecord.targetPath,settings);
            //		}
            //		if (newMappingLogic != null) newMapping.mappingLogic = newMappingLogic;
            //		newMapping.save();
            //		newMappingSet.addMapping(newMapping);

            //	}
            //}
        }
 public static List<Mapping> createOwnedMappings(ElementWrapper ownerElement,string basepath)
 {
     return createOwnedMappings( ownerElement, basepath,null);
 }
		internal bool isContainedElement(ElementWrapper elementWrapper)
		{
			if(elementWrapper == null) {
				return false;
			}
			
			// The element in question must be a direct child of the regions owning element
			if(elementWrapper.wrappedElement.ParentID != redefinedElement.wrappedElement.ElementID)
			{
				return false;
			}
			
			if(partition != null)
			{
				// Check if the element in question resides inside the graphical representation of this region
				//--------------------------------------------------------------------------------------------
				if(masterDiagram != null)
				{
					// Get the element in question's graphical representation from the master diagram
					global::EA.DiagramObject elementDiagramObject = getMasterDiagramObject(elementWrapper);
					if(elementDiagramObject != null)
					{
						System.Drawing.Rectangle elementRectangle = 
							new System.Drawing.Rectangle
									( elementDiagramObject.left
							 		, System.Math.Abs(elementDiagramObject.top)
							  		, elementDiagramObject.right - elementDiagramObject.left
							  		, System.Math.Abs(elementDiagramObject.bottom) - System.Math.Abs(elementDiagramObject.top)
							  		);
						// Get the owning elements graphical region representation from the master diagram
						global::EA.DiagramObject owningElementDiagramObject = getMasterDiagramObject(redefinedElement);
						if(owningElementDiagramObject != null)
						{
							int x = owningElementDiagramObject.left;
							int y = System.Math.Abs(owningElementDiagramObject.top) + getRegionTopOffset(partition);
							int width = owningElementDiagramObject.right - x;
							int height = partition.Size;
							System.Drawing.Rectangle regionRectangle = new System.Drawing.Rectangle(x,y,width,height);
							if(regionRectangle.Contains(elementRectangle))
						    {
						   		return true;
						    }
						}
					}
				}
			}
			else
			{
				return true;
			}
			return false;
		}
Beispiel #29
0
        public static void IsElementNotInView(this IOperationRunner <IElementWrapper> operationRunner, ElementWrapper element)
        {
            var IsElementNotInView = new IsElementNotInViewValidator(element);

            operationRunner.Evaluate <UnexpectedElementStateException>(IsElementNotInView);
        }
Beispiel #30
0
        public static List <Mapping> createOwnedMappings(ElementWrapper ownerElement, string basepath, ElementWrapper targetRootElement, bool includeOwnedElements)
        {
            List <Mapping> returnedMappings = new List <Mapping>();

            //connectors to an attribute
            foreach (ConnectorWrapper mappedConnector in ownerElement.relationships.OfType <ConnectorWrapper>()
                     .Where(y => y.targetElement is AttributeWrapper))
            {
                string connectorPath = basepath + "." + getConnectorString(mappedConnector);
                //var connectorMapping = new ConnectorMapping(mappedConnector,connectorPath,targetRootElement);
                //returnedMappings.Add(connectorMapping);
            }
            //loop owned attributes
            foreach (TSF.UmlToolingFramework.Wrappers.EA.Attribute ownedAttribute in ownerElement.ownedAttributes)
            {
                returnedMappings.AddRange(createNewMappings(ownedAttribute, basepath, targetRootElement));
            }
            //loop owned Elements
            if (includeOwnedElements)
            {
                foreach (var ownedElement in ownerElement.ownedElements.OfType <ElementWrapper>())
                {
                    returnedMappings.AddRange(createOwnedMappings(ownedElement, basepath + "." + ownedElement.name, targetRootElement, includeOwnedElements));
                }
            }
            return(returnedMappings);
        }
 public ConnectorMapping(ConnectorWrapper wrappedConnector,string basePath,ElementWrapper targetRootElement)
     : base(wrappedConnector.sourceElement,wrappedConnector.targetElement,basePath,targetRootElement)
 {
     this.wrappedConnector = wrappedConnector;
 }
 /// <summary>
 /// constructuro with ElementWrapper
 /// </summary>
 /// <param name="wrappedElement"></param>
 protected WorkItem(WT.Project ownerProject, ElementWrapper wrappedElement) : this(ownerProject)
 {
     this._wrappedElement = wrappedElement;
 }
 private void zvyrazniVDiagrameToolStripMenuItem_Click(object sender, System.EventArgs e)
 {
     try {
         if (selectedError.rule.elementType == "Class" || selectedError.rule.elementType == "UseCase" || selectedError.rule.elementType == "Activity")
         {
             ElementWrapper elementWrapper = new ElementWrapper(selectedError.model, (EA.Element)selectedError.element);
             elementWrapper.selectInCurrentDiagram();
         }
         else
         {
             ConnectorWrapper connectorWrapper = new ConnectorWrapper(selectedError.model, (EA.Connector)selectedError.element);
             connectorWrapper.selectInCurrentDiagram();
         }
     }
     catch (Exception ex) { }
 }
Beispiel #34
0
        public void ElementWaitForTimeoutTest()
        {
            var element = new ElementWrapper(new MockIWebElement(), browser);

            element.WaitFor(elm => false, 2000, "test timeouted");
        }
 public DoorsNGRequirement(ElementWrapper wrappedelement) : base(wrappedelement)
 {
 }
Beispiel #36
0
 public TaggedValueMapping(TaggedValue wrappedTaggedValue, string basePath, ElementWrapper targetRootElement) : base((Element)wrappedTaggedValue.owner, wrappedTaggedValue.tagValue as Element, basePath, targetRootElement)
 {
     this.wrappedTaggedValue = wrappedTaggedValue;
 }
Beispiel #37
0
        private FormDefinition BuildDefinition(Type type)
        {
            // Only classes are allowed.
            // Primitives should be retrieved from prebuilt definitions.
            if (!type.IsClass || typeof(MulticastDelegate).IsAssignableFrom(type.BaseType))
            {
                return(null);
            }

            var formDefinition    = new FormDefinition(type);
            var mode              = DefaultFields.AllExcludingReadonly;
            var grid              = new[] { 1d };
            var beforeFormContent = new List <AttrElementTuple>();
            var afterFormContent  = new List <AttrElementTuple>();

            foreach (var attribute in type.GetCustomAttributes())
            {
                switch (attribute)
                {
                case ResourceAttribute resource:
                    formDefinition.Resources.Add(resource.Name, resource.Value is string expr
                            ? (IValueProvider)BoundExpression.Parse(expr)
                            : new LiteralValue(resource.Value));
                    break;

                case FormAttribute form:
                    mode = form.Mode;
                    grid = form.Grid;
                    if (grid == null || grid.Length < 1)
                    {
                        grid = new[] { 1d };
                    }

                    break;

                case FormContentAttribute contentAttribute:
                    if (contentAttribute.Placement == Placement.After)
                    {
                        afterFormContent.Add(new AttrElementTuple(contentAttribute, contentAttribute.GetElement()));
                    }
                    else if (contentAttribute.Placement == Placement.Before)
                    {
                        beforeFormContent.Add(new AttrElementTuple(contentAttribute,
                                                                   contentAttribute.GetElement()));
                    }

                    break;

                case MetaAttribute meta:
                    if (!string.IsNullOrEmpty(meta.Name))
                    {
                        formDefinition.Metadata[meta.Name] = meta.Value;
                    }

                    break;
                }
            }

            beforeFormContent.Sort((a, b) => a.Attr.Position.CompareTo(b.Attr.Position));
            afterFormContent.Sort((a, b) => a.Attr.Position.CompareTo(b.Attr.Position));

            var gridLength = grid.Length;

            // Pass one - get list of valid properties.
            var properties = Utilities
                             .GetProperties(type, mode)
                             .Select(p => new PropertyInfoWrapper(p))
                             .ToArray();

            // Pass two - build form elements.
            var elements = new List <ElementWrapper>();

            foreach (var property in properties)
            {
                var deserializer = TryGetDeserializer(property.PropertyType);
                // Query property builders.
                var element = Build(property, deserializer);

                if (element == null)
                {
                    // Unhandled properties are ignored.
                    continue;
                }

                // Pass three - initialize elements.
                foreach (var initializer in FieldInitializers)
                {
                    initializer.Initialize(element, property, deserializer);
                }

                var wrapper = new ElementWrapper(element, property);
                // Set layout.
                var attr = property.GetCustomAttribute <FieldAttribute>();
                if (attr != null)
                {
                    wrapper.Position   = attr.Position;
                    wrapper.Row        = attr.Row;
                    wrapper.Column     = attr.Column;
                    wrapper.ColumnSpan = attr.ColumnSpan;
                }

                elements.Add(wrapper);
            }

            // Pass four - order elements.
            elements = elements.OrderBy(element => element.Position).ToList();

            // Pass five - group rows and calculate layout.
            var layout = PerformLayout(grid, elements);

            // Pass six - add attached elements.
            var rows = new List <FormRow>();

            // Before form.
            rows.AddRange(CreateRows(beforeFormContent, gridLength));

            foreach (var row in layout)
            {
                var before = new List <AttrElementTuple>();
                var after  = new List <AttrElementTuple>();
                foreach (var element in row.Elements)
                {
                    var property = element.Property;
                    foreach (var attr in property.GetCustomAttributes <FormContentAttribute>())
                    {
                        if (attr.Placement == Placement.Before)
                        {
                            before.Add(new AttrElementTuple(attr, attr.GetElement()));
                        }
                        else if (attr.Placement == Placement.After)
                        {
                            after.Add(new AttrElementTuple(attr, attr.GetElement()));
                        }
                    }
                }

                before.Sort((a, b) => a.Attr.Position.CompareTo(b.Attr.Position));
                after.Sort((a, b) => a.Attr.Position.CompareTo(b.Attr.Position));

                // Before element.
                rows.AddRange(CreateRows(before, gridLength));

                // Field row.
                var formRow = new FormRow();
                formRow.Elements.AddRange(
                    row.Elements.Select(w =>
                {
                    var inlineElements = w.Property
                                         .GetCustomAttributes <FormContentAttribute>()
                                         .Where(attr => attr.Placement == Placement.Inline)
                                         .Select(attr => new AttrElementTuple(attr, attr.GetElement()))
                                         .OrderBy(tuple => tuple.Attr.Position)
                                         .ToList();

                    w.Element.LinePosition = (Position)(-1);
                    if (inlineElements.Count != 0)
                    {
                        return(new FormElementContainer(w.Column, w.ColumnSpan,
                                                        inlineElements
                                                        .Select(t => t.Element)
                                                        .Concat(new[] { w.Element })
                                                        .ToList()));
                    }

                    return(new FormElementContainer(w.Column, w.ColumnSpan, w.Element));
                }));
                rows.Add(formRow);

                // After element.
                rows.AddRange(CreateRows(after, gridLength));
            }

            // After form.
            rows.AddRange(CreateRows(afterFormContent, gridLength));

            // Wrap up everything.
            formDefinition.Grid     = grid;
            formDefinition.FormRows = rows;
            formDefinition.Freeze();
            foreach (var element in formDefinition.FormRows.SelectMany(r => r.Elements).SelectMany(c => c.Elements))
            {
                element.Freeze();
            }

            return(formDefinition);
        }
 public MappingLogic(ElementWrapper wrappedElement)
 {
     this.mappingElement = wrappedElement;
 }
Beispiel #39
0
 public static List <Mapping> createOwnedMappings(ElementWrapper ownerElement, string basepath, bool includeOwnedElements)
 {
     return(createOwnedMappings(ownerElement, basepath, null, includeOwnedElements));
 }
Beispiel #40
0
        private void SetupPython()
        {
            if (setupPython)
            {
                return;
            }

            IronPythonEvaluator.OutputMarshaler.RegisterMarshaler((Autodesk.Revit.DB.Element element) => ElementWrapper.ToDSType(element, (bool)true));

            // Turn off element binding during iron python script execution
            IronPythonEvaluator.EvaluationBegin += (a, b, c, d, e) => ElementBinder.IsEnabled = false;
            IronPythonEvaluator.EvaluationEnd   += (a, b, c, d, e) => ElementBinder.IsEnabled = true;

            // register UnwrapElement method in ironpython
            IronPythonEvaluator.EvaluationBegin += (a, b, scope, d, e) =>
            {
                var marshaler = new DataMarshaler();
                marshaler.RegisterMarshaler((Revit.Elements.Element element) => element.InternalElement);
                marshaler.RegisterMarshaler((Revit.Elements.Category element) => element.InternalCategory);

                Func <object, object> unwrap = marshaler.Marshal;
                scope.SetVariable("UnwrapElement", unwrap);
            };

            setupPython = true;
        }
		private global::EA.DiagramObject getMasterDiagramObject(ElementWrapper elementWrapper)
		{
			foreach(global::EA.DiagramObject diagramObject in masterDiagram.DiagramObjects)
			{
				if(diagramObject.ElementID == elementWrapper.wrappedElement.ElementID)
				{
					return diagramObject;
				}
			}
			return null;
		}
Beispiel #42
0
        /// <summary>
        /// Duplicates A view.
        /// </summary>
        /// <param name="view">The View to be Duplicated</param>
        /// <param name="viewDuplicateOption">Enter View Duplicate Option: Duplicate, AsDependent or WithDetailing.</param>
        /// <param name="prefix"></param>
        /// <param name="suffix"></param>
        /// <returns></returns>
        public static Revit.Elements.Views.View DuplicateView(View view, string viewDuplicateOption = "Duplicate", string prefix = "", string suffix = "")
        {
            View newView = null;

            if (view == null)
            {
                throw new ArgumentNullException(nameof(view));
            }
            if (view is Sheet)
            {
                throw new ArgumentException(Properties.Resources.DuplicateViewCantApplySheet);
            }

            ViewDuplicateOption Option = (ViewDuplicateOption)Enum.Parse(typeof(ViewDuplicateOption), viewDuplicateOption);

            try
            {
                RevitServices.Transactions.TransactionManager.Instance.EnsureInTransaction(Application.Document.Current.InternalDocument);
                var viewElement = ElementBinder.GetElementFromTrace <Autodesk.Revit.DB.View>(Document);

                int    count       = 0;
                string newViewName = "";
                if (!String.IsNullOrEmpty(prefix) || !String.IsNullOrEmpty(suffix))
                {
                    newViewName = prefix + view.Name + suffix;
                }
                Autodesk.Revit.UI.UIDocument uIDocument = new Autodesk.Revit.UI.UIDocument(Document);
                var openedViews = uIDocument.GetOpenUIViews().ToList();

                if (viewElement != null)
                {
                    count++;
                    var oldViewName = viewElement.Name;
                    if (oldViewName.Equals(newViewName))
                    {
                        newView = viewElement.ToDSType(false) as View;
                    }
                    else
                    {
                        count--;
                    }
                }

                if (count == 0)
                {
                    if (!CheckUniqueViewName(newViewName))
                    {
                        throw new ArgumentException(String.Format(Properties.Resources.ViewNameExists, newViewName));
                    }
                    if (view.InternalView.CanViewBeDuplicated(Option))
                    {
                        var viewID  = view.InternalView.Duplicate(Option);
                        var viewEle = Document.GetElement(viewID) as Autodesk.Revit.DB.View;
                        newView = ElementWrapper.ToDSType(viewEle, false) as View;
                    }
                    else
                    {
                        throw new Exception(String.Format(Properties.Resources.ViewCantBeDuplicated, view.Name));
                    }

                    if (!String.IsNullOrEmpty(newViewName))
                    {
                        var param = newView.InternalView.get_Parameter(BuiltInParameter.VIEW_NAME);
                        param.Set(newViewName);
                    }
                    if (viewElement != null)
                    {
                        var shouldClosedViews = openedViews.FindAll(x => viewElement.Id == x.ViewId);
                        if (shouldClosedViews.Count > 0)
                        {
                            foreach (var v in shouldClosedViews)
                            {
                                if (uIDocument.GetOpenUIViews().ToList().Count() > 1)
                                {
                                    v.Close();
                                }
                                else
                                {
                                    throw new InvalidOperationException(string.Format(Properties.Resources.CantCloseLastOpenView, viewElement.ToString()));
                                }
                            }
                        }
                    }
                }

                ElementBinder.CleanupAndSetElementForTrace(Document, newView.InternalElement);

                RevitServices.Transactions.TransactionManager.Instance.TransactionTaskDone();
            }
            catch (Exception e)
            {
                //if (e is Autodesk.Revit.Exceptions.InvalidOperationException)
                //    throw e;
                if (newView != null)
                {
                    newView.Dispose();
                }
                throw e;
            }

            return(newView);
        }
Beispiel #43
0
        /// <summary>
        /// Gets the Chart Events page.
        /// </summary>
        /// <param name="mainPage">The main page.</param>
        /// <returns>Content Page.</returns>
        private static ContentPage GetChartEventsPage(VisualElement mainPage)
        {
            var controls = new ContentPage
            {
                Title = AppResources.OtherItem,
                Icon  = "project-32.png"
            };

            var lstControls = new ListView
            {
                ItemsSource = Variables.OtherList
            };

            Cell = new DataTemplate(typeof(TextCell));

            lstControls.BackgroundColor = Color.FromRgb(255, 255, 255);

            Cell.SetBinding(TextCell.TextProperty, "Description");
            Cell.SetBinding(TextCell.DetailProperty, "Summary");

            Cell.SetValue(TextCell.TextColorProperty, Color.Black);
            Cell.SetValue(TextCell.DetailColorProperty, Color.White);

            lstControls.ItemTemplate = Cell;


            lstControls.ItemSelected += async(sender, e) =>
            {
                ElementWrapper obj = e.SelectedItem as ElementWrapper;
                switch (obj.ToString())
                {
                case "Click Annotation":
                {
                    await mainPage.Navigation.PushAsync(new Other.ClickAnnotation());

                    break;
                }

                case "Snap Cursor ToolTip":
                {
                    await mainPage.Navigation.PushAsync(new Other.SnapCursorToolTip());

                    break;
                }

                case "ScrollPager Tool":
                {
                    await mainPage.Navigation.PushAsync(new Other.ScrollPagerTool());

                    break;
                }

                case "SubChart Tool":
                {
                    await mainPage.Navigation.PushAsync(new Other.SubChartTool());

                    break;
                }

                case "ColorLine Tool":
                {
                    await mainPage.Navigation.PushAsync(new Other.ColorLineTool());

                    break;
                }
                }
            };
            controls.Content = lstControls;
            return(controls);
        }
Beispiel #44
0
        public static List <Mapping> createNewMappings(TSF.UmlToolingFramework.Wrappers.EA.Attribute attribute, string basepath, ElementWrapper targetRootElement)
        {
            List <Mapping> returnedMappings = new List <Mapping>();

            //connectors from owned attributes
            foreach (ConnectorWrapper mappedConnector in attribute.relationships.OfType <ConnectorWrapper>())
            {
                if (!mappedConnector.taggedValues.Any(x => x.name == mappingSourcePathName && x.tagValue.ToString() != basepath))
                {
                    //get the target base path
                    ConnectorMapping connectorMapping;
                    var    targetTV       = mappedConnector.taggedValues.FirstOrDefault(x => x.name == mappingTargetPathName);
                    string targetBasePath = string.Empty;
                    if (targetTV != null)
                    {
                        targetBasePath = targetTV.tagValue.ToString();
                    }
                    if (!string.IsNullOrEmpty(targetBasePath))
                    {
                        //connectorMapping = new ConnectorMapping(mappedConnector,basepath,targetBasePath);
                    }
                    else
                    {
                        //connectorMapping = new ConnectorMapping(mappedConnector,basepath,targetRootElement);
                    }
                    //returnedMappings.Add(connectorMapping);
                }
            }
            //tagged value references from owned attributes
            foreach (TaggedValue mappedTaggedValue in attribute.taggedValues.Where(x => x.tagValue is Element))
            {
                string mappingSourcePath = KeyValuePairsHelper.getValueForKey(mappingSourcePathName, mappedTaggedValue.comment);
                string targetBasePath    = KeyValuePairsHelper.getValueForKey(mappingTargetPathName, mappedTaggedValue.comment);

                //if not filled in or corresponds to the attributeBasePath or the attributeBasePath + the name of the attribute
                if (string.IsNullOrEmpty(mappingSourcePath) || mappingSourcePath == basepath ||
                    mappingSourcePath == basepath + "." + attribute.name)
                {
                    TaggedValueMapping tagMapping;
                    if (!string.IsNullOrEmpty(targetBasePath))
                    {
                        //tagMapping = new TaggedValueMapping(mappedTaggedValue,basepath,targetBasePath);
                    }
                    else
                    {
                        //tagMapping = new TaggedValueMapping(mappedTaggedValue,basepath,targetRootElement);
                    }
                    //returnedMappings.Add(tagMapping);
                }
            }
            //add the mappings for the type of the attribute
            var attributeType = attribute.type as ElementWrapper;

            if (attributeType != null)
            {
                returnedMappings.AddRange(createOwnedMappings(attributeType, basepath + "." + attribute.name, false));
            }
            return(returnedMappings);
        }