In the secondary development of AO or AE, the interface query (QI) technology is considered to be the most basic and one of the most important technologies. Almost every GIS system, even a small GIS function module cannot use the interface query technology. In general, Qi is an explicit forced conversion in the class. See the following example. /*
* Created by sharpdevelop.
* User: noo
* Date: 2009-8-18
* Time:
*
* Interface query (QI)
*/
Using system;
Interface iapple // Apple Interface
{
String spice // fragrance Property
{
Get;
Set;
}
Void circle (); // Circle Method
}
Interface ibanana // banana Interface
{
String sweet // sweet Property
{
Get;
Set;
}
Void column (); // Column Method
}
Class fruit: iapple, ibanana // fruit class
{
Private string str1;
String iapple. Spice // note the writing method here
{
Get {return str1 ;}
Set {str1 = value ;}
}
Void iapple. Circle () // same as above
{
Console. writeline ("Apple interface member functions ");
}
Private string str2;
String ibanana. Sweet
{
Get {return str2 ;}
Set {str2 = value ;}
}
Void ibanana. Column ()
{
Console. writeline ("banana interface member function ");
}
}
Class Test
{
Static void main ()
{
Iapple papple = new fruit (); // instantiate the class of the Interface Type
Papple. Circle ();
Papple. Spice = "Sweet Apple ";
Console. writeline (papple. Spice );
Ibanana pbanana = new fruit ();
Pbanana. Column ();
Pbanana. Sweet = "sweet banana ";
Console. writeline (pbanana. Sweet );
Iapple PAPP = new fruit ();
Ibanana PBAN = PAPP as ibanana; // interface query (QI), which is an explicit forced conversion.
PBAN. Column ();
PBAN. Sweet = "sweet banana ";
Console. writeline (PBAN. Sweet );
}
} From the above example, we can see that Qi is actually very well mastered and its principle is very simple.