public static List<DataTemplateViewModel> GetDomainElementViewModelTemplates(BaseAttributeElementViewModel vm)
        { 
            MetaModel metaModel = vm.Element.GetMetaModel();

            return ParseFile(vm.ViewModelStore, "DomainClassValidationTemplate.xml", 
                new string[]{
                    vm.Element.Name,                         // CustomString0
                    metaModel.Namespace,                     // CustomString1
                });
        }
        public static List <DataTemplateViewModel> GetDomainClassPropertyGridViewModelTemplates(BaseAttributeElementViewModel vm)
        {
            MetaModel   metaModel = vm.Element.GetMetaModel();
            DomainClass element   = vm.Element as DomainClass;

            if (element == null)
            {
                return(null);
            }

            string examples        = "";
            bool   bReferenceFound = false;

            foreach (DomainRole role in element.RolesPlayed)
            {
                if (role.Relationship is ReferenceRelationship && !bReferenceFound)
                {
                    if (role.IsPropertyGenerator)
                    {
                        bReferenceFound = true;

                        examples += "       // EXAMLE: Custom values provider for role editor: " + "\r\n";
                        examples += "       // HINT: Don't forget to set 'Generates Double Derived' to 'True' for " + element.Name + "\r\n";
                        examples += "       protected override void CreateEditorViewModelFor" + role.PropertyName + "Role(System.Collections.Generic.List<PropertyGridEditorViewModel> collection)" + "\r\n";
                        examples += "       {" + "\r\n";
                        examples += "           /*" + "\r\n";
                        examples += "           Copy and paste from the original method " + "\r\n";
                        examples += "           */" + "\r\n\r\n";

                        examples += "           // Change:" + "\r\n";
                        examples += "           editor.DefaultValuesProvider = new LookupListEditorDefaultValuesProvider<object>(GetDefaultElements);" + "\r\n";

                        examples += "           // End of original method:" + "\r\n";
                        examples += "           collection.Add(editor);" + "\r\n" + "\r\n";

                        examples += "       }" + "\r\n";


                        examples += "       // This method returns the default values for a role view model" + "\r\n";
                        examples += "       private List<object> GetDefaultElements(LookupListEditorViewModel viewModel)" + "\r\n";
                        examples += "       {" + "\r\n";
                        examples += "           " + element.Name + " element = this.Element as " + element.Name + ";\r\n";
                        examples += "           // TODO" + "\r\n";
                        examples += "       }" + "\r\n";
                    }
                }

                if (bReferenceFound)
                {
                    break;
                }
            }

            List <DataTemplateViewModel> retVms = ParseFile(vm.ViewModelStore, "DomainClassPropertyGridTemplate.xml",
                                                            new string[] {
                vm.Element.Name,                             // CustomString0
                metaModel.Namespace,                         // CustomString1
                examples,                                    // CustomString2
            });



            DataTemplateViewModel specificVM = new DataTemplateViewModel(vm.ViewModelStore, "Specific ViewModel Properties",
                                                                         GetSpecificViewModelString(element, false));

            retVms.Add(specificVM);
            specificVM.Description = "Properties and Roles generated for Specific ViewModels...";

            return(retVms);
        }
        public static List <DataTemplateViewModel> GetDomainElementViewModelTemplates(BaseAttributeElementViewModel vm)
        {
            MetaModel metaModel = vm.Element.GetMetaModel();

            return(ParseFile(vm.ViewModelStore, "DomainClassValidationTemplate.xml",
                             new string[] {
                vm.Element.Name,                             // CustomString0
                metaModel.Namespace,                         // CustomString1
            }));
        }
        public static List<DataTemplateViewModel> GetDomainClassPropertyGridViewModelTemplates(BaseAttributeElementViewModel vm)
        {
            MetaModel metaModel = vm.Element.GetMetaModel();
            DomainClass element = vm.Element as DomainClass;
            if (element == null )
                return null;

            string examples = "";
            bool bReferenceFound = false;
            foreach (DomainRole role in element.RolesPlayed)
            {
                if (role.Relationship is ReferenceRelationship && !bReferenceFound)
                    if (role.IsPropertyGenerator)
                    {
                        bReferenceFound = true;

                        examples += "       // EXAMLE: Custom values provider for role editor: " + "\r\n";
                        examples += "       // HINT: Don't forget to set 'Generates Double Derived' to 'True' for " + element.Name + "\r\n";
                        examples += "       protected override void CreateEditorViewModelFor" + role.PropertyName + "Role(System.Collections.Generic.List<PropertyGridEditorViewModel> collection)" + "\r\n";
                        examples += "       {" + "\r\n";
                        examples += "           /*" + "\r\n";
                        examples += "           Copy and paste from the original method " + "\r\n";
                        examples += "           */" + "\r\n\r\n";

                        examples += "           // Change:" + "\r\n";
                        examples += "           editor.DefaultValuesProvider = new LookupListEditorDefaultValuesProvider<object>(GetDefaultElements);" + "\r\n";

                        examples += "           // End of original method:" + "\r\n";
                        examples += "           collection.Add(editor);" + "\r\n" + "\r\n";
                        
                        examples += "       }" + "\r\n";


                        examples += "       // This method returns the default values for a role view model" + "\r\n";
                        examples += "       private List<object> GetDefaultElements(LookupListEditorViewModel viewModel)" + "\r\n";
                        examples += "       {" + "\r\n";
                        examples += "           " + element.Name + " element = this.Element as " + element.Name + ";\r\n";
                        examples += "           // TODO" + "\r\n";
                        examples += "       }" + "\r\n";
                    }

                if (bReferenceFound)
                    break;
            }

            List<DataTemplateViewModel> retVms = ParseFile(vm.ViewModelStore, "DomainClassPropertyGridTemplate.xml",
                new string[]{
                    vm.Element.Name,                         // CustomString0
                    metaModel.Namespace,                     // CustomString1
                    examples,                                // CustomString2
                });



            DataTemplateViewModel specificVM = new DataTemplateViewModel(vm.ViewModelStore, "Specific ViewModel Properties",
                GetSpecificViewModelString(element, false));
            retVms.Add(specificVM);
            specificVM.Description = "Properties and Roles generated for Specific ViewModels...";

            return retVms;
        }