public TypeMetric CalculateFrom(TypeDeclarationSyntaxInfo typeNode, MemberMetrics memberMetrics) { TypeDeclarationSyntax syntax = (TypeDeclarationSyntax)typeNode.Syntax; TypeMetricKind metricKind = TypeMetricsCalculator.GetMetricKind(syntax); LcomMetrics lcomMetric = this.CalculateLackOfCohesion(syntax); TypeMetric typeMetric = new TypeMetric() { Name = TypeMetricsCalculator.GetDisplayName(syntax), Kind = metricKind, MemberMetrics = memberMetrics }; List <MetricResult> metricResults = new List <MetricResult>(); foreach (MetricCalculator calculator in calculators) { typeMetric.AddMetricResult(calculator.Calculate <MemberMetrics, MemberMetric>(memberMetrics)); } typeMetric.AddMetricResult(new MetricResult() { Name = MetricNames.LackOfCohesionOfMethods, Value = lcomMetric.Lcom }); typeMetric.AddMetricResult(new MetricResult() { Name = MetricNames.LackOfCohesionOfMethodsHendersonSellers, Value = lcomMetric.LcomHendersonSellers }); typeMetric.AddMetricResult(new MetricResult() { Name = MetricNames.NumberOfFields, Value = lcomMetric.NumFields }); typeMetric.AddMetricResult(new MetricResult() { Name = MetricNames.NumberOfMethods, Value = lcomMetric.NumMethods }); return(typeMetric); }
public static void AnnotateWheel(string filePath, string wheelText, string fontName = @"C:\Windows\Fonts\fuddle.ttf", double fontPointSize = 36, string pattern = "Bricks", System.Drawing.Color fillColor = new System.Drawing.Color(), System.Drawing.Color strokeColor = new System.Drawing.Color(), double strokeWidth = 1.0, System.Drawing.Color shadowColor = new System.Drawing.Color(), int imageWidth = 400, int imageHeight = 175) { if (!IsFontInstalled(fontName)) { return; } fontName = fontName.Replace(" ", "-"); using (MagickImage image = new MagickImage(MagickColors.Transparent, imageWidth, imageHeight)) { image.Settings.Font = fontName; image.Settings.StrokeWidth = strokeWidth; image.Settings.StrokeColor = strokeColor; image.Settings.Density = new Density(72, 72); image.Settings.FontPointsize = fontPointSize; var newWheelText = wheelText.Replace(" ", "\n"); try { TypeMetric typeMetric = image.FontTypeMetrics(newWheelText); while (typeMetric.TextWidth < image.Width) { image.Settings.FontPointsize++; typeMetric = image.FontTypeMetrics(wheelText); } image.Settings.FontPointsize--; image.Settings.FillPattern = new MagickImage("pattern:" + pattern); image.Annotate(wheelText, new MagickGeometry(imageWidth, imageHeight), Gravity.Center); image.Shadow(shadowColor); using (var image2 = new MagickImage(image)) { image2.Colorize(fillColor, new Percentage(30)); image2.Settings.StrokeColor = strokeColor; image2.Settings.StrokeWidth = strokeWidth; image2.Write(filePath); } } catch (MagickException) { } } }
Task <IEnumerable <T> > IRepository.FindByNearWithDistanceAsync <T>(double lat, double lng, double maxDistance, int page, int limit, bool spherical, string propertyIndex, string distaceProperty, IEnumerable <IMongoQuery> queries, TypeMetric typeMetric) { throw new NotImplementedException(); }
Task <IEnumerable <T> > IRepository.FindNearByAsync <T>(double lat, double lng, double maxDistance, IMongoSortBy sortBy, int page, int limit, string propertyName, IEnumerable <IMongoQuery> queries, TypeMetric typeMetric) { throw new NotImplementedException(); }
IEnumerable <T> IRepository.FindNearBy <T>(double lat, double lng, double maxDistance, string propertyName, IEnumerable <IMongoQuery> queries, TypeMetric typeMetric) { throw new NotImplementedException(); }