Exemplo n.º 1
0
        private static IIDConvertor[] GetConvertorInstances()
        {
            Assembly source = Assembly.GetAssembly(typeof(IIDConvertor));
            if ( source == null ) return new IIDConvertor[] { new Inferis2IDConvertor() };

            // Look for IIDConvertor classes
            ArrayList list = new ArrayList();
            IEnumerator iter = source.GetExportedTypes().GetEnumerator();
            while ( iter.MoveNext() ) {
                if ( ((Type)iter.Current).GetInterface( typeof(IIDConvertor).Name ) != null ) {
                    list.Add( System.Activator.CreateInstance(((Type)iter.Current)) );
                }
            }

            // Assign result
            IIDConvertor[] result = new IIDConvertor[list.Count];
            list.TrimToSize();
            list.CopyTo( result, 0 );
            return result;
        }
Exemplo n.º 2
0
        public MapInfo( int zoom, int x, int y, int width, int height, string origin, string export, IIDConvertor convertor )
        {
            this.signature = 0xE2E1;
            this.version = 1;
            this.zoom = zoom;

            this.x = x;
            this.y = y;
            this.width = width;
            this.height = height;

            // reserved buffer
            buffer = new byte[44];

            // strings
            originfile = new char[512];
            exportfile = new char[512];
            idconvertor = new char[128];

            SetString( ref originfile, origin );
            SetString( ref exportfile, export );
            IDConvertor = convertor.GetType();
        }
Exemplo n.º 3
0
 public IDShader( IIDConvertor idconvertor )
 {
     idc = idconvertor;
 }
Exemplo n.º 4
0
 public IDMapShader( IDMap idmap, bool diff )
 {
     this.idmap = idmap;
     this.diff = diff;
     this.idc = null;
 }
Exemplo n.º 5
0
 public IDMapShader( IDMap idmap, IIDConvertor idconvertor )
 {
     idc = idconvertor;
     this.idmap = idmap;
     this.diff = false;
 }
Exemplo n.º 6
0
 public MapInfo( int zoom, Point location, Size size, string origin, string export, IIDConvertor convertor )
     : this(zoom, location.X, location.Y, size.Width, size.Height, origin, export, convertor)
 {
 }