本文整理汇总了C#中Zone.MediaColor方法的典型用法代码示例。如果您正苦于以下问题:C# Zone.MediaColor方法的具体用法?C# Zone.MediaColor怎么用?C# Zone.MediaColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zone
的用法示例。
在下文中一共展示了Zone.MediaColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddZone
private void AddZone(Zone z)
{
try
{
var tbd = (from g in ZoneLayer.Graphics
where g.Attributes.ContainsKey("poi") && (Guid)g.Attributes["poi"] == Poi.Id
where g.Attributes.ContainsKey("zone") && (string)g.Attributes["zone"] == z.Title
select g).ToList();
if (tbd.Any()) return;
Execute.OnUIThread(() =>
{
z.Graphic = new Graphic();
z.Graphic.Attributes["poi"] = Poi.Id;
z.Graphic.Attributes["zone"] = z.Title;
if (IsAreaFilled)
{
if (z.Color != null)
{
z.Graphic.Symbol = new SimpleFillSymbol
{
BorderBrush = Brushes.Black,
BorderThickness = 2,
Fill = new SolidColorBrush(z.MediaColor(0x30))
};
}
var poly = new Polygon { Rings = new ObservableCollection<PointCollection> { z.Points.ToPointCollection() } };
z.Graphic.Geometry = poly;
}
else
{
if (z.Color != null)
{
z.Graphic.Symbol = new LineSymbol
{
Width = 2,
Color = new SolidColorBrush(z.MediaColor())
};
}
var poly = new Polyline { Paths = new ObservableCollection<PointCollection> { z.Points.ToPointCollection() } };
z.Graphic.Geometry = poly;
}
ZoneLayer.Graphics.Add(z.Graphic);
});
}
catch (Exception e)
{
Logger.Log("Zone Model", "Error adding zone", e.Message, Logger.Level.Error, true);
}
}