how to add System.Component library
7 posts
• Page 1 of 1
how to add System.Component library
Hi,
I'm a new to Phalanger.
Pls tell me how to include System.ComponentModel Libraray to phalanger? This library is not added in my machine.config file.can you tell me how to add this library to run my code?
Thanks...
I'm a new to Phalanger.
Pls tell me how to include System.ComponentModel Libraray to phalanger? This library is not added in my machine.config file.can you tell me how to add this library to run my code?
Thanks...
- phalanger@codeplex
- Posts: 8
- Joined: January 7th, 2012, 8:57 pm
RE: how to add System.Component library
Types from the System.ComponentModel are implemented in the framework assembly called "System", which is added to machine.config during install. You should be able to use these types right away.
or
<? $x = new System:::ComponentModel:::DateTimeConverter; echo $x->ConvertFromString("Aug 1 2006");?>
or
<? import namespace System:::ComponentModel; $x = new DateTimeConverter; echo $x->ConvertFromString("Aug 1 2006");?>
- Lada Prosek
- Posts: 47
- Joined: January 7th, 2012, 8:52 pm
RE: how to add System.Component library
<?php
import namespace System:::Drawing;
......
........
$x=new Image("sample.image");
......
.....
?>
This will generate an error saying
Instantiation of abstract class or interface 'System:::Drawing:::Image'
import namespace System:::Drawing;
......
........
$x=new Image("sample.image");
......
.....
?>
This will generate an error saying
Instantiation of abstract class or interface 'System:::Drawing:::Image'
- nagraj@codeplex
- Posts: 24
- Joined: January 7th, 2012, 8:55 pm
RE: how to add System.Component library
The Image class is abstract.
[SerializableAttribute] [ComVisibleAttribute(true)] public abstract class Image : MarshalByRefObject, ISerializable, ICloneable, IDisposable
- Lada Prosek
- Posts: 47
- Joined: January 7th, 2012, 8:52 pm
RE: how to add System.Component library
could you give more information
- nagraj@codeplex
- Posts: 24
- Joined: January 7th, 2012, 8:55 pm
RE: how to add System.Component library
MSDN: Abstract classes act as expressions of general concepts from which more specific classes can be derived. You cannot create an object of an abstract class type; however, you can use pointers and references to abstract class types.
Image cannot be instantiated, but you can create instances of its subclasses (aka derived classes), namely Bitmap and Metafile.
This prints true twice, because the Bitmap is obviously a Bitmap and it is also an Image because Bitmap is derived from Image. You can still use Image in situations like this:
The typehint says that the function can be called with anything that is in Image, i.e. both an instance of Bitmap and an instance of Metafile would be valid arguments.
Image cannot be instantiated, but you can create instances of its subclasses (aka derived classes), namely Bitmap and Metafile.
<? $x = new System:::Drawing:::Bitmap("C:\\Windows\\Gone Fishing.bmp"); var_dump($x instanceof System:::Drawing:::Bitmap); var_dump($x instanceof System:::Drawing:::Image);?>
This prints true twice, because the Bitmap is obviously a Bitmap and it is also an Image because Bitmap is derived from Image. You can still use Image in situations like this:
function PrintImage(System:::Drawing:::Image $image) { // ... }
The typehint says that the function can be called with anything that is in Image, i.e. both an instance of Bitmap and an instance of Metafile would be valid arguments.
- Lada Prosek
- Posts: 47
- Joined: January 7th, 2012, 8:52 pm
RE: how to add System.Component library
thanks,
it got worked.
it got worked.
- nagraj@codeplex
- Posts: 24
- Joined: January 7th, 2012, 8:55 pm
7 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 17 guests