Ejemplo n.º 1
0
        private void Initialize(Entity entity)
        {
            ComplexEntity = entity.ActLike <IComplexEntity>();
            ComplexEntity.Ordinals.Add(1);
            ComplexEntity.Ordinals.Add(2);
            ComplexEntity.Doubles.Add(2.71828);
            ComplexEntity.Doubles.Add(3.14159);
            ComplexEntity.Related.Add(ComplexEntity);
            ComplexEntity.Related.Add(ComplexEntity);
            ComplexEntity.Other.Add(ComplexEntity);
            ComplexEntity.Other.Add(ComplexEntity);
            Entity.IsInitialized = true;
            ComplexEntity.Ordinals.Clear();
            ComplexEntity.Ordinals.Add(2);
            ComplexEntity.Ordinals.Add(3);
            ComplexEntity.Doubles.Clear();
            ComplexEntity.Doubles.Add(0.1);
            ComplexEntity.Doubles.Add(0.2);
            var otherEntity  = new Entity(new Iri("other"), Context.Object);
            var otherProduct = otherEntity.ActLike <IComplexEntity>();

            ComplexEntity.Related.Clear();
            ComplexEntity.Related.Add(otherProduct);
            ComplexEntity.Other.Clear();
            ComplexEntity.Other.Add(otherProduct);
        }
        protected override string GenerateSkeleton(IComplexEntity complexEntity)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(
                "using System.Windows;" + Environment.NewLine +
                "" + Environment.NewLine +
                "namespace {AppName}" + Environment.NewLine +
                "{" + Environment.NewLine +
                "" + Environment.NewLine +
                "	public partial class {EntityName}Window: Window"+ Environment.NewLine +
                "	{"+ Environment.NewLine +
                "" + Environment.NewLine +
                "		public {EntityName} Entity {get; set;}"+ Environment.NewLine +
                "" + Environment.NewLine +
                "		public {EntityName}Window(IRepository<{EntityName}> {EntityNameToLower}Repository, {EntityName} entity)"+
                Environment.NewLine +
                "		{"+ Environment.NewLine +
                "			InitializeComponent();"+ Environment.NewLine +
                "			Entity = entity ?? new {EntityName}();"+ Environment.NewLine +
                "" + Environment.NewLine +
                "		}"+ Environment.NewLine +
                "" + Environment.NewLine +
                "		{Handlers}"+ Environment.NewLine +
                "" + Environment.NewLine +
                "	}"+ Environment.NewLine +
                "}");
            string typeNameWithoutNamespace = complexEntity.Name;

            stringBuilder.Replace("{AppName}", typeNameWithoutNamespace);
            stringBuilder.Replace("{EntityName}", typeNameWithoutNamespace);
            stringBuilder.Replace("{EntityNameToLower}", typeNameWithoutNamespace.ToLower());
            return(stringBuilder.ToString());
        }
        protected override void Parse(string tableCreates, IComplexEntity entity)
        {
            //GetColumnName();

            /*if (entity.ComplexProperties.ContainsKey())
             * {
             *
             * }
             * else
             * {
             *  entity.ComplexProperties.Add();
             * }*/
        }
Ejemplo n.º 4
0
 protected abstract void Parse(string tableCreates, IComplexEntity entity);
Ejemplo n.º 5
0
 protected abstract string GenerateSkeleton(IComplexEntity complexEntity);