Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ImportedProjects
SVG
Commits
2261cfdb
Commit
2261cfdb
authored
Jul 02, 2014
by
Eric Domke
Browse files
Fixing Build Errors
parent
b4e8b183
Changes
3
Hide whitespace changes
Inline
Side-by-side
Source/DataTypes/SvgAspectRatioConverter.cs
View file @
2261cfdb
...
@@ -4,90 +4,94 @@ using System.ComponentModel;
...
@@ -4,90 +4,94 @@ using System.ComponentModel;
using
System.Globalization
;
using
System.Globalization
;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
Svg.DataTypes
namespace
Svg.DataTypes
{
{
//implementaton for preserve aspect ratio
//implementaton for preserve aspect ratio
public
sealed
class
SvgPreserveAspectRatioConverter
:
TypeConverter
public
sealed
class
SvgPreserveAspectRatioConverter
:
TypeConverter
{
{
public
override
object
ConvertFrom
(
ITypeDescriptorContext
context
,
System
.
Globalization
.
CultureInfo
culture
,
object
value
)
public
override
object
ConvertFrom
(
ITypeDescriptorContext
context
,
System
.
Globalization
.
CultureInfo
culture
,
object
value
)
{
{
if
(
value
==
null
)
if
(
value
==
null
)
{
{
return
new
SvgAspectRatio
();
return
new
SvgAspectRatio
();
}
}
if
(!(
value
is
string
))
if
(!(
value
is
string
))
{
{
throw
new
ArgumentOutOfRangeException
(
"value must be a string."
);
throw
new
ArgumentOutOfRangeException
(
"value must be a string."
);
}
}
SvgPreserveAspectRatio
eAlign
=
SvgPreserveAspectRatio
.
none
;
SvgPreserveAspectRatio
eAlign
=
SvgPreserveAspectRatio
.
none
;
bool
bDefer
=
false
;
bool
bDefer
=
false
;
bool
bSlice
=
false
;
bool
bSlice
=
false
;
string
[]
sParts
=
(
value
as
string
).
Split
(
new
char
[]
{
' '
},
StringSplitOptions
.
RemoveEmptyEntries
);
string
[]
sParts
=
(
value
as
string
).
Split
(
new
char
[]
{
' '
},
StringSplitOptions
.
RemoveEmptyEntries
);
int
nAlignIndex
=
0
;
int
nAlignIndex
=
0
;
if
(
sParts
[
0
].
Equals
(
"defer"
))
if
(
sParts
[
0
].
Equals
(
"defer"
))
{
{
bDefer
=
true
;
bDefer
=
true
;
nAlignIndex
++;
nAlignIndex
++;
if
(
sParts
.
Length
<
2
)
if
(
sParts
.
Length
<
2
)
throw
new
ArgumentOutOfRangeException
(
"value is not a member of SvgPreserveAspectRatio"
);
throw
new
ArgumentOutOfRangeException
(
"value is not a member of SvgPreserveAspectRatio"
);
}
}
if
(!
Enum
.
TryParse
<
SvgPreserveAspectRatio
>(
sParts
[
nAlignIndex
],
out
eAlign
))
#if Net4
throw
new
ArgumentOutOfRangeException
(
"value is not a member of SvgPreserveAspectRatio"
);
if
(!
Enum
.
TryParse
<
SvgPreserveAspectRatio
>(
sParts
[
nAlignIndex
],
out
eAlign
))
nAlignIndex
++;
throw
new
ArgumentOutOfRangeException
(
"value is not a member of SvgPreserveAspectRatio"
);
#else
eAlign
=
(
SvgPreserveAspectRatio
)
Enum
.
Parse
(
typeof
(
SvgPreserveAspectRatio
),
sParts
[
nAlignIndex
]);
#endif
if
(
sParts
.
Length
>
nAlignIndex
)
nAlignIndex
++;
{
switch
(
sParts
[
nAlignIndex
])
{
case
"meet"
:
break
;
case
"slice"
:
bSlice
=
true
;
break
;
default
:
throw
new
ArgumentOutOfRangeException
(
"value is not a member of SvgPreserveAspectRatio"
);
}
}
nAlignIndex
++;
if
(
sParts
.
Length
>
nAlignIndex
)
throw
new
ArgumentOutOfRangeException
(
"value is not a member of SvgPreserveAspectRatio"
);
SvgAspectRatio
pRet
=
new
SvgAspectRatio
(
eAlign
);
if
(
sParts
.
Length
>
nAlignIndex
)
pRet
.
Slice
=
bSlice
;
{
pRet
.
Defer
=
bDefer
;
switch
(
sParts
[
nAlignIndex
])
return
(
pRet
);
{
}
case
"meet"
:
break
;
case
"slice"
:
bSlice
=
true
;
break
;
default
:
throw
new
ArgumentOutOfRangeException
(
"value is not a member of SvgPreserveAspectRatio"
);
}
}
nAlignIndex
++;
if
(
sParts
.
Length
>
nAlignIndex
)
throw
new
ArgumentOutOfRangeException
(
"value is not a member of SvgPreserveAspectRatio"
);
public
override
bool
CanConvertFrom
(
ITypeDescriptorContext
context
,
Type
sourceType
)
SvgAspectRatio
pRet
=
new
SvgAspectRatio
(
eAlign
);
{
pRet
.
Slice
=
bSlice
;
if
(
sourceType
==
typeof
(
string
))
pRet
.
Defer
=
bDefer
;
{
return
(
pRet
);
return
true
;
}
}
return
base
.
CanConvertFrom
(
context
,
sourceType
);
public
override
bool
CanConvertFrom
(
ITypeDescriptorContext
context
,
Type
sourceType
)
}
{
if
(
sourceType
==
typeof
(
string
))
{
return
true
;
}
public
override
bool
CanConvertTo
(
ITypeDescriptorContext
context
,
Type
destinationType
)
return
base
.
CanConvertFrom
(
context
,
sourceType
);
{
}
if
(
destinationType
==
typeof
(
string
))
{
return
true
;
}
return
base
.
CanConvertTo
(
context
,
destinationType
);
public
override
bool
CanConvertTo
(
ITypeDescriptorContext
context
,
Type
destinationType
)
}
{
if
(
destinationType
==
typeof
(
string
))
{
return
true
;
}
public
override
object
ConvertTo
(
ITypeDescriptorContext
context
,
CultureInfo
culture
,
object
value
,
Type
destinationType
)
return
base
.
CanConvertTo
(
context
,
destinationType
);
{
}
return
base
.
ConvertTo
(
context
,
culture
,
value
,
destinationType
);
}
public
override
object
ConvertTo
(
ITypeDescriptorContext
context
,
CultureInfo
culture
,
object
value
,
Type
destinationType
)
}
{
return
base
.
ConvertTo
(
context
,
culture
,
value
,
destinationType
);
}
}
}
}
Source/DataTypes/SvgOrient.cs
View file @
2261cfdb
using
Svg.DataTypes
;
using
Svg.DataTypes
;
using
System.ComponentModel
;
using
System.ComponentModel
;
using
System
;
namespace
Svg
namespace
Svg
{
{
...
...
Source/Painting/SvgMarker.cs
View file @
2261cfdb
...
@@ -85,13 +85,6 @@ namespace Svg
...
@@ -85,13 +85,6 @@ namespace Svg
set
{
this
.
Attributes
[
"markerHeight"
]
=
value
;
}
set
{
this
.
Attributes
[
"markerHeight"
]
=
value
;
}
}
}
[
SvgAttribute
(
"markerUnits"
)]
public
virtual
SvgMarkerUnits
MarkerUnits
{
get
{
return
this
.
Attributes
.
GetAttribute
<
SvgMarkerUnits
>(
"markerUnits"
);
}
set
{
this
.
Attributes
[
"markerUnits"
]
=
value
;
}
}
public
SvgMarker
()
public
SvgMarker
()
{
{
MarkerUnits
=
SvgMarkerUnits
.
strokeWidth
;
MarkerUnits
=
SvgMarkerUnits
.
strokeWidth
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment