本文整理汇总了C#中IStyle.GetHashCode方法的典型用法代码示例。如果您正苦于以下问题:C# IStyle.GetHashCode方法的具体用法?C# IStyle.GetHashCode怎么用?C# IStyle.GetHashCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IStyle
的用法示例。
在下文中一共展示了IStyle.GetHashCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderGeometry
public void RenderGeometry(MultiPolygon multiPolygon, IStyle style, IFeature feature, IViewport viewport)
{
if (_bgWorker == null)
_bgWorker = new BackgroundWorker();
/*
while (_bgWorker.IsBusy) {
Thread.Sleep (00001);
}
*/
_bgWorker.RunWorkerCompleted += (sender, e) =>
{
var layer = e.Result as CALayer;
if (layer != null)
{
var styleKey = style.GetHashCode().ToString();
feature[styleKey] = layer;
}
};
_bgWorker.DoWork += delegate(object sender, DoWorkEventArgs e)
{
var layer = RenderImage(multiPolygon, style, viewport);
e.Result = layer;
};
_bgWorker.RunWorkerAsync();
}
示例2: CreateFromSharpmapStyle
public static Func<ExportContext, SharpKml.Dom.Style> CreateFromSharpmapStyle(IStyle sharpmapStyle)
{
if (sharpmapStyle == null)
throw new ArgumentNullException("sharpmapStyle");
var vectorStyle = sharpmapStyle as VectorStyle;
if (vectorStyle == null) return null;
SharpKml.Dom.Style style = null;
var install = new Action<ExportContext>(context =>
{
style = new SharpKml.Dom.Style
{
Id = sharpmapStyle.GetHashCode().ToString(CultureInfo.InvariantCulture)
};
if (vectorStyle.Line != null)
{
var lineStyle = new LineStyle();
style.Line = lineStyle;
var color = vectorStyle.Line.Color;
lineStyle.Color = new Color32(color.A, color.B, color.G, color.R);
lineStyle.ColorMode = ColorMode.Normal;
lineStyle.Width = vectorStyle.Line.Width;
}
var solidColor = ConvertToColor32(vectorStyle.Fill);
if (solidColor != null)
{
var polygonStyle = new PolygonStyle();
style.Polygon = polygonStyle;
polygonStyle.Fill = true;
polygonStyle.Color = solidColor;
}
if (vectorStyle.Symbol == null)
{
if (vectorStyle.PointSize > 0)
{
var iconStyle = new IconStyle();
var pointColor = vectorStyle.PointColor != null
? ConvertToColor32(vectorStyle.PointColor) ?? new Color32(255, 0, 0, 0)
: new Color32(255, 0, 0, 0);
iconStyle.Color = pointColor;
iconStyle.ColorMode = ColorMode.Normal;
iconStyle.Icon = new IconStyle.IconLink(Pushpins.ShadedDot);
iconStyle.Scale = vectorStyle.PointSize / 6;
style.Icon = iconStyle;
}
}
else
{
var additionalFile = SaveImagetoDisk(vectorStyle.Symbol);
Debug.Assert(additionalFile != null, "additionalFile != null");
context.AdditionalFiles.Add(additionalFile);
var iconStyle = new IconStyle
{
Icon = new IconStyle.IconLink(new Uri(context.IsKmz ? Path.GetFileName(additionalFile) : additionalFile, UriKind.Relative)),
Scale = vectorStyle.SymbolScale
};
style.Icon = iconStyle;
}
});
EventHandler endedHandler = delegate { style = null; };
return context =>
{
if (style == null && sharpmapStyle.Enabled)
{
install(context);
context.Exporter.Ended -= endedHandler;
context.Exporter.Ended += endedHandler;
}
return style;
};
}