Beispiel #1
0
        public IfcGeometricRepresentationContext GeometricRepresentationContext(ContextIdentifier nature)
        {
            IfcGeometricRepresentationContext result = null;

            if (mContexts.TryGetValue(nature, out result))
            {
                return(result);
            }
            string type      = "Model";
            int    dimension = 3;

            if (nature == ContextIdentifier.Annotation)
            {
                type = "Annotation";
            }

            result = new IfcGeometricRepresentationContext(mDatabase, dimension, mDatabase.Tolerance)
            {
                ContextType = type
            };
            IfcContext context = mDatabase.Context;

            if (context != null)
            {
                context.addRepresentationContext(result);
            }
            mContexts.Add(nature, result);
            return(result);
        }
Beispiel #2
0
 public static RuleSetValidationResult NewRuleSetValidationMessageResult(this RuleSet ruleSet, IObjectSpace objectSpace, string messageTemplate, ContextIdentifier contextIdentifier, object objectTarget, Type targeObjecttType) {
     var rule = new RuleMessage(contextIdentifier, targeObjecttType);
     rule.Properties.SkipNullOrEmptyValues = false;
     rule.Properties.CustomMessageTemplate = messageTemplate;
     Validator.RuleSet.RegisteredRules.Add(rule);
     RuleSetValidationResult validationResult;
     using (objectSpace.CreateParseCriteriaScope()) {
         validationResult = Validator.RuleSet.ValidateTarget(objectSpace, objectTarget, contextIdentifier);
     }
     Validator.RuleSet.RegisteredRules.Remove(rule);
     return validationResult;
 }
Beispiel #3
0
        public override string GetStepParameters()
        {
            var parameters = new List <string>();

            parameters.Add(ContextIdentifier != null ? ContextIdentifier.ToStepValue() : "$");
            parameters.Add(ContextType != null ? ContextType.ToStepValue() : "$");
            parameters.Add(CoordinateSpaceDimension != null ? CoordinateSpaceDimension.ToStepValue() : "$");
            parameters.Add(Precision != null ? Precision.ToStepValue() : "$");
            parameters.Add(WorldCoordinateSystem != null ? WorldCoordinateSystem.ToStepValue() : "$");
            parameters.Add(TrueNorth != null ? TrueNorth.ToStepValue() : "$");

            return(string.Join(", ", parameters.ToArray()));
        }
Beispiel #4
0
        public override string GetStepParameters()
        {
            var parameters = new List <string>();

            parameters.Add(ContextIdentifier != null ? ContextIdentifier.ToStepValue() : "$");
            parameters.Add(ContextType != null ? ContextType.ToStepValue() : "$");
            parameters.Add("*");
            parameters.Add("*");
            parameters.Add("*");
            parameters.Add("*");
            parameters.Add(ParentContext != null ? ParentContext.ToStepValue() : "$");
            parameters.Add(TargetScale != null ? TargetScale.ToStepValue() : "$");
            parameters.Add(TargetView.ToStepValue());
            parameters.Add(UserDefinedTargetView != null ? UserDefinedTargetView.ToStepValue() : "$");

            return(string.Join(", ", parameters.ToArray()));
        }
        private static IEnumerable<QueryMessage> QueriesInternal() {
            ContextIdentifier ctx = new ContextIdentifier(DateTime.UtcNow, 1);

            yield return new DbReaderQueryMessage() {
                Context = new ExecutionContext(ctx, "GET /test.aspx"),
                Performance = new PerformanceData() {TotalTime = 10},
                Query = new Query() {CommandText = "SELECT ..."},
                RecordCount = 10
            };

            yield return new DbReaderQueryMessage() {
                Context = new ExecutionContext(ctx, "GET /test.aspx"),
                Performance = new PerformanceData() {TotalTime = 10},
                Query = new Query() {CommandText = "SELECT ..."},
                RecordCount = 10
            };

            yield return new DbReaderQueryMessage() {
                Context = new ExecutionContext(ctx, "GET /test.aspx"),
                Performance = new PerformanceData() {TotalTime = 10},
                Query = new Query() {CommandText = "SELECT ..."},
                RecordCount = 10
            };

            yield return new DuplicateQueryMessage {
                Context = new ExecutionContext(ctx, "GET /test.aspx"),
                Performance = new AggregatePerformanceData {TotalTime = 10},
                Query = new AggregateQuery() {CommandText = "SELECT ..."},
                NumberOfQueries = 6
            };

             yield return new DbReaderQueryMessage() {
                Context = new ExecutionContext(ctx, "GET /test.aspx"),
                Performance = new PerformanceData() {TotalTime = 10},
                Query = new Query() {CommandText = "SELECT ..."},
                RecordCount = 10
            };
        } 
 /// <summary>
 /// Initializes a new instance of the <see cref="T:System.Object"/> class.
 /// </summary>
 public DbContextWrapper(ContextIdentifier id, DbContext context) : this() {
     this.Id = id;
     this._instance = new WeakReference<DbContext>(context); 
 }
Beispiel #7
0
        public static RuleSetValidationResult NewRuleSetValidationMessageResult(this RuleSet ruleSet, IObjectSpace objectSpace, string messageTemplate, ContextIdentifier contextIdentifier, object objectTarget, Type targeObjecttType)
        {
            var rule = new RuleMessage(contextIdentifier, targeObjecttType);

            rule.Properties.SkipNullOrEmptyValues = false;
            rule.Properties.CustomMessageTemplate = messageTemplate;
            Validator.RuleSet.RegisteredRules.Add(rule);
            RuleSetValidationResult validationResult;

            using (objectSpace.CreateParseCriteriaScope()) {
                validationResult = Validator.RuleSet.ValidateTarget(objectSpace, objectTarget, contextIdentifier);
            }
            Validator.RuleSet.RegisteredRules.Remove(rule);
            return(validationResult);
        }