Ejemplo n.º 1
0
        public void BuilderShuldByReturnEntitiesSetCreator()
        {
            var es = new EntitiesSetBuilder <EntitiesSet>(new List <Entity>())
                     .Build();

            Assert.IsType <EntitiesSet>(es);
        }
Ejemplo n.º 2
0
        private void CreateMark()
        {
            using (CADProxy.Document.LockDocument())
            {
                using (var scope = DI.Container.BeginLifetimeScope())
                {
                    var markDTO = markService.GetMark(markID);
                    if (scope.IsRegistered(markDTO.markClass))
                    {
                        var mark = scope.Resolve(markDTO.markClass) as Mark;
                        try
                        {
                            mark.Build();
                            var entitiesSet = new EntitiesSetBuilder <MarkEntitiesSet>(mark.Entities)
                                              .AddConverter(typeof(AttributeToDBTextConverter))
                                              .SetBasePoint(mark.BasePoint)
                                              .SetJig(markDTO.markJig)
                                              .Build();
                            switch (View.SetType)
                            {
                            case OutputSet.group:
                                entitiesSet.ToGroup();
                                break;

                            case OutputSet.block:
                                entitiesSet.SetAttributeHandler += mark.SetAttributeValue;
                                var blockReference = entitiesSet.ToBlockReference("ElevMark" + markDTO.type.ToString() + markDTO.standard.ToString() + mark.Index);
                                entitiesSet.SetAttributeHandler -= mark.SetAttributeValue;
                                break;
                            }
                            Utils.FlushGraphics();
                        }
                        catch (OperationCanceledException) { }
                    }
                    else
                    {
                        throw new Exception("Brak definicji wybranej koty wysokościowej.");
                    }
                }
            }
        }