<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591;1587;1570;1572;1573;1574</NoWarn>
- <DefineConstants>_DESIGN_MODE;_MEASURE_TIME</DefineConstants>
+ <DefineConstants>DESIGN_MODE;_MEASURE_TIME;_DEBUG_HIGHLIGHT_FOCUS</DefineConstants>
<EnableDefaultItems>false</EnableDefaultItems>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<!--<AllowUnsafeBlocks>true</AllowUnsafeBlocks>-->
</ItemGroup>
<ItemGroup>
- <Content Include="$(SolutionDir)Images\crow.png" Pack="true" PackagePath="" />
+ <Content Include="..\Images\crow.png" Pack="true" PackagePath="" />
<Compile Include="src\**\*.cs" Exclude="src\Mono.Cairo\NativeMethods-internal.cs" />
<EmbeddedResource Include="Templates\*.*">
<LogicalName>Crow.%(Filename).template</LogicalName>
public SvgPicture (string path) : base(path) {}
#endregion
- void load (Interface iFace)
- {
+ bool load (Interface iFace)
+ {
+ if (string.IsNullOrEmpty(Path))
+ return false;
if (iFace.sharedPictures.ContainsKey (Path)) {
sharedPicture sp = iFace.sharedPictures [Path];
hSVG = (Rsvg.Handle)sp.Data;
Dimensions = sp.Dims;
- return;
+ return true;
}
using (Stream stream = iFace.GetStreamFromPath (Path))
load (stream);
iFace.sharedPictures [Path] = new sharedPicture (hSVG, Dimensions);
+ return true;
}
void load (Stream stream) {
using (BinaryReader sr = new BinaryReader (stream)) {
public override void SetAsSource (Interface iFace, Context ctx, Rectangle bounds = default(Rectangle))
{
if (hSVG == null)
- load (iFace);
+ if (!load (iFace))
+ return;
float widthRatio = 1f;
float heightRatio = 1f;
public override void Paint (Interface iFace, Context gr, Rectangle rect, string subPart = "")
{
if (hSVG == null)
- load (iFace);
+ if (!load (iFace))
+ return;
float widthRatio = 1f;
float heightRatio = 1f;
<Project>
<PropertyGroup>
- <SolutionDir>$(MSBuildThisFileDirectory)</SolutionDir>
<OutputPath>$(SolutionDir)build\$(Configuration)\</OutputPath>
<IntermediateOutputPath>$(SolutionDir)build\obj\$(Configuration)\</IntermediateOutputPath>
<License>MIT</License>