Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version
Go to top

User-driven applications

, 10 Apr 2010
User-driven applications are the programs in which full control is given to the users. Designers of such programs are responsible only for developing an instrument for solving some task, but they do not enforce users to work with this instrument according with a predefined scenario.
TheoryOfUserDrivenApplications.zip
TheoryOfUserDrivenApplications
TheoryOfUserDrivenApplications
bin
Debug
TheoryOfUserDrivenApplications.vshost.exe
Release
MoveGraphLibrary.dll
TheoryOfUserDrivenApplications.bin
TheoryOfUserDrivenApplications.exe
TheoryOfUserDrivenApplications.vshost.exe
Properties
Settings.settings
Resources
ArrowDown.bmp
ArrowUp.bmp
DELETE.BMP
Hangar.bmp
Lock.bmp
palette_.bmp
RuralHouse.bmp
RuralLeftPlus.bmp
RuralRightPlus.bmp
SimpleHouse.bmp
User_driven_applications.doc
User_driven_applications.pdf
using System;
using System .Collections .Generic;
using System .Drawing;
using System .Windows .Forms;
using System .IO;
using Microsoft .Win32;

using MoveGraphLibrary;

namespace UserDrivenApplications
{
    // the house will be 1 - 3 store building 
    // 1 - 5 windows wide and NO door
    // the roof top can be only in the middle, but can move up and down
    // L and R point on the slopes can be moved in all directions, causing the mirror movement of another point
    // min distance of L (R) points to the sides;
    // min distance of L (R) points from rc, roof top and line between roof top and corner
    //
    public class RuralHouse : Building
    {
        int version = 606;
        Rectangle rcHouse;      // points 0 - 1 - 2 - 3
        Point ptPien,           // point 4
              ptSlopeL,         // point 5
              ptSlopeR;         // point 6
        int roomSize = 18;
        int windowSize = 10;
        int smallWindowSize = 6;
        int minRoofH = 16;
        int minCornerDist = 4;  // minimum horizontal distance between the corner on the roof (ptSlopeR or ptSlopeL) and the houses's side
        // minimum vertical distance between the same points and the ptPien

        int minHouseHeight, minHouseWidth;
        int maxHouseHeight, maxHouseWidth, maxRoofH;

        // -------------------------------------------------
        public RuralHouse (Rectangle rc, int roofH, Size sizeSlopeShift, Color [] clrs)
        {
            houseType = HouseType .Rural;
            SetColors (clrs);
            DefaultSizes ();
            rcHouse = new Rectangle (rc .Left, rc .Top,
                                     Math .Min (Math .Max (minHouseWidth, rc .Width), maxHouseWidth),
                                     Math .Min (Math .Max (minHouseHeight, rc .Height), maxHouseHeight));
            roofH = Math .Min (Math .Max (minRoofH, roofH), maxRoofH);
            ptPien = new Point ((rcHouse .Left + rcHouse .Right) / 2, rcHouse .Top - roofH);

            int dx = Math .Abs (sizeSlopeShift .Width);
            int dy = Math .Abs (sizeSlopeShift .Height);
            Point ptNew_R = new Point (ptPien .X + dx, ptPien .Y + dy);
            Point ptRT = new Point (rcHouse .Right, rcHouse .Top);
            Point ptOnOuterSide = new Point (rcHouse .Right, ptPien .Y);
            if (minCornerDist <= dx && dx <= rcHouse .Width / 2 - minCornerDist &&
                minCornerDist <= dy && dy <= RoofHeight - minCornerDist &&
                Auxi_Geometry .SameSideOfLine (ptRT, ptPien, ptOnOuterSide, ptNew_R))
            {
                ptSlopeR = ptNew_R;
                ptSlopeL = new Point (ptPien .X - dx, ptSlopeR .Y);
            }
            else
            {
                DefaultSlopeCorners ();
            }
        }
        // -------------------------------------------------
        public RuralHouse (Rectangle rc, int roofH, Color [] clrs)
            : this (rc, roofH, new Size (rc .Width / 3, roofH / 3), clrs)
        {
        }
        // -------------------------------------------------
        public RuralHouse (Point ptLT, Size sizeHouse, int roofH, Color [] clrs)
            : this (new Rectangle (ptLT, sizeHouse), roofH, clrs)
        {
        }
        // -------------------------------------------------        DefaultSizes
        public void DefaultSizes ()
        {
            minHouseHeight = roomSize;
            minHouseWidth = 2 * roomSize;
            maxHouseHeight = roomSize * 3 + 4;
            maxHouseWidth = roomSize * 5 + 4;

            maxRoofH = maxHouseHeight;
        }
        // -------------------------------------------------        DefaultSlopeShift
        public Size DefaultSlopeShift
        {
            get { return (new Size (rcHouse .Width / 3, RoofHeight / 3)); }
        }
        // -------------------------------------------------        DefaultSlopeCorners
        public void DefaultSlopeCorners ()
        {
            int dx = rcHouse .Width / 3;
            int dy = RoofHeight / 3;
            ptSlopeL = new Point (ptPien .X - dx, ptPien .Y + dy);
            ptSlopeR = new Point (ptPien .X + dx, ptPien .Y + dy);
        }
        // -------------------------------------------------        Location
        public override Point Location ()
        {
            return (rcHouse .Location);
        }
        // -------------------------------------------------        RectAround
        public override RectangleF RectAround ()
        {
            return (new Rectangle (rcHouse .Left, ptPien .Y, rcHouse .Width, rcHouse .Bottom - ptPien .Y));
        }
        // -------------------------------------------------        MainHouse
        public Rectangle MainHouse
        {
            get { return (rcHouse); }
        }
        // -------------------------------------------------        RoofHeight
        public int RoofHeight
        {
            get { return (rcHouse .Top - ptPien .Y); }
        }
        // -------------------------------------------------        Pien
        public Point Pien
        {
            get { return (ptPien); }
            set
            {
                int cy = Math .Min (Math .Max (rcHouse .Top - maxRoofH, value .Y), rcHouse .Top - minRoofH);
                ptPien = new Point ((rcHouse .Left + rcHouse .Right) / 2, cy);
                DefineCover ();
            }
        }
        // -------------------------------------------------        SlopeShift
        // shows the distance of both slope points from the pien; both cx and cy are shown as positive numbers
        public Size SlopeShift
        {
            get { return (new Size (ptSlopeR .X - ptPien .X, ptSlopeR .Y - ptPien .Y)); }
            set
            {
                int dx = Math .Abs (value .Width);
                int dy = Math .Abs (value .Height);
                Point ptNew_R = new Point (ptPien .X + dx, ptPien .Y + dy);
                Point ptRT = new Point (rcHouse .Right, rcHouse .Top);
                Point ptOnOuterSide = new Point (rcHouse .Right, ptPien .Y);
                if (minCornerDist <= dx && dx <= rcHouse .Width / 2 - minCornerDist &&
                    minCornerDist <= dy && dy <= RoofHeight - minCornerDist &&
                    Auxi_Geometry .SameSideOfLine (ptRT, ptPien, ptOnOuterSide, ptNew_R))
                {
                    ptSlopeR = ptNew_R;
                    ptSlopeL = new Point (ptPien .X - dx, ptSlopeR .Y);
                    DefineCover ();
                }
            }
        }
        // -------------------------------------------------        Copy
        public override Building Copy (Point ptLT)
        {
            RuralHouse houseNew = new RuralHouse (new Rectangle (ptLT, MainHouse .Size), RoofHeight, SlopeShift, GetColors ());
            return ((Building) houseNew);
        }
        // -------------------------------------------------        Draw
        public override void Draw (Graphics grfx)
        {
            Rectangle rc;
            int nSpace;

            grfx .FillRectangle (brushHouse, rcHouse);
            grfx .DrawRectangle (penEdge, rcHouse);
            Point [] ptsRoof = { rcHouse .Location, ptSlopeL, ptPien, ptSlopeR, new Point (rcHouse .Right, rcHouse .Top) };
            grfx .FillPolygon (brushRoof, ptsRoof);
            grfx .DrawPolygon (penEdge, ptsRoof);

            // windows
            int nRoomPerFloor = rcHouse .Width / roomSize;
            int roomWidth = rcHouse .Width / nRoomPerFloor;
            int nWindowMargin_W = (roomWidth - windowSize) / 2;
            int nStore = rcHouse .Height / roomSize;
            int roomHeight = rcHouse .Height / nStore;
            int nWindowMarginH = (roomHeight - windowSize) / 2;

            int cxL = rcHouse .Left;
            int cyT = rcHouse .Top;
            for (int i = 0; i < nStore; i++)
            {
                for (int j = 0; j < nRoomPerFloor; j++)
                {
                    rc = new Rectangle (cxL + j * roomWidth + nWindowMargin_W, cyT + i * roomHeight + nWindowMarginH, windowSize, windowSize);
                    grfx .FillRectangle (brushWindow, rc);
                    grfx .DrawRectangle (penEdge, rc);
                }
            }

            // windows on roof
            nSpace = smallWindowSize * 2 / 3;
            rc = new Rectangle (ptPien .X - (smallWindowSize + nSpace / 2),
                                rcHouse .Top - (smallWindowSize + nSpace), smallWindowSize, smallWindowSize);
            grfx .FillRectangle (brushWindow, rc);
            grfx .DrawRectangle (penEdge, rc);
            rc = new Rectangle (ptPien .X + nSpace / 2,
                                rcHouse .Top - (smallWindowSize + nSpace), smallWindowSize, smallWindowSize);
            grfx .FillRectangle (brushWindow, rc);
            grfx .DrawRectangle (penEdge, rc);
        }
        // -------------------------------------------------        DefineCover
        // 0 - LT corner
        // 1 - RT corner
        // 2 - RB corner
        // 3 - LB corner
        // 4 - pien
        // 5 - on left slope
        // 6 - on right slope
        // 7 - left side
        // 8 - ceiling
        // 9 - right side
        // 10 - floor
        // 11 - inner area
        //
        public override void DefineCover ()
        {
            CoverNode [] nodes = new CoverNode [12];

            nodes [0] = new CoverNode (0, new PointF (rcHouse .Left, rcHouse .Top), Cursors .SizeNWSE);
            nodes [1] = new CoverNode (1, new PointF (rcHouse .Right, rcHouse .Top), Cursors .SizeNESW);
            nodes [2] = new CoverNode (2, new PointF (rcHouse .Right, rcHouse .Bottom), Cursors .SizeNWSE);
            nodes [3] = new CoverNode (3, new PointF (rcHouse .Left, rcHouse .Bottom), Cursors .SizeNESW);
            nodes [4] = new CoverNode (4, ptPien, Cursors .SizeNS);
            nodes [5] = new CoverNode (5, ptSlopeL);
            nodes [6] = new CoverNode (6, ptSlopeR);
            nodes [7] = new CoverNode (7, new Point (rcHouse .Left, rcHouse .Top), new Point (rcHouse .Left, rcHouse .Bottom), Cursors .SizeWE);
            nodes [8] = new CoverNode (8, new Point (rcHouse .Left, rcHouse .Top), new Point (rcHouse .Right, rcHouse .Top), Cursors .SizeNS);
            nodes [9] = new CoverNode (9, new Point (rcHouse .Right, rcHouse .Top), new Point (rcHouse .Right, rcHouse .Bottom), Cursors .SizeWE);
            nodes [10] = new CoverNode (10, new Point (rcHouse .Left, rcHouse .Bottom), new Point (rcHouse .Right, rcHouse .Bottom), Cursors .SizeNS);
            nodes [11] = new CoverNode (11, new Point [] { new Point (rcHouse .Left, rcHouse .Top), ptSlopeL, ptPien, ptSlopeR, 
                                                           new Point (rcHouse .Right, rcHouse .Top), new Point (rcHouse .Right, rcHouse .Bottom),
                                                           new Point (rcHouse .Left, rcHouse .Bottom) });
            cover = new Cover (nodes);
        }
        // -------------------------------------------------        Move
        public override void Move (int dx, int dy)
        {
            rcHouse .X += dx;
            rcHouse .Y += dy;
            ptPien += new Size (dx, dy);
            ptSlopeL += new Size (dx, dy);
            ptSlopeR += new Size (dx, dy);
        }
        // -------------------------------------------------        MoveCeiling
        private void MoveCeiling (int cy)
        {
            rcHouse .Y += cy;
            rcHouse .Height -= cy;
            ptPien .Y += cy;
            ptSlopeL .Y += cy;
            ptSlopeR .Y += cy;
            DefineCover ();
        }
        // -------------------------------------------------        MoveFloor
        private void MoveFloor (int cy)
        {
            rcHouse .Height += cy;
            DefineCover ();
        }
        // -------------------------------------------------        MoveLeftSide
        private void MoveLeftSide (int cx)
        {
            int cxToSide = ptSlopeL .X - rcHouse .Left;
            rcHouse .X += cx;
            rcHouse .Width -= cx;
            ptPien .X = (rcHouse .Left + rcHouse .Right) / 2;
            ptSlopeL .X += cx;
            Point ptLT = new Point (rcHouse .Left, rcHouse .Top);
            Point ptOnOuterSide = new Point (rcHouse .Left, ptPien .Y);
            while (!Auxi_Geometry .SameSideOfLine (ptLT, ptPien, ptOnOuterSide, ptSlopeL))
            {
                ptSlopeL .X--;
            }
            ptSlopeR .X = ptPien .X + (ptPien .X - ptSlopeL .X);
            DefineCover ();
        }
        // -------------------------------------------------        MoveRightSide
        private void MoveRightSide (int cx)
        {
            int cxToSide = rcHouse .Right - ptSlopeR .X;
            rcHouse .Width += cx;
            ptPien .X = (rcHouse .Left + rcHouse .Right) / 2;
            ptSlopeR .X += cx;
            Point ptRT = new Point (rcHouse .Right, rcHouse .Top);
            Point ptOnOuterSide = new Point (rcHouse .Right, ptPien .Y);
            while (!Auxi_Geometry .SameSideOfLine (ptRT, ptPien, ptOnOuterSide, ptSlopeR))
            {
                ptSlopeR .X++;
            }
            ptSlopeL .X = rcHouse .Left + (rcHouse .Right - ptSlopeR .X);
            DefineCover ();
        }
        // -------------------------------------------------        MoveNode
        // this move depends on individual restrictions
        // while changing the  width of the house I'll try to keep the point 
        // on the roof slope at the same distance from the side
        public override bool MoveNode (int i, int cx, int cy, Point ptM, MouseButtons catcher)
        {
            bool bRet = false;

            if (catcher == MouseButtons .Left)
            {
                Point ptOnOuterSide, ptNew, ptLT, ptRT;
                int cxNew, cyNew, hNew, wNew;

                switch (i)
                {
                    case 0:         // Left Top corner of the house
                        hNew = rcHouse .Height - cy;
                        if (minHouseHeight <= hNew && hNew <= maxHouseHeight)
                        {
                            MoveCeiling (cy);
                        }
                        wNew = rcHouse .Width - cx;
                        if (minHouseWidth <= wNew && wNew <= maxHouseWidth)
                        {
                            MoveLeftSide (cx);
                        }
                        break;

                    case 1:      // Right Top corner
                        hNew = rcHouse .Height - cy;
                        if (minHouseHeight <= hNew && hNew <= maxHouseHeight)
                        {
                            MoveCeiling (cy);
                        }
                        wNew = rcHouse .Width + cx;
                        if (minHouseWidth <= wNew && wNew <= maxHouseWidth)
                        {
                            MoveRightSide (cx);
                        }
                        break;

                    case 2:      // Right Bottom corner
                        hNew = rcHouse .Height + cy;
                        if (minHouseHeight <= hNew && hNew <= maxHouseHeight)
                        {
                            MoveFloor (cy);
                        }
                        wNew = rcHouse .Width + cx;
                        if (minHouseWidth <= wNew && wNew <= maxHouseWidth)
                        {
                            MoveRightSide (cx);
                        }
                        break;

                    case 3:      // Left Bottom corner
                        hNew = rcHouse .Height + cy;
                        if (minHouseHeight <= hNew && hNew <= maxHouseHeight)
                        {
                            MoveFloor (cy);
                        }
                        wNew = rcHouse .Width - cx;
                        if (minHouseWidth <= wNew && wNew <= maxHouseWidth)
                        {
                            MoveLeftSide (cx);
                        }
                        break;

                    case 4:      // pien
                        cyNew = ptPien .Y + cy;
                        hNew = rcHouse .Top - cyNew;
                        if (minRoofH <= hNew && hNew <= maxRoofH)
                        {
                            ptPien .Y += cy;
                            ptSlopeL .Y += cy;
                            ptLT = new Point (rcHouse .Left, rcHouse .Top);
                            ptOnOuterSide = new Point (rcHouse .Left, ptPien .Y);
                            while (!Auxi_Geometry .SameSideOfLine (ptLT, ptPien, ptOnOuterSide, ptSlopeL))
                            {
                                ptSlopeL .Y--;
                            }
                            ptSlopeR .Y = ptSlopeL .Y;
                            DefineCover ();
                        }
                        break;
                    case 5:      // ptSlopeL
                        ptLT = new Point (rcHouse .Left, rcHouse .Top);
                        ptOnOuterSide = new Point (rcHouse .Left, ptPien .Y);
                        cyNew = ptSlopeL .Y + cy;
                        ptNew = new Point (ptSlopeL .X, cyNew);
                        if (ptPien .Y + minCornerDist <= cyNew &&
                                                         cyNew <= rcHouse .Top - minCornerDist &&
                            Auxi_Geometry .SameSideOfLine (ptLT, ptPien, ptOnOuterSide, ptNew))
                        {
                            ptSlopeL .Y = cyNew;
                            ptSlopeR .Y = cyNew;
                            DefineCover ();
                        }
                        cxNew = ptSlopeL .X + cx;
                        ptNew = new Point (cxNew, ptSlopeL .Y);
                        if (rcHouse .Left + minCornerDist <= cxNew &&
                                                             cxNew <= ptPien .X - minCornerDist &&
                            Auxi_Geometry .SameSideOfLine (ptLT, ptPien, ptOnOuterSide, ptNew))
                        {
                            ptSlopeL .X = cxNew;
                            ptSlopeR .X = ptPien .X + (ptPien .X - ptSlopeL .X);
                            DefineCover ();
                        }
                        break;
                    case 6:      // ptSlopeR
                        ptRT = new Point (rcHouse .Right, rcHouse .Top);
                        ptOnOuterSide = new Point (rcHouse .Right, ptPien .Y);
                        cyNew = ptSlopeR .Y + cy;
                        ptNew = new Point (ptSlopeR .X, cyNew);
                        if (ptPien .Y + minCornerDist <= cyNew &&
                                                         cyNew <= rcHouse .Top - minCornerDist &&
                            Auxi_Geometry .SameSideOfLine (ptRT, ptPien, ptOnOuterSide, ptNew))
                        {
                            ptSlopeR .Y = cyNew;
                            ptSlopeL .Y = cyNew;
                            DefineCover ();
                        }
                        cxNew = ptSlopeR .X + cx;
                        ptNew = new Point (cxNew, ptSlopeR .Y);
                        if (ptPien .X + minCornerDist <= cxNew &&
                                                         cxNew <= rcHouse .Right - minCornerDist &&
                            Auxi_Geometry .SameSideOfLine (ptRT, ptPien, ptOnOuterSide, ptNew))
                        {
                            ptSlopeR .X = cxNew;
                            ptSlopeL .X = ptPien .X - (ptSlopeR .X - ptPien .X);
                            DefineCover ();
                        }
                        break;
                    case 7:     // left side
                        wNew = rcHouse .Width - cx;
                        if (minHouseWidth <= wNew && wNew <= maxHouseWidth)
                        {
                            MoveLeftSide (cx);
                        }
                        break;
                    case 8:     // ceiling
                        hNew = rcHouse .Height - cy;
                        if (minHouseHeight <= hNew && hNew <= maxHouseHeight)
                        {
                            MoveCeiling (cy);
                        }
                        break;
                    case 9:     // right side
                        wNew = rcHouse .Width + cx;
                        if (minHouseWidth <= wNew && wNew <= maxHouseWidth)
                        {
                            MoveRightSide (cx);
                        }
                        break;
                    case 10:     // floor
                        hNew = rcHouse .Height + cy;
                        if (minHouseHeight <= hNew && hNew <= maxHouseHeight)
                        {
                            MoveFloor (cy);
                        }
                        break;
                    case 11:    // inner area
                        Move (cx, cy);
                        DefineCover ();
                        break;
                }
            }
            return (bRet);
        }
        // -------------------------------------------------        IntoRegistry
        public override void IntoRegistry (RegistryKey regkey, string name)
        {
            try
            {
                regkey .SetValue (name, new string [] { version .ToString (),           // 0
                                                        id .ToString (),                // 1

                                                        rcHouse .Left .ToString (),     // 2
                                                        rcHouse .Top .ToString (),      // 3
                                                        rcHouse .Width .ToString (),    // 4
                                                        rcHouse .Height .ToString (),   // 5
                                                        RoofHeight .ToString (),    // 6
                                                        SlopeShift .Width .ToString (),     // 7
                                                        SlopeShift .Height .ToString (),    // 8

                                                        ((int) (HouseColor .A)) .ToString (),    // 9 
                                                        ((int) (HouseColor .R)) .ToString (),    //  
                                                        ((int) (HouseColor .G)) .ToString (),    //  
                                                        ((int) (HouseColor .B)) .ToString (),    // 

                                                        ((int) (RoofColor .A)) .ToString (),    // 13 
                                                        ((int) (RoofColor .R)) .ToString (),    //  
                                                        ((int) (RoofColor .G)) .ToString (),    //  
                                                        ((int) (RoofColor .B)) .ToString (),    // 

                                                        ((int) (WindowColor .A)) .ToString (),    // 17 
                                                        ((int) (WindowColor .R)) .ToString (),    //  
                                                        ((int) (WindowColor .G)) .ToString (),    //  
                                                        ((int) (WindowColor .B)) .ToString (),    // 

                                                        ((int) (DoorColor .A)) .ToString (),    // 21 
                                                        ((int) (DoorColor .R)) .ToString (),    //  
                                                        ((int) (DoorColor .G)) .ToString (),    //  
                                                        ((int) (DoorColor .B)) .ToString (),    // 

                                                        ((int) (EdgeColor .A)) .ToString (),    // 25 
                                                        ((int) (EdgeColor .R)) .ToString (),    //  
                                                        ((int) (EdgeColor .G)) .ToString (),    //  
                                                        ((int) (EdgeColor .B)) .ToString (),    // 
                                                    },
                                        RegistryValueKind .MultiString);
            }
            catch
            {
            }
            finally
            {
            }
        }
        // -------------------------------------------------        FromRegistry
        public static RuralHouse FromRegistry (RegistryKey regkey, string name)
        {
            try
            {
                RuralHouse house = null;
                string [] strs = (string []) regkey .GetValue (name);
                if (strs != null && strs .Length == 29 && Convert .ToInt32 (strs [0]) == 606)
                {
                    house = new RuralHouse (Auxi_Convert .ToRectangle (strs, 2), Convert .ToInt32 (strs [6]), Auxi_Convert .ToSize (strs, 7),
                                            new Color [] {  Auxi_Convert .ToColor (strs, 9), 
                                                            Auxi_Convert .ToColor (strs, 13), 
                                                            Auxi_Convert .ToColor (strs, 17), 
                                                            Auxi_Convert .ToColor (strs, 21), 
                                                            Auxi_Convert .ToColor (strs, 25)});
                    if (house != null)
                    {
                        house .ID = Convert .ToInt64 (strs [1]);
                    }
                }
                return (house);
            }
            catch
            {
                return (null);
            }
            finally
            {
            }
        }
        // -------------------------------------------------        IntoFile
        public override void IntoFile (BinaryWriter bw)
        {
            try
            {
                bw .Write (version);            // 0
                bw .Write (id);                 // 1
                Auxi_IO .Write_Rectangle (bw, rcHouse);     // 2 - 5
                bw .Write (RoofHeight);         // 6
                Auxi_IO .Write_Size (bw, SlopeShift);       // 7, 8
                Auxi_IO .Write_Color (bw, HouseColor);      // 9
                Auxi_IO .Write_Color (bw, RoofColor);       // 13
                Auxi_IO .Write_Color (bw, WindowColor);     // 17
                Auxi_IO .Write_Color (bw, DoorColor);       // 21
                Auxi_IO .Write_Color (bw, EdgeColor);       // 25
            }
            catch
            {
            }
            finally
            {
            }
        }
        // -------------------------------------------------        FromFile
        public static RuralHouse FromFile (BinaryReader br)
        {
            try
            {
                RuralHouse house = null;
                int nVer = br .ReadInt32 ();        // 0
                long idRead = br .ReadInt64 ();     // 1
                if (nVer == 606)
                {
                    house = new RuralHouse (Auxi_IO .Read_Rectangle (br),   // 2 - 5
                                            br .ReadInt32 (),               // 6
                                            Auxi_IO .Read_Size (br),        // 7
                                            new Color [] {  Auxi_IO .Read_Color (br),       // 9
                                                            Auxi_IO .Read_Color (br),       // 13
                                                            Auxi_IO .Read_Color (br),       // 17
                                                            Auxi_IO .Read_Color (br),       // 21
                                                            Auxi_IO .Read_Color (br)});     // 25
                    if (house != null)
                    {
                        house .ID = idRead;
                    }
                }
                return (house);
            }
            catch
            {
                return (null);
            }
            finally
            {
            }
        }

    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

SergeyAndreyev

United States United States
No Biography provided

| Advertise | Privacy | Mobile
Web03 | 2.8.140922.1 | Last Updated 10 Apr 2010
Article Copyright 2010 by SergeyAndreyev
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid