public static void ReadFromModel(this ModelXmlReader modelXmlReader, ModelApplicationBase modelNode,
                                   ModelApplicationBase readFrom, Func<string, bool> aspectNamePredicate) {
     for (int i = 0; i < readFrom.AspectCount; i++) {
         string aspect = readFrom.GetAspect(i);
         string xml = new ModelXmlWriter().WriteToString(readFrom, i);
         if (!(string.IsNullOrEmpty(xml)))
             new ModelXmlReader().ReadFromString(modelNode, aspect, xml);
     }
 }
Example #2
0
 public static bool HasAspect(this ModelApplicationBase modelApplicationBase, string aspectName)
 {
     for (int i = 0; i < modelApplicationBase.AspectCount; i++)
     {
         if (modelApplicationBase.GetAspect(i) == aspectName)
         {
             return(true);
         }
     }
     return(false);
 }
Example #3
0
 public static void ReadFromModel(this ModelXmlReader modelXmlReader, ModelApplicationBase modelNode,
                                  ModelApplicationBase readFrom, Func <string, bool> aspectNamePredicate)
 {
     for (int i = 0; i < readFrom.AspectCount; i++)
     {
         string aspect = readFrom.GetAspect(i);
         string xml    = new ModelXmlWriter().WriteToString(readFrom, i);
         if (!(string.IsNullOrEmpty(xml)))
         {
             new ModelXmlReader().ReadFromString(modelNode, aspect, xml);
         }
     }
 }
Example #4
0
        public void CreateAspectsCore(ModelApplicationBase model)
        {
            var modelXmlWriter = new ModelXmlWriter();

            for (int i = 0; i < model.AspectCount; i++)
            {
                var    xml  = modelXmlWriter.WriteToString(model, i);
                string name = GetAspectName(model.GetAspect(i));
                AspectObjects.Filter = CriteriaOperator.Parse("Name=?", name);
                if (AspectObjects.Count == 0)
                {
                    AspectObjects.Add(new AspectObject(Session)
                    {
                        Name = name
                    });
                }

                AspectObjects[0].Xml = xml;
                AspectObjects.Filter = null;
            }
        }
        public void CreateAspectsCore(ModelApplicationBase model) {
            var modelXmlWriter = new ModelXmlWriter();
            for (int i = 0; i < model.AspectCount; i++) {
                var xml = modelXmlWriter.WriteToString(model, i);
                string name = GetAspectName(model.GetAspect(i));
                AspectObjects.Filter = CriteriaOperator.Parse("Name=?", name);
                if (AspectObjects.Count == 0)
                    AspectObjects.Add(new AspectObject(Session) { Name = name });

                AspectObjects[0].Xml = xml;
                AspectObjects.Filter = null;
            }
        }