Ejemplo n.º 1
0
        /// <summary>
        /// Load Functions which have been defined previously
        /// </summary>
        /// <param name="item"></param>
        /*public void loadFunctionToolBoxItem(XmlNode item)
        {
            this.visualElement = new VisualElement();

            string imageName = item.SelectSingleNode("image").InnerXml;
            // Create the image element.
            Image simpleImage = new Image();
            simpleImage.Width = 75;
            simpleImage.Height = 75;

            // Create source.
            BitmapImage bi = new BitmapImage();
            // BitmapImage.UriSource must be in a BeginInit/EndInit block.
            bi.BeginInit();
            bi.UriSource = new Uri(@"/Images/"+imageName, UriKind.RelativeOrAbsolute);
            bi.EndInit();
            // Set the image source.
            simpleImage.Source = bi;

            this.visualElement.Content = simpleImage;

            string data = item.SelectSingleNode("args").OuterXml;
            XmlDocument xDoc = new XmlDocument();
            xDoc.LoadXml(data);
            this.visualElement.Data = xDoc.DocumentElement.Clone();

            string dataR = item.SelectSingleNode("argsR").OuterXml;
            xDoc = new XmlDocument();
            xDoc.LoadXml(dataR);
            this.visualElement.ReverseData = xDoc.DocumentElement.Clone();

            string vname = item.SelectSingleNode("name").InnerText;
            this.visualElement.VEName = vname;

            this.visualElement.VType = VisualElementType.Function;

        }*/
        /// <summary>
        /// Load Custom ToolBarItems which have been defined and saved previously
        /// </summary>
        /// <param name="item"></param>
        public void loadCustomisedToolBoxItem(XmlNode item)
        {
            this.visualElement = new VisualElement();

            XmlNode itemXml = item.SelectSingleNode("VisualElement/item");
            if (itemXml != null)
            {
                visualElement.ItemXML = itemXml.Clone();
                this.visualElement = xamlRenderer.render(itemXml) as VisualElement;
            }
            //visualElement.loadDataFromXaml();

            string data = item.SelectSingleNode("VisualElement/Data").InnerXml;
            XmlDocument xDoc = new XmlDocument();
            xDoc.LoadXml(data);
            this.visualElement.Data = xDoc.DocumentElement.Clone();

            string dataR = item.SelectSingleNode("VisualElement/DataR").InnerXml;
            xDoc = new XmlDocument();
            xDoc.LoadXml(dataR);
            this.visualElement.ReverseData = xDoc.DocumentElement.Clone();

            string vname = item.SelectSingleNode("VisualElement/Name").InnerText;
            this.visualElement.VEName = vname;

            string templateName = item.SelectSingleNode("Template/Name").InnerText;
            string templateAddress = item.SelectSingleNode("Template/Address").InnerXml;

            this.visualElement.templateVM.TemplateName = templateName;
            this.visualElement.templateVM.TemplateAddress = templateAddress;

            string templateCode = item.SelectSingleNode("Template/Code").InnerXml;
            xDoc = new XmlDocument();
            xDoc.LoadXml(templateCode);
            this.visualElement.templateVM.TemplateXmlNode = xDoc.DocumentElement.Clone();
            //MessageBox.Show(visualElement.Data.OuterXml+"\n\n and \n\n"+ visualElement.templateVM.TemplateXmlNode.OuterXml.ToString());

            string templateRName = item.SelectSingleNode("TemplateR/Name").InnerText;
            //string templateRAddress = item.SelectSingleNode("TemplateR/Address").InnerXml;

            this.visualElement.templateVMR.TemplateName = templateRName;
            //this.visualElement.templateVMR.TemplateAddress = templateRAddress;

            string templateRCode = item.SelectSingleNode("TemplateR/Code").InnerXml;
            xDoc = new XmlDocument();
            xDoc.LoadXml(templateRCode);
            this.visualElement.templateVMR.TemplateXmlNode = xDoc.DocumentElement.Clone();

            this.Content = visualElement;//20/6/2012

            //string tname = item.SelectSingleNode("Name").InnerText;
            //this.TName = tname;
        }
Ejemplo n.º 2
0
 public ToolboxItem(VisualElement v)
 {
     //create with values read from a file
     visualElement = (v.Clone() as VisualElement);
     visualBase = null;
     visualElement.Content = xamlRenderer.render(visualElement);
     this.Content = visualElement;//20/6/2012
 }
Ejemplo n.º 3
0
        private void VisElementCanvas_Drop(object sender, System.Windows.DragEventArgs e)
        {
            if (!string.IsNullOrEmpty(modelFile) && sourceASTL != null) //sourceASTL was tvvm (before 15/08/2012)
            {
                System.Windows.Point pos = e.GetPosition(VisElementCanvas);

                /*if (e.Data.GetDataPresent("ToolboxItem"))
                {
                    //clear canvas children
                    VisElementCanvas.Children.Clear();

                    //get toolbox item
                    ToolboxItem t = e.Data.GetData("ToolboxItem") as ToolboxItem;

                    visEl = new VisualElement();
                    visEl = (t.visualElement.Clone()) as VisualElement;//must be call by value

                    visEl.Position = pos;

                    Canvas.SetLeft(visEl, Math.Max(0, pos.X - 100 / 2));
                    Canvas.SetTop(visEl, Math.Max(0, pos.Y - 100 / 2));
                    visEl.Content = t.visualElement.Content;

                    VisElementCanvas.Children.Add(visEl);

                    //suggestions
                    visEl.abstractTree.prepare();
                    this.sourceASTL.prepare();

                    SuggesterConfig config = new SuggesterConfig();
                    config.UseNameSimSuggester = true;
                    config.UseTypeSimSuggester = true;
                    config.UseIsoRankSimSuggester = false;
                    config.UseValueSimSuggester = true;
                    config.UseStructSimSuggester = false;
                    this.visualiserSuggester = new Suggester(sourceASTL, visEl.abstractTree, config);
                    this.updateSuggestions(this.visualiserSuggester.getSuggestionsAsStrings(this.visualiserSuggester.imFeelingLucky()));

                }
                else*/
                if (e.Data.GetDataPresent("VisualElement"))
                {
                    //clear canvas children
                    VisElementCanvas.Children.Clear();

                    VisualElement temp = new VisualElement();
                    temp = (e.Data.GetData("VisualElement") as VisualElement).Clone() as VisualElement;

                    visEl = xrenderer.render(temp.ItemXML) as VisualElement; //render visual elements, no need for return valu, the notation contents will be added to same visual element 6/11/2012
                    visEl.templateVM.TemplateXmlNode = temp.templateVM.TemplateXmlNode.Clone() as XmlNode;
                    // visEl.templateVMR.TemplateXmlNode = temp.templateVMR.TemplateXmlNode.Clone() as XmlNode;
                    visEl.templateVM.TemplateName = temp.templateVM.TemplateName;
                    visEl.templateVMR.TemplateName = temp.templateVMR.TemplateName;
                    visEl.Data = temp.Data.Clone() as XmlNode;
                    //visEl.ReverseData = temp.ReverseData.Clone() as XmlNode;

                    visEl.Position = pos;

                    //prepare view box for large items
                    Viewbox vb = new Viewbox();
                    vb.MaxHeight = 180;
                    vb.MaxWidth = 180;
                    vb.StretchDirection = StretchDirection.DownOnly;
                    vb.Stretch = System.Windows.Media.Stretch.Fill;
                    vb.Child = visEl;

                    Canvas.SetLeft(vb, Math.Max(0, pos.X - 100 / 2));
                    Canvas.SetTop(vb, Math.Max(0, pos.Y - 100 / 2));

                    if (visEl != null)
                    {
                        VisElementCanvas.Children.Add(vb);

                        //suggestions
                        visEl.abstractTree.prepare();
                        this.sourceASTL.prepare();

                        SuggesterConfig config = new SuggesterConfig();
                        config.UseNameSimSuggester = true;
                        config.UseTypeSimSuggester = true;
                        config.UseIsoRankSimSuggester = false;
                        config.UseValueSimSuggester = true;
                        config.UseStructSimSuggester = false;

                        this.visualiserSuggester = new Suggester(sourceASTL, visEl.abstractTree, config);
                        this.updateSuggestions(this.visualiserSuggester.getSuggestionsAsStrings(this.visualiserSuggester.imFeelingLucky()));

                        //log event
                        logger.log("Visual Element \"" + visEl.VEName + "\" droppped on Visualisation canvas.");

                    }
                    else
                    {
                        reportMessage("Unable to render visual", ReportIcon.Error);
                    }

                }
                else if (e.Data.GetDataPresent("VisualFunction"))
                {
                    VisualFunction vf = e.Data.GetData("VisualFunction") as VisualFunction;

                    if (VisElementCanvas.Children.Count > 0)//if there exists visual element, match functions header node with the element header node
                    {
                        foreach (UIElement u in VisElementCanvas.Children)//assign same header node to the function as well
                            if (u is Viewbox)
                            {
                                if (((u as Viewbox).Child as VisualElement).templateVM.HeaderNode != null)//header node has been set
                                {
                                    //set visualfunction's target metamodel as this visual element
                                    vf.targetASTL = new AbstractLattice(((u as Viewbox).Child as VisualElement).abstractTree.Root.duplicate());
                                    //set visualfunction's source abstraction from source model
                                    vf.sourceASTL = new AbstractLattice(this.sourceASTL.getAbstractNodeAtAddress(((u as Viewbox).Child as VisualElement).templateVM.TemplateAddress).duplicate());

                                    vf.sourceRootNode = ((u as Viewbox).Child as VisualElement).templateVM.HeaderNode;

                                    Canvas.SetLeft(vf, Math.Max(0, pos.X - 100 / 2));
                                    Canvas.SetTop(vf, Math.Max(0, pos.Y - 100 / 2));

                                    VisElementCanvas.Children.Add(vf);

                                    //log event
                                    logger.log("Visual Finction droppped on Visualisation canvas.", ReportIcon.Info);

                                    break;
                                }
                                else
                                {
                                    reportMessage("Set header node for visual Element first", ReportIcon.Error);
                                }
                            }
                    }
                    else

                        reportMessage("No visual element has been set yet", ReportIcon.Error);
                }
                else if (e.Data.GetDataPresent("VisualCondition"))
                {
                    VisualCondition vc = e.Data.GetData("VisualCondition") as VisualCondition;

                    if (VisElementCanvas.Children.Count > 0)//if there exists visual element, match functions header node with the element header node
                    {
                        foreach (UIElement u in VisElementCanvas.Children)//assign same header node to the condition as well
                            if (u is Viewbox)
                            {
                                if (((u as Viewbox).Child as VisualElement).templateVM.HeaderNode != null)//header node has been set
                                {
                                    //set visualfunction's target metamodel as this visual element
                                    vc.targetASTL = new AbstractLattice(((u as Viewbox).Child as VisualElement).abstractTree.Root.duplicate());
                                    //set visualfunction's source abstraction from source model
                                    vc.sourceASTL = new AbstractLattice(this.sourceASTL.getAbstractNodeAtAddress(((u as Viewbox).Child as VisualElement).templateVM.TemplateAddress).duplicate());

                                    vc.sourceRootNode = ((u as Viewbox).Child as VisualElement).templateVM.HeaderNode;

                                    Canvas.SetLeft(vc, Math.Max(0, pos.X - 100 / 2));
                                    Canvas.SetTop(vc, Math.Max(0, pos.Y - 100 / 2));

                                    VisElementCanvas.Children.Add(vc);

                                    //log event
                                    logger.log("Visual Condition droppped on Visualisation canvas.", ReportIcon.Info);

                                    break;
                                }
                                else
                                {
                                    reportMessage("Set header node for visual Element first", ReportIcon.Error);
                                }
                            }
                    }
                    else
                        reportMessage("No visual element has been set yet", ReportIcon.Error);
                }

            }
            else
                reportMessage("Please open input model first!", ReportIcon.Error);
        }
Ejemplo n.º 4
0
        private VisualElement createSchedulingStartVisElement()
        {
            VisualElement v = new VisualElement();

            //set data
            XmlDocument xDoc = new XmlDocument();
            xDoc.LoadXml("<Start>start</Start>");

            v.Data = xDoc.DocumentElement;
            v.VEName = "/";
            v.templateVM.TemplateName = "/";

            //set data for reverse
            xDoc = new XmlDocument();
            xDoc.LoadXml("<Start>start</Start>");

            v.ReverseData = xDoc.DocumentElement;
            v.VEName = "/";
            v.templateVMR.TemplateName = "/";
            v.elementListPopup.IsOpen = true;

            Ellipse e = new Ellipse();
            e.Width = 10;
            e.Height = 10;
            e.Fill = System.Windows.Media.Brushes.Black;

            v.Content = e;

            Canvas.SetTop(v, 20);
            Canvas.SetLeft(v, 10);
            Canvas.SetZIndex(v, 1);

            return v;
        }
Ejemplo n.º 5
0
        private void SchedulingCanvas_Drop(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent("VisualElement"))
            {

                VisualElement temp = new VisualElement();
                temp = (e.Data.GetData("VisualElement") as VisualElement).Clone() as VisualElement;

                visEl = new VisualElement();
                visEl = xrenderer.render(temp.ItemXML) as VisualElement;
                //visEl.ReverseData = temp.ReverseData.Clone();
                visEl.Data = temp.Data.Clone() as XmlNode;
                visEl.ReverseData = temp.ReverseData.Clone() as XmlNode;
                visEl.templateVM.TemplateName = temp.templateVM.TemplateName;
                visEl.templateVMR.TemplateName = temp.templateVMR.TemplateName;
                visEl.templateVM.TemplateXmlNode = temp.templateVM.TemplateXmlNode.Clone() as XmlNode;
                visEl.templateVMR.TemplateXmlNode = temp.templateVMR.TemplateXmlNode.Clone() as XmlNode;

                System.Windows.Point pos = e.GetPosition(schedulingCanvas);
                visEl.Position = pos;

                //prepare view box for large items
                Viewbox vb = new Viewbox();
                vb.MaxHeight = 180;
                vb.MaxWidth = 180;
                vb.StretchDirection = StretchDirection.DownOnly;
                vb.Stretch = System.Windows.Media.Stretch.Fill;
                vb.Child = visEl;

                Canvas.SetLeft(vb, Math.Max(0, pos.X - 100 / 2));
                Canvas.SetTop(vb, Math.Max(0, pos.Y - 100 / 2));
                schedulingCanvas.Children.Add(vb);

                //log event
                logger.log("Visual Element \"" + visEl.VEName + "\" droppped on Scheduling canvas.");

                //add visual template to the repository
                templateRepo.templates.Add(visEl.templateVM);
                templateRepoR.templates.Add(visEl.templateVMR);

                //suggestions
                //visEl.abstractTree.prepare();
                //this.sourceASTL.prepare();
                //this.visualiserSuggester = new Suggester(sourceASTL, visEl.abstractTree);
                //this.updateSuggestions(this.visualiserSuggester.getSuggestionsAsStrings(this.visualiserSuggester.imFeelingLucky()));

            }
        }
Ejemplo n.º 6
0
        public void saveTemplate()
        {
            try
            {
                if (NewTemplate != null)
                {
                    foreach (UIElement u in RuleDesignerCanvas.Children)//look for functions
                        if (u.GetType().ToString().Equals("CONVErT.VisualFunction"))//add functions to templates
                        {
                            this.NewTemplate.functions.Add((u as VisualFunction).getFunctionCode());
                            this.NewTemplateR.functions.Add((u as VisualFunction).getReverseFunctionCode());
                        }

                    this.NewTemplate.insertFunctions();//put functions to the actual code
                    this.NewTemplateR.insertFunctions();
                    this.NewTemplate.checkForLeftovers();
                    this.NewTemplateR.checkForLeftovers();

                    VisualElement templateVisual = new VisualElement();

                    //templateVisual.MouseEnter += new MouseEventHandler(VisualElement_MouseEnter);
                    //this.MouseLeave += new MouseEventHandler(VisualElement_MouseLeave);

                    tempRepo.templates.Add(NewTemplate);
                    tempRepoR.templates.Add(NewTemplateR);

                    //Matches.Add(NewTemplate.TemplateName + " -> " + NewTemplateR.TemplateName);
                    templateVisual.templateVM = NewTemplate;
                    templateVisual.templateVMR = NewTemplateR;

                    string name = (NewTemplate.TemplateName + "2" + NewTemplateR.TemplateName);
                    templateVisual.VEName = name;

                    templateVisual.Content = ruleContent.Content;
                    Matches.Add(templateVisual);

                    NewTemplate = null;
                    NewTemplateR = null;

                    ReportStatusBar.ShowStatus("Transformation rule saved.", ReportIcon.OK);

                    //log event
                    logger.log("Rule \"" + LHS.VEName + "\" <-> \"" + RHS.VEName + "\" created.", ReportIcon.Info);

                    //update suggestions
                    prepareSuggestions();
                }
                else
                    ReportStatusBar.ShowStatus("No template has been defined yet!", ReportIcon.Error);

            }
            catch (Exception ex)
            {
                ReportStatusBar.ShowStatus(ex.ToString(), ReportIcon.Error);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// This function implements the action to be perfomed when a suggestion is accepted
        /// </summary>
        /// <param name="sg">Suggestion to be accepted</param>
        /// <returns></returns>
        public bool acceptSuggestion(Suggestion sg)
        {
            VisualElement vs = new VisualElement();
            VisualElement vt = new VisualElement();

            if ((sourceVisualElements.Count > 0) && (targetVisualElements.Count > 0))
            {

                vs = findVisualElementInListByAddress(sourceVisualElements, sg.LHS);
                vt = findVisualElementInListByAddress(targetVisualElements, sg.RHS);

                if ((vs != null)&&(vt != null))// source and target notations exist
                {
                    //update weights in Suggester
                    this.mapperSuggester.retrieveSuggestion(sg.SuggestionString, "ACCEPT");

                    vs = vs.Clone() as VisualElement; //duplicate element not to mess with original one.
                    vt = vt.Clone() as VisualElement; //duplicate

                    vt.processVisual_VisualNotationDrop(vs,this); //like dropping a visual element on another in Mapper

                    return true;
                }
                else if ((vs == null) && (vt == null))// source and target notations do not exist
                {
                    //look for internal elements of the visualisation
                    //when this happens, I have my source and target visualisations in LHS and RHS
                    if ((NewTemplate != null) && (NewTemplateR != null))
                    {
                        bool check = true;

                        string targetMatch = sg.RHS;
                        string sourceMatch = sg.LHS;
                        string targetElementValue = "";
                        string sourceElementValue = "";

                        AbstractTreeLatticeNode lhsNode = LHS.abstractTree.getAbstractNodeAtAddress(NewTemplate.TemplateName + "/" + sg.LHS);
                        if ((lhsNode != null) && (lhsNode.Values.Count > 0))
                        {
                            sourceElementValue = lhsNode.Values[0];
                        }

                        AbstractTreeLatticeNode rhsNode = RHS.abstractTree.getAbstractNodeAtAddress(NewTemplateR.TemplateName + "/" + sg.RHS);
                        if ((rhsNode != null) && (rhsNode.Values.Count > 0))
                        {
                            targetElementValue = rhsNode.Values[0];
                        }

                        if (!String.IsNullOrEmpty(targetElementValue))
                            this.NewTemplate.updateXmlNodeByExactValue(targetMatch, sourceMatch, targetElementValue);
                        else
                        {
                            check = false;
                            ReportStatusBar.ShowStatus("Problem is finding element -> Target element value in Mapper.acceptSuggestion(...)", ReportIcon.Error);
                        }
                        //for reverse
                        if (!String.IsNullOrEmpty(sourceElementValue))
                            this.NewTemplateR.updateXmlNodeByExactValue(sourceMatch, targetMatch, sourceElementValue);
                        else
                        {
                            check = false;
                            ReportStatusBar.ShowStatus("Problem is finding reverse element -> Source element value in Mapper.acceptSuggestion(...)", ReportIcon.Error);
                        }

                        if (check == true)
                        {
                            //update weights in Suggester
                            Suggestion sgTemp = new Suggestion(lhsNode.Address, rhsNode.Address, this);//the previouse suggestion has been alltered and the visual element name is removed, therefore a new one is temporarily generated.
                            this.mapperSuggester.retrieveSuggestion(sgTemp.SuggestionString, "ACCEPT");
                        }
                        return check;
                    }
                }
            }

            //if we are here then the suggestion is for internal elements
            //or there is an error -> mapping notation to internal elements or vice versa

            return false;
        }
Ejemplo n.º 8
0
        public void processVisual_VisualNotationDrop(VisualElement source, DependencyObject pWindow)
        {
            if (pWindow is Mapper)//double check
            {
                (pWindow as Mapper).ReportStatusBar.ShowStatus("Mapping " + source.Data.Name + " -> " + this.Data.Name, ReportIcon.Info);

                XSLTTemplate tem = new XSLTTemplate();
                Element header = new Element();
                header.Name = source.Data.Name;

                tem.HeaderNode = new TreeNodeViewModel(header);
                tem.TemplateXmlNode = this.Data.Clone() as XmlNode;

                (pWindow as Mapper).NewTemplate = tem;
                (pWindow as Mapper).sourceData = source.Data;

                //for reverse
                this.ReverseData = source.Data.Clone() as XmlNode;
                this.templateVMR.TemplateName = this.Data.Name.Clone() as string;

                (pWindow as Mapper).NewTemplateR = this.templateVMR;
                (pWindow as Mapper).NewTemplateR.TemplateName = templateVMR.TemplateName.Clone() as string;

                //suggester initiation
                source.abstractTree.prepare();
                this.abstractTree.prepare();
                (pWindow as Mapper).mapperSuggester = new Suggester(source.abstractTree, this.abstractTree);

                (pWindow as Mapper).updateSuggestions((pWindow as Mapper).mapperSuggester.getSuggestionsAsStrings((pWindow as Mapper).mapperSuggester.imFeelingLucky()), false);

                //MessageBox.Show("Reverse Data: \n\n"+ReverseData.OuterXml);
                //maybe do this for source as well
                //make sure it does not overright the model to visualisation reverse code

                //move elements to Mapper rule designer
                (pWindow as CONVErT.Mapper).RuleDesignerCanvas.Children.Clear();

                (pWindow as CONVErT.Mapper).LHS = source.Clone() as VisualElement;
                (pWindow as CONVErT.Mapper).RHS = this.Clone() as VisualElement;

                (pWindow as CONVErT.Mapper).LHS.Content = (pWindow as Mapper).renderer.render((pWindow as CONVErT.Mapper).LHS);
                (pWindow as CONVErT.Mapper).RHS.Content = (pWindow as Mapper).renderer.render((pWindow as CONVErT.Mapper).RHS);

                Canvas.SetTop((pWindow as CONVErT.Mapper).LHS, 40);
                Canvas.SetLeft((pWindow as CONVErT.Mapper).LHS, 40);

                Canvas.SetTop((pWindow as CONVErT.Mapper).RHS, 40);
                Canvas.SetLeft((pWindow as CONVErT.Mapper).RHS, 470);

                (pWindow as CONVErT.Mapper).RuleDesignerCanvas.Children.Add((pWindow as CONVErT.Mapper).LHS);
                (pWindow as CONVErT.Mapper).RuleDesignerCanvas.Children.Add((pWindow as CONVErT.Mapper).RHS);

                //log event
                (pWindow as Mapper).logger.log("\"" + source.Data.Name + "\" was dropped on \"" + this.Data.Name + "\"", ReportIcon.OK);
                (pWindow as Mapper).RuleDesignStatusBar.ShowStatus("Rule : " + source.Data.Name + " -> " + this.Data.Name, ReportIcon.Info);
            }
        }
Ejemplo n.º 9
0
        public object Clone()
        {
            VisualElement v = new VisualElement();

            if (this.Data != null)
                v.Data = (this.Data.Clone()) as XmlNode;

            if (this.Trans != null)
                v.Trans = (this.Trans.Clone()) as XmlNode;

            if (this.ItemXML != null)
                v.ItemXML = (this.ItemXML.Clone()) as XmlNode;

            if (!String.IsNullOrEmpty(this.VEName))
                v.VEName = (this.VEName.Clone()) as string;

            if (this.ReverseData != null)
                v.ReverseData = (this.ReverseData.Clone()) as XmlNode;

            if (!String.IsNullOrEmpty(this.templateVM.TemplateName))
                v.templateVM.TemplateName = this.templateVM.TemplateName.Clone() as string;

            if (this.templateVM.TemplateXmlNode != null)
                v.templateVM.TemplateXmlNode = this.templateVM.TemplateXmlNode.Clone();

            if (!String.IsNullOrEmpty(this.templateVMR.TemplateName))
                v.templateVMR.TemplateName = this.templateVMR.TemplateName.Clone() as string;

            if (this.templateVMR.TemplateXmlNode != null)
                v.templateVMR.TemplateXmlNode = this.templateVMR.TemplateXmlNode.Clone();

            if (this.VAddress != null)
                v.VAddress = this.VAddress.Clone() as string;

            if (this.viewType != null)
                v.viewType = this.viewType;

            return v;
        }