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

User-driven applications

, 10 Apr 2010 CPOL
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 .ComponentModel;
using System .Drawing;
using System .Windows .Forms;
using Microsoft .Win32;

using MoveGraphLibrary;

namespace UserDrivenApplications
{
    public enum MedleyElem { PieChart, RingSet, BarChart };

    public partial class Form_PlotsVariety : Form
    {
        int version = 606;

        const string strAddRegKey = "Form_FinancialGraphics";
        Mover mover;
        List<SingleElement> elems = new List<SingleElement> ();
        Point ptMouse_Down, ptMouse_Up;
        int iElement = -1;
        int iRingTouched = -1;
        int iCmntTouched = -1;
        bool bNumScaleTouched = false;
        bool bTextScaleTouched = false;
        bool bBarChartCmntTouched = false;
        bool bNumScaleCmntTouched = false;
        bool bTextScaleCmntTouched = false;
        
        bool bShowAngle = true;
        Random rand;
        int nSeed;
        ClosableInfo info;
        string infotext = "Plots and their parts can be added, deleted, moved, resized,\n" +
                          "rotated, and modified.  Tuning can be done (or started) via\n" +
                          "the context menus.  There are at least ELEVEN different menus\n" +
                          "on objects of different classes and at empty spots.";

        bool bFormInMove = false;
        Size sizeMouseShift;

        bool bRestore = false;

        // -------------------------------------------------
        public Form_PlotsVariety ()
        {
            InitializeComponent ();
            mover = new Mover (this);

            rand = Auxi_Common .RandomByCurTime (out nSeed);
        }
        // -------------------------------------------------        OnLoad
        private void OnLoad (object sender, EventArgs e)
        {
            RestoreFromRegistry ();
            if (!bRestore)
            {
                DefaultView ();
            }
            RenewMover ();
            btnHelp .Enabled = !info .Visible;
        }
        // -------------------------------------------------        OnFormClosing
        private void OnFormClosing (object sender, FormClosingEventArgs e)
        {
            SaveInfoToRegistry ();
        }
        // -------------------------------------------------        DefaultView
        private void DefaultView ()
        {
            ClientSize = new Size (811, 690);

            Font fntTitle = new Font ("Times New Roman", 12, FontStyle .Bold | FontStyle .Italic);
            Font fntSectors = new Font ("Times New Roman", 12);
            double angleTitle = 0;
            Color clrTitle = Color .Blue;

            RingSet rs = new RingSet (this, new Point (ClientRectangle .Width / 4, ClientRectangle .Height / 4),    // RingSet (2 rings)
                                            80, 30, new double [] { 1, 2, 4, 8, 16 });
            rs .Rings [0] .SectorTexts = Auxi_Common .strDays;
            int newInner = rs .OuterMostRadius;
            rs .AddRing (newInner, newInner + 50, Math .PI / 3, new double [] { 3, 7, 2, 9, 4 });
            newInner = rs .OuterMostRadius;
            double [] fVal = new double [] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
            RingArea ring = new RingArea (this, new Point (0, 0), newInner + 75, newInner, fVal);
            ring .Colors = Auxi_Colours .SmoothColorsList (fVal .Length, Color .Yellow, Color .Blue);
            ring .SectorTexts = Auxi_Common .strMonths;
            rs .AddRing (ring);
            elems .Add (new SingleElement (rs));

            double [] fRandVal = Auxi_Common .RandomArray (1000, Auxi_Common .strDays .Length);                     // PieChart
            PieChart chart = new PieChart (this, new Point (ClientRectangle .Width / 5, ClientRectangle .Height * 2 / 3),
                                           Math .Max (ClientRectangle .Width, ClientRectangle .Height) / 4, fRandVal);
            chart .SectorTexts = Auxi_Common .strDays;
            for (int i = 0; i < chart .Colors .Count; i++)
            {
                chart .ChangeColor (i, Auxi_Colours .ColorPredefined (i));
            }
            int nDifViews = Enum .GetNames (typeof (RoundPlotTextView)) .Length;
            for (int i = 0; i < chart .Sectors; i++)
            {
                chart .SectorComments [i] .TextView = (RoundPlotTextView) (Enum .GetValues (typeof (RoundPlotTextView)) .GetValue (i % nDifViews));
                chart .SectorComments [i] .Font = fntSectors;
            }
            chart .AddComment (-90, 0.2, DateTime .Now .ToShortTimeString (), fntTitle, angleTitle, clrTitle);
            elems .Insert (0, new SingleElement (chart));

            int nSector = 21;                                                                                       // RingSet (1 ring)
            fRandVal = Auxi_Common .RandomArray (1000, nSector);
            rs = new RingSet (this, new Point (ClientRectangle .Width * 3 / 4, ClientRectangle .Height / 3),
                              Convert .ToInt32 (chart .Radius * 1.1), 40, fRandVal);
            ring = rs .Rings [0];
            ring .Colors = Auxi_Colours .SmoothColorsList (nSector, Color .White, Color .LightBlue);
            rs .AddComment (90, 0.3, "People", fntTitle, angleTitle, clrTitle);
            for (int i = 0; i < ring .Sectors; i++)
            {
                ring .Comments [i] .Text = Auxi_Common .StringOfText (Auxi_Common .strNames, i);
                ring .Comments [i] .TextView = RoundPlotTextView .Text;
                ring .Comments [i] .Angle = ring .Comments [i] .AngleToCenter;
                ring .Comments [i] .Font = fntSectors;
            }
            ring .FixedSectorTextsAngles = false;
            ring .EasyToReadOnRotation = true;
            elems .Insert (0, new SingleElement (rs));

            // barchart
            //
            int nSegment = Auxi_Common .strDays .Length - 2;
            int nSet = 4;
            double [,] fVals = new double [nSet, nSegment];
            for (int i = 0; i < nSet; i++)
            {
                for (int j = 0; j < nSegment; j++)
                {
                    fVals [i, j] = rand .Next (nSeed) % 1000;
                }
            }
            Rectangle rc = new Rectangle (ClientRectangle .Width / 2, ClientRectangle .Height / 2,
                                          ClientRectangle .Width * 3 / 7, ClientRectangle .Height * 2 / 5);
            BarChart barchart = new BarChart (this, rc, fVals, Side .S, Auxi_Common .strDays, TextsDrawingDirection .LTtoRB,
                                                               Side .E, 1000.0, 0.0, GridOrigin .ByStep, 200.0);
            barchart .FillCoefficients (0, 0.85);
            barchart .NumScale .ValuesFormat = "F0";
            barchart .AddComment (0.5, 0.1, "Default BarChart", new Font ("Times New Roman", 11, FontStyle .Bold), 0, Color .Red);
            elems .Insert (0, new SingleElement (barchart));

            info = new ClosableInfo (this, new Point (40, 510), infotext);
            info .BackColor = Color .LightYellow;
            info .Visible = false;
        }
        // -------------------------------------------------        RenewMover
        private void RenewMover ()
        {
            mover .Clear ();
            for (int i = elems .Count - 1; i >= 0; i--)
            {
                elems [i] .IntoMover (mover, 0);
            }
            if (info .Visible)
            {
                mover .Insert (0, info);
            }
            mover .Insert (0, btnHelp);
        }
        // -------------------------------------------------        Click_btnHelp
        private void Click_btnHelp (object sender, EventArgs e)
        {
            info .Visible = true;
            btnHelp .Enabled = false;
            RenewMover ();
            Invalidate ();
        }
        // -------------------------------------------------        OnPaint
        private void OnPaint (object sender, PaintEventArgs e)
        {
            Graphics grfx = e .Graphics;

            for (int i = elems .Count - 1; i >= 0; i--)
            {
                elems [i] .Draw (grfx);
            }
            info .Draw (grfx);
        }
        // -------------------------------------------------        OnMouseDown
        private void OnMouseDown (object sender, MouseEventArgs e)
        {
            ptMouse_Down = e .Location;
            if (!mover .Catch (e .Location, e .Button, bShowAngle))
            {
                if (e .Button == MouseButtons .Left)
                {
                    bFormInMove = true;
                    sizeMouseShift = new Size (PointToScreen (ptMouse_Down) .X - Location .X, PointToScreen (ptMouse_Down) .Y - Location .Y);
                }
            }
            ContextMenuStrip = null;
        }
        // -------------------------------------------------		OnMouseUp
        private void OnMouseUp (object sender, MouseEventArgs mea)
        {
            ptMouse_Up = mea .Location;
            double nDist = Auxi_Geometry .Distance (ptMouse_Down, ptMouse_Up);

            if (mea .Button == MouseButtons .Left)
            {
                int iWasObject, iWasNode;
                if (mover .Release (out iWasObject, out iWasNode))
                {
                    GraphicalObject grobj = mover [iWasObject] .Source;
                    if (grobj is ClosableInfo)
                    {
                        if (iWasNode == 0)
                        {
                            (grobj as ClosableInfo) .Visible = false;
                            btnHelp .Enabled = true;
                            RenewMover ();
                            Invalidate ();
                        }
                    }
                    else if (grobj is PieChart || grobj is RingSet || grobj is BarChart)
                    {
                        Identification (iWasObject);
                        if (nDist <= 3)   
                        {
                            PopupElement (iElement);
                        }
                    }
                }
            }
            else if (mea .Button == MouseButtons .Right)
            {
                if (mover .Release ())
                {
                    if (nDist <= 3)     // ContextMenu if nDist <= 3
                    {
                        MenuSelection (mover .WasCaughtObject);
                    }
                }
                else
                {
                    ContextMenuStrip = menuOnEmpty;
                }
            }
            bFormInMove = false;
        }
        // -------------------------------------------------        MenuSelection
        private void MenuSelection (int iInMover)
        {
            GraphicalObject grobj = mover [iInMover] .Source;
            if (grobj is ClosableInfo)
            {
                ContextMenuStrip = menuOnInfo;
            }
            else
            {
                Identification (iInMover);      
                if (iElement >= 0)
                {
                    if (grobj is PieChart)
                    {
                        ContextMenuStrip = menuOnPieChart;
                    }
                    else if (grobj is RingSet)
                    {
                        if (elems [iElement] .RingSet .Inside (ptMouse_Down, out iRingTouched))
                        {
                            ContextMenuStrip = menuOnRings;
                        }
                    }
                    else if (grobj is BarChart)
                    {
                        ContextMenuStrip = menuOnBarChart;
                    }
                    else if (grobj is Scale ||
                             grobj is TextScale)
                    {
                        ContextMenuStrip = menuOnScale;
                    }
                    else if (grobj is CommentToCircle)
                    {
                        if (iCmntTouched >= 0)
                        {
                            ContextMenuStrip = menuOnCircleComment;
                        }
                    }
                    else if (grobj is CommentToRing)
                    {
                        if (iCmntTouched >= 0)
                        {
                            ContextMenuStrip = menuOnRingComment;
                        }
                    }
                    else if (grobj is CommentToCircleSector)
                    {
                        if (iCmntTouched >= 0)
                        {
                            ContextMenuStrip = menuOnPieSectorComment;
                        }
                    }
                    else if (grobj is CommentToRingSector)
                    {
                        if (iCmntTouched >= 0)
                        {
                            ContextMenuStrip = menuOnRingSectorComment;
                        }
                    }
                    else if (grobj is CommentToRect)
                    {
                        if (iCmntTouched >= 0)
                        {
                            ContextMenuStrip = menuOnBarComment;
                        }
                    }
                }
            }
        }
        // -------------------------------------------------        OnMouseMove
        private void OnMouseMove (object sender, MouseEventArgs e)
        {
            if (mover .Move (e .Location))
            {
                Invalidate ();
            }
            else
            {
                if (bFormInMove)
                {
                    Location = PointToScreen (e .Location) - sizeMouseShift;
                }
            }
        }
        // -------------------------------------------------        OnContextMenuChanged
        private void OnContextMenuChanged (object sender, EventArgs e)
        {
            if (ContextMenuStrip != null)
            {
                ContextMenuStrip .Show (PointToScreen (ptMouse_Up));
            }
        }
        // -------------------------------------------------        Identification
        private void Identification (int iInMover)
        {
            GraphicalObject grobj = mover [iInMover] .Source;
            long id = grobj .ID;
            iElement = -1;
            iRingTouched = -1;
            iCmntTouched = -1;
            bNumScaleTouched = false;
            bTextScaleTouched = false;
            bBarChartCmntTouched = false;
            bNumScaleCmntTouched = false;
            bTextScaleCmntTouched = false;

            if (grobj is PieChart)
            {
                for (iElement = elems .Count - 1; iElement >= 0; iElement--)
                {
                    if (elems [iElement] .ElementType == MedleyElem .PieChart)
                    {
                        if (id == elems [iElement] .PieChart .ID)
                        {
                            break;
                        }
                    }
                }
            }
            else if (grobj is RingSet)
            {
                for (iElement = elems .Count - 1; iElement >= 0; iElement--)
                {
                    if (elems [iElement] .ElementType == MedleyElem .RingSet)
                    {
                        if (id == elems [iElement] .RingSet .ID)
                        {
                            break;
                        }
                    }
                }
            }
            else if (grobj is BarChart)
            {
                for (iElement = elems .Count - 1; iElement >= 0; iElement--)
                {
                    if (elems [iElement] .ElementType == MedleyElem .BarChart)
                    {
                        if (id == elems [iElement] .BarChart .ID)
                        {
                            break;
                        }
                    }
                }
            }
            else if (grobj is Scale)
            {
                for (iElement = elems .Count - 1; iElement >= 0; iElement--)
                {
                    if (elems [iElement] .ElementType == MedleyElem .BarChart)
                    {
                        if (id == elems [iElement] .BarChart .NumScale .ID)
                        {
                            bNumScaleTouched = true;
                            break;
                        }
                    }
                }
            }
            else if (grobj is TextScale)
            {
                for (iElement = elems .Count - 1; iElement >= 0; iElement--)
                {
                    if (elems [iElement] .ElementType == MedleyElem .BarChart)
                    {
                        if (id == elems [iElement] .BarChart .TextScale .ID)
                        {
                            bTextScaleTouched = true;
                            break;
                        }
                    }
                }
            }
            else if (grobj is CommentToCircle)
            {
                for (iElement = elems .Count - 1; iElement >= 0; iElement--)
                {
                    if (elems [iElement] .ElementType == MedleyElem .PieChart)
                    {
                        PieChart pie = elems [iElement] .PieChart;
                        for (iCmntTouched = pie .Comments .Count - 1; iCmntTouched >= 0; iCmntTouched--)
                        {
                            if (id == pie .Comments [iCmntTouched] .ID)
                            {
                                return;
                            }
                        }
                    }
                }
            }
            else if (grobj is CommentToRing)
            {
                for (iElement = elems .Count - 1; iElement >= 0; iElement--)
                {
                    if (elems [iElement] .ElementType == MedleyElem .RingSet)
                    {
                        RingSet rs = elems [iElement] .RingSet;
                        for (iCmntTouched = rs .Comments .Count - 1; iCmntTouched >= 0; iCmntTouched--)
                        {
                            if (id == rs .Comments [iCmntTouched] .ID)
                            {
                                return;
                            }
                        }
                    }
                }
            }
            else if (grobj is CommentToCircleSector)
            {
                for (iElement = elems .Count - 1; iElement >= 0; iElement--)
                {
                    if (elems [iElement] .ElementType == MedleyElem .PieChart)
                    {
                        PieChart pie = elems [iElement] .PieChart;
                        for (iCmntTouched = pie .SectorComments .Count - 1; iCmntTouched >= 0; iCmntTouched--)
                        {
                            if (id == pie .SectorComments [iCmntTouched] .ID)
                            {
                                return;
                            }
                        }
                    }
                }
            }
            else if (grobj is CommentToRingSector)
            {
                for (iElement = elems .Count - 1; iElement >= 0; iElement--)
                {
                    if (elems [iElement] .ElementType == MedleyElem .RingSet)
                    {
                        RingSet rs = elems [iElement] .RingSet;
                        for (iRingTouched = rs .Rings .Count - 1; iRingTouched >= 0; iRingTouched--)
                        {
                            RingArea ra = rs .Rings [iRingTouched];
                            for (iCmntTouched = ra .Comments .Count - 1; iCmntTouched >= 0; iCmntTouched--)
                            {
                                if (id == ra .Comments [iCmntTouched] .ID)
                                {
                                    return;
                                }
                            }
                        }
                    }
                }
            }
            else if (grobj is CommentToRect)
            {
                for (iElement = elems .Count - 1; iElement >= 0; iElement--)
                {
                    if (elems [iElement] .ElementType == MedleyElem .BarChart)
                    {
                        BarChart chart = elems [iElement] .BarChart;
                        for (iCmntTouched = chart .Comments .Count - 1; iCmntTouched >= 0; iCmntTouched--)
                        {
                            if (id == chart .Comments [iCmntTouched] .ID)
                            {
                                bBarChartCmntTouched = true;
                                return;
                            }
                        }
                        Scale nmscale = chart .NumScale;
                        for (iCmntTouched = nmscale .Comments .Count - 1; iCmntTouched >= 0; iCmntTouched--)
                        {
                            if (id == nmscale .Comments [iCmntTouched] .ID)
                            {
                                bNumScaleCmntTouched = true;
                                return;
                            }
                        }
                        TextScale txscale = chart .TextScale;
                        for (iCmntTouched = txscale .Comments .Count - 1; iCmntTouched >= 0; iCmntTouched--)
                        {
                            if (id == txscale .Comments [iCmntTouched] .ID)
                            {
                                bTextScaleCmntTouched = true;
                                return;
                            }
                        }
                    }
                }
            }
        }
        // -------------------------------------------------        PopupElement
        private void PopupElement (int iElem)
        {
            while (iElem > 0)
            {
                elems .Reverse (iElem - 1, 2);
                iElem--;
            }
            RenewMover ();
            Invalidate ();
        }
        // -------------------------------------------------        OnMouseDoubleClick
        private void OnMouseDoubleClick (object sender, MouseEventArgs mea)
        {
            if (mover .Catch (mea .Location, MouseButtons .Left))
            {
                int iInMover = mover .CaughtObject;
                Identification (iInMover);           
                if (iElement >= 0)
                {
                    BarChart chart;
                    GraphicalObject grobj = mover [iInMover] .Source;
                    if (grobj is BarChart || grobj is PieChart || grobj is RingSet)
                    {
                        ElementMainParametersDialog (iElement);
                    }
                    else if (grobj is Scale)
                    {
                        chart = elems [iElement] .BarChart;
                        chart .NumScale .ParametersDialog (this, RenewMover, ParamsChanged, null, chart .Title, null);
                    }
                    else if (grobj is TextScale)
                    {
                        chart = elems [iElement] .BarChart;
                        chart .TextScale .ParametersDialog (this, RenewMover, ParamsChanged, null, chart .Title, null);
                    }
                }
            }
        }
        // -------------------------------------------------        ElementMainParametersDialog
        private void ElementMainParametersDialog (int i)
        {
            if (0 <= i && i < elems .Count)
            {
                switch (elems [i] .ElementType)
                {
                    case MedleyElem .PieChart:
                        elems [i] .PieChart .ParametersDialog (this, RenewMover, ParamsChanged, null, elems [i] .Title, null);
                        break;
                    case MedleyElem .RingSet:
                        elems [i] .RingSet .ParametersDialog (this, RenewMover, ParamsChanged, null, elems [i] .Title, null);
                        break;
                    case MedleyElem .BarChart:
                        elems [i] .BarChart .ParametersDialog (this, RenewMover, ParamsChanged, null, elems [i] .Title, null);
                        break;
                }
            }
        }
        // -------------------------------------------------		ParamsChanged
        private void ParamsChanged (object sender, EventArgs ea)
        {
            Invalidate ();
        }
        // -------------------------------------------------        HideGeneralCmnts
        private void HideGeneralCmnts ()
        {
            elems [iElement] .HideGeneralCmnts ();
            RenewMover ();
            Invalidate ();
        }
        // -------------------------------------------------        UnveilGeneralCmnts
        private void UnveilGeneralCmnts ()
        {
            elems [iElement] .UnveilGeneralCmnts ();
            RenewMover ();
            Invalidate ();
        }
        // -------------------------------------------------        DeleteElement
        private void DeleteElement ()
        {
            elems [iElement] .CloseTuningForms ();
            elems .RemoveAt (iElement);
            RenewMover ();
            Invalidate ();
        }

        // *****   menuOnPieChart   *****
        // -------------------------------------------------        Opening_menuOnPies
        private void Opening_menuOnPies (object sender, CancelEventArgs e)
        {
            ToolStripItemCollection items = menuOnPieChart .Items;

            ((ToolStripMenuItem) items ["miPieBordersSwitch"]) .Checked = elems [iElement] .PieChart .ShowBorders;
            items ["miPieChangeLevel"] .Enabled = elems .Count > 1;  
            items ["miPieDelete"] .Enabled = elems .Count > 1;
        }
        // -------------------------------------------------        Click_miPieParams
        private void Click_miPieParams (object sender, EventArgs e)
        {
            ElementMainParametersDialog (iElement);
        }
        // -------------------------------------------------        DropDownOpening_miPieHideUnveilCmnts
        private void DropDownOpening_miPieHideUnveilCmnts (object sender, EventArgs e)
        {
            PieChart chart = elems [iElement] .PieChart;
            ToolStripMenuItem itemParent = (ToolStripMenuItem) (menuOnPieChart .Items ["miPieHideUnveilComments"]);
            ToolStripItemCollection items = itemParent .DropDownItems;

            items ["miPieHideSectorCmnts"] .Enabled = chart .ExistVisibleSectorComments;
            items ["miPieUnveilSectorCmnts"] .Enabled = chart .ExistHiddenSectorComments;
            items ["miPieHideGeneralCmnts"] .Enabled = chart .ExistVisibleComments;
            items ["miPieUnveilGeneralCmnts"] .Enabled = chart .ExistHiddenComments;
        }
        // -------------------------------------------------        Click_miPieHideSectorCmnts
        private void Click_miPieHideSectorCmnts (object sender, EventArgs e)
        {
            elems [iElement] .HideSectorCmnts (-1);
            RenewMover ();
            Invalidate ();
        }
        // -------------------------------------------------        Click_miPieUnveilSectorCmnts
        private void Click_miPieUnveilSectorCmnts (object sender, EventArgs e)
        {
            elems [iElement] .UnveilSectorCmnts (-1);
            RenewMover ();
            Invalidate ();
        }
        // -------------------------------------------------        Click_miPieHideGeneralCmnts
        private void Click_miPieHideGeneralCmnts (object sender, EventArgs e)
        {
            HideGeneralCmnts ();
        }
        // -------------------------------------------------        Click_miPieUnveilGeneralCmnts
        private void Click_miPieUnveilGeneralCmnts (object sender, EventArgs e)
        {
            UnveilGeneralCmnts ();
        }
        // -------------------------------------------------        Click_miPieBordersSwitch
        private void Click_miPieBordersSwitch (object sender, EventArgs e)
        {
            elems [iElement] .SwitchBorders ();
            Invalidate ();
        }
        // -------------------------------------------------        Click_miPieLookingToCenter
        private void Click_miPieLookingToCenter (object sender, EventArgs e)
        {
            PieChart chart = elems [iElement] .PieChart;
            for (int i = 0; i < chart .SectorComments .Count; i++)
            {
                chart .SectorComments [i] .Angle = chart .SectorComments [i] .AngleToCenter;
            }
            chart .FixedSectorTextsAngles = false;
            chart .EasyToReadOnRotation = true;
            if (chart .ParamsForm != null)
            {
                chart .ParamsForm .RefreshViewPart (ViewPart .Angles);
            }
            Invalidate ();
        }
        // -------------------------------------------------        Click_miPieFixUnfixAngles
        private void Click_miPieFixUnfixAngles (object sender, EventArgs e)
        {
            elems [iElement] .SwitchFixingAngles (-1);
        }
        // -------------------------------------------------        Click_miPieSwitchDrawingDirection
        private void Click_miPieSwitchDrawingDirection (object sender, EventArgs e)
        {
            elems [iElement] .SwitchDrawingDirection (-1);
            Invalidate ();
        }
        // -------------------------------------------------        Click_miCircle
        private void Click_miCircle (object sender, EventArgs e)
        {
            elems [iElement] .PieChart .IntoClipboard (CopyPart .PurePlot, Color .White);
        }
        // -------------------------------------------------        Click_miPieChart
        private void Click_miPieChart (object sender, EventArgs e)
        {
            elems [iElement] .PieChart .IntoClipboard (CopyPart .FullPlotArea, BackColor);
        }
        // -------------------------------------------------        Click_miPieOnWhite
        private void Click_miPieOnWhite (object sender, EventArgs e)
        {
            elems [iElement] .PieChart .IntoClipboard (CopyPart .FullPlotArea, Color .White);
        }
        // -------------------------------------------------        Click_miEmptyPicture
        private void Click_miPicture (object sender, EventArgs e)
        {
            FormIntoClipboard (BackColor);
        }
        // -------------------------------------------------        Click_miEmptyPictureOnWhite
        private void Click_miPictureOnWhite (object sender, EventArgs e)
        {
            FormIntoClipboard (Color .White);
        }
        // -------------------------------------------------        FormIntoClipboard
        private void FormIntoClipboard (Color clrBack)
        {
            Bitmap bitmapFull = new Bitmap (ClientRectangle .Width, ClientRectangle .Height);
            Graphics grfxFull = Graphics .FromImage (bitmapFull);
            grfxFull .Clear (clrBack);
            for (int i = elems .Count - 1; i >= 0; i--)
            {
                elems [i] .Draw (grfxFull);
            }
            Clipboard .Clear ();
            Clipboard .SetDataObject (bitmapFull, true);
        }
        // -------------------------------------------------        DropDownOpening_miPieChangeLevel
        private void DropDownOpening_miPieChangeLevel (object sender, EventArgs e)
        {
            ToolStripMenuItem itemParent = (ToolStripMenuItem) (menuOnPieChart .Items ["miPieChangeLevel"]);
            ToolStripItemCollection items = itemParent .DropDownItems;

            items ["miPutOnTop_PieChart"] .Enabled = iElement > 0;
            items ["miOneLevelUp_PieChart"] .Enabled = iElement > 0;
            items ["miOneLevelDown_PieChart"] .Enabled = iElement < elems .Count - 1;
            items ["miSendUnderneath_PieChart"] .Enabled = iElement < elems .Count - 1;
        }
        // -------------------------------------------------        Click_miPlotOnTop
        private void Click_miPlotOnTop (object sender, EventArgs e)
        {
            while (iElement > 0)
            {
                elems .Reverse (iElement - 1, 2);
                iElement--;
            }
            RenewMover ();
            Invalidate ();
        }
        // -------------------------------------------------        Click_miPlotOneLevelUp
        private void Click_miPlotOneLevelUp (object sender, EventArgs e)
        {
            elems .Reverse (iElement - 1, 2);
            RenewMover ();
            Invalidate ();
        }
        // -------------------------------------------------        Click_miPlotOneLevelDown
        private void Click_miPlotOneLevelDown (object sender, EventArgs e)
        {
            elems .Reverse (iElement, 2);
            RenewMover ();
            Invalidate ();
        }
        // -------------------------------------------------        Click_miPlotUnderneath
        private void Click_miPlotUnderneath (object sender, EventArgs e)
        {
            while (iElement < elems .Count - 1)
            {
                elems .Reverse (iElement, 2);
                iElement++;
            }
            RenewMover ();
            Invalidate ();
        }
        // -------------------------------------------------        Click_miPieDelete
        private void Click_miPieDelete (object sender, EventArgs e)
        {
            string quest;
            string title = elems [iElement] .PieChart .Title;
            if (title != null)
            {
                quest = "Do you want to delete PieChart \"" + title + "\" ?";
            }
            else
            {
                quest = "Do you want to delete the touched PieChart?";
            }
            if (DialogResult .Yes == MessageBox .Show (quest, "Delete PieChart", MessageBoxButtons .YesNo,
                                                       MessageBoxIcon .Question, MessageBoxDefaultButton .Button1))
            {
                DeleteElement ();
            }
        }

        // *****   menuOnCircleComment   *****
        // -------------------------------------------------        Opening_menuOnCircleComment
        private void Opening_menuOnCircleComment (object sender, CancelEventArgs e)
        {
            ((ToolStripMenuItem) (menuOnCircleComment .Items ["miPieSwitchRotationAngle"])) .Checked = bShowAngle;
        }
        // -------------------------------------------------        Click_miPieModifyComment
        private void Click_miPieModifyComment (object sender, EventArgs e)
        {
            PieChart pie = elems [iElement] .PieChart;
            pie .ParametersDialog (this, RenewMover, ParamsChanged, null, pie .Title, null);
            if (pie .ParamsForm != null)
            {
                pie .ParamsForm .SelectComment (iCmntTouched);
            }
        }
        // -------------------------------------------------        Click_miPieHideComment
        private void Click_miPieHideComment (object sender, EventArgs e)
        {
            PieChart pie = elems [iElement] .PieChart;
            pie .Comments [iCmntTouched] .Visible = false;
            RenewMover ();
            Invalidate ();
            if (pie .ParamsForm != null)
            {
                pie .ParamsForm .RefreshView ();
            }
        }
        // -------------------------------------------------        Click_miPieDeleteComment
        private void Click_miPieDeleteComment (object sender, EventArgs e)
        {
            elems [iElement] .PieChart .RemoveComment (iCmntTouched);
            RenewMover ();
            Invalidate ();
        }
        // -------------------------------------------------        Click_miRotationAngle
        private void Click_miRotationAngle (object sender, EventArgs e)
        {
            bShowAngle = !bShowAngle;
        }

        // *****   menuOnPieSectorComment   *****
        // -------------------------------------------------        Opening_menuOnPieSectorComment
        private void Opening_menuOnPieSectorComment (object sender, CancelEventArgs e)
        {
            ((ToolStripMenuItem) (menuOnPieSectorComment .Items ["miPieRotationAngle"])) .Checked = bShowAngle;
        }
        // -------------------------------------------------        Click_miPieModifySectorComment
        private void Click_miPieModifySectorComment (object sender, EventArgs e)
        {
            PieChart pie = elems [iElement] .PieChart;
            pie .ParametersDialog (this, RenewMover, ParamsChanged, null, pie .Title, null);
            if (pie .ParamsForm != null)
            {
                pie .ParamsForm .SelectSector (iCmntTouched);
            }
        }
        // -------------------------------------------------        Click_miPieHideSectorComment
        private void Click_miPieHideSectorComment (object sender, EventArgs e)
        {
            PieChart pie = elems [iElement] .PieChart;
            pie .SectorComments [iCmntTouched] .Visible = false;
            RenewMover ();
            Invalidate ();
            if (pie .ParamsForm != null)
            {
                pie .ParamsForm .RefreshView ();
            }
        }
        // -------------------------------------------------        DropDownOpening_miPieSectorCommentView
        private void DropDownOpening_miPieSectorCommentView (object sender, EventArgs e)
        {
            ToolStripMenuItem itemParent = (ToolStripMenuItem) sender;
            ToolStripItemCollection items = itemParent .DropDownItems;

            for (int i = 0; i < items .Count; i++)
            {
                ((ToolStripMenuItem) items [i]) .Checked =
                                elems [iElement] .PieChart .SectorComments [iCmntTouched] .TextView == (RoundPlotTextView) i;
            }
        }
        // -------------------------------------------------        Click_miPieText and others - seven different text views
        private void Click_miPieText (object sender, EventArgs e)
        {
            PieSectorTextView (RoundPlotTextView .Text);
        }
        private void Click_miPieValue (object sender, EventArgs e)
        {
            PieSectorTextView (RoundPlotTextView .Value);
        }
        private void Click_miPiePercent (object sender, EventArgs e)
        {
            PieSectorTextView (RoundPlotTextView .Percent);
        }
        private void Click_miPieTextValue (object sender, EventArgs e)
        {
            PieSectorTextView (RoundPlotTextView .TextValue);
        }
        private void Click_miPieTextPercent (object sender, EventArgs e)
        {
            PieSectorTextView (RoundPlotTextView .TextPercent);
        }
        private void Click_miPieValuePercent (object sender, EventArgs e)
        {
            PieSectorTextView (RoundPlotTextView .ValuePercent);
        }
        private void Click_miPieTextValuePercent (object sender, EventArgs e)
        {
            PieSectorTextView (RoundPlotTextView .TextValuePercent);
        }
        // -------------------------------------------------        PieSectorTextView
        private void PieSectorTextView (RoundPlotTextView view)
        {
            elems [iElement] .PieChart .SectorComments [iCmntTouched] .TextView = view;
            Invalidate ();
        }
        // -------------------------------------------------        Click_miPieColorSample
        private void Click_miPieColorSample (object sender, EventArgs e)
        {
            PieSectorAsSample (Sample .Color);
            Invalidate ();
        }
        // -------------------------------------------------        Click_miPieFontSample
        private void Click_miPieFontSample (object sender, EventArgs e)
        {
            PieSectorAsSample (Sample .Font);
            Invalidate ();
        }
        // -------------------------------------------------        Click_miPieColorFontSample
        private void Click_miPieColorFontSample (object sender, EventArgs e)
        {
            PieSectorAsSample (Sample .Color);
            PieSectorAsSample (Sample .Font);
            Invalidate ();
        }
        // -------------------------------------------------        Click_miPieRadiusSample
        private void Click_miPieRadiusSample (object sender, EventArgs e)
        {
            PieSectorAsSample (Sample .Radius);
            Invalidate ();
        }
        // -------------------------------------------------        Click_miPieAngleSample
        private void Click_miPieAngleSample (object sender, EventArgs e)
        {
            PieSectorAsSample (Sample .Angle);
            Invalidate ();
        }
        // -------------------------------------------------        Click_miPieTextViewSample
        private void Click_miPieTextViewSample (object sender, EventArgs e)
        {
            PieSectorAsSample (Sample .TextView);
            Invalidate ();
        }
        // -------------------------------------------------        Click_miPieAllPAramsSample
        private void Click_miPieAllParamsSample (object sender, EventArgs e)
        {
            PieSectorAsSample (Sample .Color);
            PieSectorAsSample (Sample .Font);
            PieSectorAsSample (Sample .Radius);
            PieSectorAsSample (Sample .TextView);
            Invalidate ();
        }
        // -------------------------------------------------        PieSectorAsSample
        private void PieSectorAsSample (Sample sampletype)
        {
            List<CommentToCircleSector> cmnts = elems [iElement] .PieChart .SectorComments;
            CommentToCircleSector cmntSample = cmnts [iCmntTouched];
            switch (sampletype)
            {
                case Sample .Color:
                    foreach (CommentToCircleSector cmnt in cmnts)
                    {
                        cmnt .Color = cmntSample .Color;
                    }
                    break;
                case Sample .Font:
                    foreach (CommentToCircleSector cmnt in cmnts)
                    {
                        cmnt .Font = cmntSample .Font;
                    }
                    break;
                case Sample .Radius:
                    foreach (CommentToCircleSector cmnt in cmnts)
                    {
                        cmnt .PositionCoefficient = cmntSample .PositionCoefficient;
                    }
                    break;
                case Sample .Angle:
                    foreach (CommentToCircleSector cmnt in cmnts)
                    {
                        cmnt .Angle = cmntSample .Angle;
                    }
                    break;
                case Sample .TextView:
                    foreach (CommentToCircleSector cmnt in cmnts)
                    {
                        cmnt .TextView = cmntSample .TextView;
                    }
                    break;
            }
        }

        // *****   menuOnRings   *****
        // -------------------------------------------------        Opening_menuOnRings
        private void Opening_menuOnRings (object sender, CancelEventArgs e)
        {
            ToolStripItemCollection items = menuOnRings .Items;

            ((ToolStripMenuItem) items ["miRingsBordersSwitch"]) .Checked = elems [iElement] .RingSet .ShowBorders;
            items ["miRingsChangeLevel"] .Enabled = elems .Count > 1;
            items ["miDeleteRing"] .Enabled = elems [iElement] .RingSet .Rings .Count > 1;
            items ["miRingsDelete"] .Enabled = elems .Count > 1;
        }
        // -------------------------------------------------        Click_miRingsParams
        private void Click_miRingsParams (object sender, EventArgs e)
        {
            ElementMainParametersDialog (iElement);
        }
        // -------------------------------------------------        DropDownOpening_miRingsHideUnveilCmnts
        private void DropDownOpening_miRingsHideUnveilCmnts (object sender, EventArgs e)
        {
            RingSet rs = elems [iElement] .RingSet;
            RingArea ra = rs .Rings [iRingTouched];
            ToolStripMenuItem itemParent = (ToolStripMenuItem) (menuOnRings .Items ["miRingsHideUnveilComments"]);
            ToolStripItemCollection items = itemParent .DropDownItems;

            items ["miRingsHideSectorCmnts"] .Enabled = ra .ExistVisibleComments;
            items ["miRingsUnveilSectorCmnts"] .Enabled = ra .ExistHiddenComments;
            items ["miRingsHideGeneralCmnts"] .Enabled = rs .ExistVisibleComments;
            items ["miRingsUnveilGeneralCmnts"] .Enabled = rs .ExistHiddenComments;
        }
        // -------------------------------------------------        Click_miRingsHideSectorCmnts
        private void Click_miRingsHideSectorCmnts (object sender, EventArgs e)
        {
            elems [iElement] .HideSectorCmnts (iRingTouched);
            RenewMover ();
            Invalidate ();
        }
        // -------------------------------------------------        Click_miRingsUnveilSectorCmnts
        private void Click_miRingsUnveilSectorCmnts (object sender, EventArgs e)
        {
            elems [iElement] .UnveilSectorCmnts (iRingTouched);
            RenewMover ();
            Invalidate ();
        }
        // -------------------------------------------------        Click_miRingsHideGeneralCmnts
        private void Click_miRingsHideGeneralCmnts (object sender, EventArgs e)
        {
            HideGeneralCmnts ();
        }
        // -------------------------------------------------        Click_miRingsUnveilGeneralCmnts
        private void Click_miRingsUnveilGeneralCmnts (object sender, EventArgs e)
        {
            UnveilGeneralCmnts ();
        }
        // -------------------------------------------------        Click_miRingsBordersSwitch
        private void Click_miRingsBordersSwitch (object sender, EventArgs e)
        {
            elems [iElement] .SwitchBorders ();
            Invalidate ();
        }
        // -------------------------------------------------        Click_miRingsCommentsLookingToCenter
        private void Click_miRingsCommentsLookingToCenter (object sender, EventArgs e)
        {
            RingSet rs = elems [iElement] .RingSet;
            RingArea ra = rs .Rings [iRingTouched];
            for (int i = 0; i < ra .Comments .Count; i++)
            {
                ra .Comments [i] .Angle = ra .Comments [i] .AngleToCenter;
            }
            ra .FixedSectorTextsAngles = false;
            ra .EasyToReadOnRotation = true;
            if (rs .ParamsForm != null)
            {
                rs .ParamsForm .RefreshViewPart (ViewPart .Angles);
            }
            Invalidate ();
        }
        // -------------------------------------------------        Click_miRingsFixUnfixAngles
        private void Click_miRingsFixUnfixAngles (object sender, EventArgs e)
        {
            elems [iElement] .SwitchFixingAngles (iRingTouched);
        }
        // -------------------------------------------------        Click_miRingsSwitchDrawingDirection
        private void Click_miRingsSwitchDrawingDirection (object sender, EventArgs e)
        {
            elems [iElement] .SwitchDrawingDirection (iRingTouched);
            Invalidate ();
        }
        // -------------------------------------------------        DropDownOpening_miZoom
        private void DropDownOpening_miZoom (object sender, EventArgs e)
        {
            RingSet rs = elems [iElement] .RingSet;
            int innerR = rs .InnerMostRadius;
            int minW = rs .MinimumWidth;

            ToolStripMenuItem itemZoom = (ToolStripMenuItem) (menuOnRings .Items ["miZoom"]);
            for (int i = 0; i < itemZoom .DropDownItems .Count; i++)
            {
                ToolStripMenuItem item = (ToolStripMenuItem) itemZoom .DropDownItems [i];
                double coef = Convert .ToDouble (item .Text);
                if (coef < 1.0)
                {
                    item .Enabled = RingsetAllowedZoom (innerR, minW, coef);
                }
            }
        }
        // -------------------------------------------------        RingsetAllowedZoom
        private bool RingsetAllowedZoom (int innerR, int minW, double coef)
        {
            return (Convert .ToInt32 (innerR * coef) >= RingSet .MinimumAllowedInnerRadius &&
                    Convert .ToInt32 (minW * coef) >= RingSet .MinimumAllowedWidth);
        }
        // -------------------------------------------------        Click_miZoomCoef
        private void Click_miZoomCoef (object sender, EventArgs e)
        {
            elems [iElement] .RingSet .Zoom (Convert .ToDouble ((sender as ToolStripMenuItem) .Text));
            Invalidate ();
        }
        // -------------------------------------------------        Click_miRings
        private void Click_miRings (object sender, EventArgs e)
        {
            elems [iElement] .RingSet .IntoClipboard (CopyPart .PurePlot, BackColor);
        }
        // -------------------------------------------------        Click_miRingsOnWhite
        private void Click_miRingsOnWhite (object sender, EventArgs e)
        {
            elems [iElement] .RingSet .IntoClipboard (CopyPart .PurePlot, Color .White);
        }
        // -------------------------------------------------        Click_miRingSet
        private void Click_miRingSet (object sender, EventArgs e)
        {
            elems [iElement] .RingSet .IntoClipboard (CopyPart .FullPlotArea, BackColor);
        }
        // -------------------------------------------------        Click_miRingSetOnWhite
        private void Click_miRingSetOnWhite (object sender, EventArgs e)
        {
            elems [iElement] .RingSet .IntoClipboard (CopyPart .FullPlotArea, Color .White);
        }
        // -------------------------------------------------        DropDownOpening_miRingsChangeLevel
        private void DropDownOpening_miRingsChangeLevel (object sender, EventArgs e)
        {
            ToolStripMenuItem itemParent = (ToolStripMenuItem) (menuOnRings .Items ["miRingsChangeLevel"]);
            ToolStripItemCollection items = itemParent .DropDownItems;

            items ["miPutOnTop_Rings"] .Enabled = iElement > 0;
            items ["miOneLevelUp_Rings"] .Enabled = iElement > 0;
            items ["miOneLevelDown_Rings"] .Enabled = iElement < elems .Count - 1;
            items ["miSendUnderneath_Rings"] .Enabled = iElement < elems .Count - 1;
        }
        // -------------------------------------------------        Click_miAddNewRing
        private void Click_miAddNewRing (object sender, EventArgs e)
        {
            DialogResult result;
            Form_DefineNewRing form = new Form_DefineNewRing (PointToScreen (ptMouse_Up), 2, 26);
            while (DialogResult .Retry == (result = form .ShowDialog ()))
            {
                form = new Form_DefineNewRing (form .Location, 2, 26);
            }
            if (result == DialogResult .OK)
            {
                RingSet ringset = elems [iElement] .RingSet;
                PrimitiveRing ringSrc = form .Ring;
                RingArea ra = new RingArea (this, ringset .Center, ringset .OuterMostRadius + 3 * RingSet .MinimumAllowedWidth,
                                                  ringset .OuterMostRadius, ringSrc .Values);
                ra .Colors = ringSrc .Colors;
                ra .StartingAngle = ringSrc .Angle;
                for (int i = 0; i < ra .Comments .Count; i++)
                {
                    ra .Comments [i] .Text = form .Texts [i];
                }
                ringset .AddRing (ra);

                RenewMover ();
                Invalidate ();
            }
        }
        // -------------------------------------------------        Click_miDeleteRing
        private void Click_miDeleteRing (object sender, EventArgs e)
        {
            elems [iElement] .RingSet .RemoveRing (iRingTouched);
            RenewMover ();
            Invalidate ();
        }
        // -------------------------------------------------        Click_miRingsDelete
        private void Click_miRingsDelete (object sender, EventArgs e)
        {
            string quest;
            string title = elems [iElement] .RingSet .Title;
            if (title != null)
            {
                quest = "Do you want to delete RingSet \"" + title + "\" ?";
            }
            else
            {
                quest = "Do you want to delete the touched RingSet?";
            }
            if (DialogResult .Yes == MessageBox .Show (quest, "Delete RingSet", MessageBoxButtons .YesNo,
                                                       MessageBoxIcon .Question, MessageBoxDefaultButton .Button1))
            {
                DeleteElement ();
            }
        }

        // *****   menuOnRingComment   *****
        // -------------------------------------------------        Opening_menuOnRingComment
        private void Opening_menuOnRingComment (object sender, CancelEventArgs e)
        {
            ((ToolStripMenuItem) (menuOnRingComment .Items ["miRingsSwitchRotationAngle"])) .Checked = bShowAngle;
        }
        // -------------------------------------------------        Click_miRingsModifyComment
        private void Click_miRingsModifyComment (object sender, EventArgs e)
        {
            RingSet rs = elems [iElement] .RingSet;
            rs .ParametersDialog (this, RenewMover, ParamsChanged, null, rs .Title, null);
            if (rs .ParamsForm != null)
            {
                rs .ParamsForm .SelectComment (iCmntTouched);
            }
        }
        // -------------------------------------------------        Click_miRingsHideComment
        private void Click_miRingsHideComment (object sender, EventArgs e)
        {
            RingSet rs = elems [iElement] .RingSet;
            rs .Comments [iCmntTouched] .Visible = false;
            RenewMover ();
            Invalidate ();
            if (rs .ParamsForm != null)
            {
                rs .ParamsForm .RefreshView ();
            }
        }
        // -------------------------------------------------        Click_miRingsDeleteComment
        private void Click_miRingsDeleteComment (object sender, EventArgs e)
        {
            elems [iElement] .RingSet .RemoveComment (iCmntTouched);
            RenewMover ();
            Invalidate ();
        }

        // *****   menuOnRingSectorComment   *****
        // -------------------------------------------------        Opening_menuOnRingSectorComment
        private void Opening_menuOnRingSectorComment (object sender, CancelEventArgs e)
        {
            ((ToolStripMenuItem) (menuOnRingSectorComment .Items ["miRingsRotationAngle"])) .Checked = bShowAngle;
        }
        // -------------------------------------------------        Click_miRingsModifySectorComment
        private void Click_miRingsModifySectorComment (object sender, EventArgs e)
        {
            RingSet rs = elems [iElement] .RingSet;
            rs .ParametersDialog (this, RenewMover, ParamsChanged, null, rs .Title, null);
            if (rs .ParamsForm != null)
            {
                rs .ParamsForm .SelectRingAndSector (iRingTouched, iCmntTouched);
            }
        }
        // -------------------------------------------------        Click_miRingsHideSectorComment
        private void Click_miRingsHideSectorComment (object sender, EventArgs e)
        {
            RingSet rs = elems [iElement] .RingSet;
            rs .Rings [iRingTouched] .Comments [iCmntTouched] .Visible = false;
            RenewMover ();
            Invalidate ();
            if (rs .ParamsForm != null)
            {
                rs .ParamsForm .RefreshView ();
                rs .ParamsForm .SelectRingAndSector (iRingTouched, iCmntTouched);
            }
        }
        // -------------------------------------------------        DropDownOpening_miRingSectorCommentView
        private void DropDownOpening_miRingSectorCommentView (object sender, EventArgs e)
        {
            ToolStripMenuItem itemParent = (ToolStripMenuItem) sender;
            ToolStripItemCollection items = itemParent .DropDownItems;
            RoundPlotTextView cmntView = elems [iElement] .RingSet .Rings [iRingTouched] .Comments [iCmntTouched] .TextView;

            for (int i = 0; i < items .Count; i++)
            {
                ((ToolStripMenuItem) items [i]) .Checked = cmntView == (RoundPlotTextView) i;
            }
        }
        // -------------------------------------------------        Click_miRingsText and others - seven different text views
        private void Click_miRingsText (object sender, EventArgs e)
        {
            RingsSectorTextView (RoundPlotTextView .Text);
        }
        private void Click_miRingsValue (object sender, EventArgs e)
        {
            RingsSectorTextView (RoundPlotTextView .Value);
        }
        private void Click_miRingsPercent (object sender, EventArgs e)
        {
            RingsSectorTextView (RoundPlotTextView .Percent);
        }
        private void Click_miRingsTextValue (object sender, EventArgs e)
        {
            RingsSectorTextView (RoundPlotTextView .TextValue);
        }
        private void Click_miRingsTextPercent (object sender, EventArgs e)
        {
            RingsSectorTextView (RoundPlotTextView .TextPercent);
        }
        private void Click_miRingsValuePercent (object sender, EventArgs e)
        {
            RingsSectorTextView (RoundPlotTextView .ValuePercent);
        }
        private void Click_miRingsTextValuePercent (object sender, EventArgs e)
        {
            RingsSectorTextView (RoundPlotTextView .TextValuePercent);
        }
        // -------------------------------------------------        RingsSectorTextView
        private void RingsSectorTextView (RoundPlotTextView view)
        {
            elems [iElement] .RingSet .Rings [iRingTouched] .Comments [iCmntTouched] .TextView = view;
            Invalidate ();
        }
        // -------------------------------------------------        Click_miRingsColorSample
        private void Click_miRingsColorSample (object sender, EventArgs e)
        {
            RingsSectorAsSample (Sample .Color);
            Invalidate ();
        }
        private void Click_miRingsFontSample (object sender, EventArgs e)
        {
            RingsSectorAsSample (Sample .Font);
            Invalidate ();
        }
        private void Click_miRingsColorFontSample (object sender, EventArgs e)
        {
            RingsSectorAsSample (Sample .Color);
            RingsSectorAsSample (Sample .Font);
            Invalidate ();
        }
        private void Click_miRingsRadiusSample (object sender, EventArgs e)
        {
            RingsSectorAsSample (Sample .Radius);
            Invalidate ();
        }
        private void Click_miRingsAngleSample (object sender, EventArgs e)
        {
            RingsSectorAsSample (Sample .Angle);
            Invalidate ();
        }
        private void Click_miRingsTextViewSample (object sender, EventArgs e)
        {
            RingsSectorAsSample (Sample .TextView);
            Invalidate ();
        }
        private void Click_miRingsAllParamsSample (object sender, EventArgs e)
        {
            RingsSectorAsSample (Sample .Color);
            RingsSectorAsSample (Sample .Font);
            RingsSectorAsSample (Sample .Radius);
            RingsSectorAsSample (Sample .TextView);
            Invalidate ();
        }
        // -------------------------------------------------        RingsSegmentAsSample
        private void RingsSectorAsSample (Sample sampletype)
        {
            List<CommentToRingSector> cmnts = elems [iElement] .RingSet .Rings [iRingTouched] .Comments;
            CommentToRingSector cmntSample = cmnts [iCmntTouched];
            switch (sampletype)
            {
                case Sample .Color:
                    foreach (CommentToRingSector cmnt in cmnts)
                    {
                        cmnt .Color = cmntSample .Color;
                    }
                    break;
                case Sample .Font:
                    foreach (CommentToRingSector cmnt in cmnts)
                    {
                        cmnt .Font = cmntSample .Font;
                    }
                    break;
                case Sample .Radius:
                    foreach (CommentToRingSector cmnt in cmnts)
                    {
                        cmnt .PositionCoefficient = cmntSample .PositionCoefficient;
                    }
                    break;
                case Sample .Angle:
                    foreach (CommentToRingSector cmnt in cmnts)
                    {
                        cmnt .Angle = cmntSample .Angle;
                    }
                    break;
                case Sample .TextView:
                    foreach (CommentToRingSector cmnt in cmnts)
                    {
                        cmnt .TextView = cmntSample .TextView;
                    }
                    break;
            }
        }

        // *****   menuOnBarChart   *****
        // -------------------------------------------------        Opening_menuOnBarChart
        private void Opening_menuOnBarChart (object sender, CancelEventArgs e)
        {
            ToolStripItemCollection items = menuOnBarChart .Items;

            items ["miBarchartHideComments"] .Enabled = elems [iElement] .BarChart .ExistVisibleComments;  
            items ["miBarchartUnveilComments"] .Enabled = elems [iElement] .BarChart .ExistHiddenComments;   
            items ["miBarchartChangeLevel"] .Enabled = elems .Count > 1; 
            items ["miBarchartDelete"] .Enabled = elems .Count > 1;
        }
        // -------------------------------------------------        Click_miBarchartParams
        private void Click_miBarchartParams (object sender, EventArgs e)
        {
            ElementMainParametersDialog (iElement);
        }
        // -------------------------------------------------        Click_miRotateClockwise
        private void Click_miRotateClockwise (object sender, EventArgs e)
        {
            Point pt = new Point ();
            bool bTextScaleTuningOpen = CheckOpenedTuningForm (out pt);

            BarChart chart = elems [iElement] .BarChart;
            chart .CloseTuningForms ();
            chart .Rotate (Rotation .Clockwise, RenewMover);
            Invalidate ();

            ReopenTuningForm (bTextScaleTuningOpen, pt);
        }
        // -------------------------------------------------        Click_miRotateCounterclock
        private void Click_miRotateCounterclock (object sender, EventArgs e)
        {
            Point pt = new Point ();
            bool bTextScaleTuningOpen = CheckOpenedTuningForm (out pt);

            BarChart chart = elems [iElement] .BarChart;
            chart .CloseTuningForms ();
            chart .Rotate (Rotation .Counterclock, RenewMover);
            Invalidate ();

            ReopenTuningForm (bTextScaleTuningOpen, pt);
        }
        // -------------------------------------------------        CheckOpenedTuningForm
        private bool CheckOpenedTuningForm (out Point pt)
        {
            TextScale scale = elems [iElement] .BarChart .TextScale;
            bool bOpened = scale .ParamsForm != null; 
            if (bOpened) 
            {
                pt = scale .ParamsForm .Location; 
            }
            else
            {
                pt = new Point ();
            }
            return (bOpened);
        }
        // -------------------------------------------------        ReopenTuningForm
        private void ReopenTuningForm (bool bReopen, Point pt)
        {
            if (bReopen)
            {
                BarChart chart = elems [iElement] .BarChart;
                TextScale scale = chart .TextScale;
                scale .ParametersDialog (this, RenewMover, ParamsChanged, null, chart .Title, null);
                scale .ParamsForm .Location = pt;
            }
        }

        // -------------------------------------------------        Click_miBarHideComments
        private void Click_miBarHideComments (object sender, EventArgs e)
        {
            BarChart chart = elems [iElement] .BarChart;
            chart .CommentsVisibility = false; 
            RenewMover ();
            Invalidate ();
        }
        // -------------------------------------------------        Click_miBarUnveilComments
        private void Click_miBarUnveilComments (object sender, EventArgs e)
        {
            BarChart chart = elems [iElement] .BarChart;
            chart .CommentsVisibility = true;  
            RenewMover ();
            Invalidate ();
        }
        // -------------------------------------------------        Click_miBarNumscale
        private void Click_miBarNumscale (object sender, EventArgs e)
        {
            BarChart chart = elems [iElement] .BarChart;
            chart .NumScale .ParametersDialog (this, RenewMover, ParamsChanged, null, chart .Title, null);
        }
        // -------------------------------------------------        Click_miBarTextscale
        private void Click_miBarTextscale (object sender, EventArgs e)
        {
            BarChart chart = elems [iElement] .BarChart;
            chart .TextScale .ParametersDialog (this, RenewMover, ParamsChanged, null, chart .Title, null);
        }
        // -------------------------------------------------        Click_miStrips
        private void Click_miStrips (object sender, EventArgs e)
        {
            BarChart chart = elems [iElement] .BarChart;
            chart .IntoClipboard (CopyPart .PurePlot, chart .MainArea .BackColor, Color .White);
        }
        // -------------------------------------------------        Click_miStripsOnWhite
        private void Click_miStripsOnWhite (object sender, EventArgs e)
        {
            BarChart chart = elems [iElement] .BarChart;
            chart .IntoClipboard (CopyPart .PurePlot, Color .White, Color .White); 
        }
        // -------------------------------------------------        Click_miBarchartAsIs
        private void Click_miBarchart (object sender, EventArgs e)
        {
            BarChart chart = elems [iElement] .BarChart;
            chart .IntoClipboard (CopyPart .FullPlotArea, chart .MainArea .BackColor, BackColor);
        }
        // -------------------------------------------------        Click_miBarchartOnWhite
        private void Click_miBarchartOnWhite (object sender, EventArgs e)
        {
            BarChart chart = elems [iElement] .BarChart;
            chart .IntoClipboard (CopyPart .FullPlotArea, Color .White, Color .White);  
        }
        // -------------------------------------------------        DropDownOpening_miBarchartChangeLevel
        private void DropDownOpening_miBarchartChangeLevel (object sender, EventArgs e)
        {
            ToolStripMenuItem itemParent = (ToolStripMenuItem) (menuOnBarChart .Items ["miBarchartChangeLevel"]);
            ToolStripItemCollection items = itemParent .DropDownItems;

            items ["miPutOnTop_Barchart"] .Enabled = iElement > 0;
            items ["miOneLevelUp_Barchart"] .Enabled = iElement > 0;
            items ["miOneLevelDown_Barchart"] .Enabled = iElement < elems .Count - 1;
            items ["miSendUnderneath_Barchart"] .Enabled = iElement < elems .Count - 1;
        }
        // -------------------------------------------------        Click_miBarDelete
        private void Click_miBarDelete (object sender, EventArgs e)
        {
            string quest;
            string title = elems [iElement] .BarChart .Title;
            if (title != null) 
            {
                quest = "Do you want to delete BarChart \"" + title + "\" ?";
            }
            else
            {
                quest = "Do you want to delete the touched BarChart?";
            }
            if (DialogResult .Yes == MessageBox .Show (quest, "Delete BarChart", MessageBoxButtons .YesNo,
                                                       MessageBoxIcon .Question, MessageBoxDefaultButton .Button1))
            {
                DeleteElement ();
            }
        }

        // *****   menuOnScale   *****
        // -------------------------------------------------        Opening_menuOnScale
        private void Opening_menuOnScale (object sender, CancelEventArgs e)
        {
            ToolStripItemCollection items = menuOnScale .Items;

            items ["miScaleFlipDrawingDirection"] .Enabled = bTextScaleTouched == true;
            if (bNumScaleTouched)
            {
                Scale scale = elems [iElement] .BarChart .NumScale;
                items ["miScaleHideComments"] .Enabled = scale .ExistVisibleComments;
                items ["miScaleUnveilComments"] .Enabled = scale .ExistHiddenComments;
            }
            else
            {
                TextScale scale = elems [iElement] .BarChart .TextScale;
                items ["miScaleHideComments"] .Enabled = scale .ExistVisibleComments;
                items ["miScaleUnveilComments"] .Enabled = scale .ExistHiddenComments;
            }
        }
        // -------------------------------------------------        Click_miModifyScale
        private void Click_miModifyScale (object sender, EventArgs e)
        {
            BarChart chart = elems [iElement] .BarChart;
            if (bNumScaleTouched)
            {
                chart .NumScale .ParametersDialog (this, RenewMover, ParamsChanged, null, chart .Title, null);
            }
            else
            {
                chart .TextScale .ParametersDialog (this, RenewMover, ParamsChanged, null, chart .Title, null);
            }
        }
        // -------------------------------------------------        Click_miFlipScale
        private void Click_miFlipScale (object sender, EventArgs e)
        {
            if (bNumScaleTouched)
            {
                elems [iElement] .BarChart .FlipNumScale ();
            }
            else
            {
                elems [iElement] .BarChart .FlipTextScale ();
            }
            Invalidate ();
        }
        // -------------------------------------------------        Click_miHideScale
        private void Click_miHideScale (object sender, EventArgs e)
        {
            BarChart bc = elems [iElement] .BarChart;
            if (bNumScaleTouched)
            {
                bc .ShowNumScale = false;
            }
            else
            {
                bc .ShowTextScale = false;
            }
            if (bc .ParamsForm != null)
            {
                bc .ParamsForm .RefreshView ();
            }
            RenewMover ();
            Invalidate ();
        }
        // -------------------------------------------------        Click_miFlipDrawingDirection
        private void Click_miFlipDrawingDirection (object sender, EventArgs e)
        {
            elems [iElement] .BarChart .TextScale .FlipTextsDrawingDirection ();
            Invalidate ();
        }
        // -------------------------------------------------        Click_miHideScaleComments
        private void Click_miHideScaleComments (object sender, EventArgs e)
        {
            if (bNumScaleTouched)
            {
                elems [iElement] .BarChart .NumScale .CommentsVisibility = false;
            }
            else
            {
                elems [iElement] .BarChart .TextScale .CommentsVisibility = false;
            }
            RenewMover ();
            Invalidate ();
        }
        // -------------------------------------------------        Click_miUnveilScaleComments
        private void Click_miUnveilScaleComments (object sender, EventArgs e)
        {
            if (bNumScaleTouched)
            {
                elems [iElement] .BarChart .NumScale .CommentsVisibility = true;
            }
            else
            {
                elems [iElement] .BarChart .TextScale .CommentsVisibility = true;
            }
            RenewMover ();
            Invalidate ();
        }

        // *****   menuOnBarComment   *****
        // -------------------------------------------------        Opening_menuOnBarComment
        private void Opening_menuOnBarComment (object sender, CancelEventArgs e)
        {
            ((ToolStripMenuItem) (menuOnBarComment .Items ["miBarSwitchRotationAngle"])) .Checked = bShowAngle;
        }
        // -------------------------------------------------        Click_miBarModifyComment
        private void Click_miBarModifyComment (object sender, EventArgs e)
        {
            BarChart bc = elems [iElement] .BarChart;
            if (bTextScaleCmntTouched)
            {
                bc .TextScale .ParametersDialog (this, RenewMover, ParamsChanged, null, bc .Title, null);
            }
            else if (bNumScaleCmntTouched)
            {
                bc .NumScale .ParametersDialog (this, RenewMover, ParamsChanged, null, bc .Title, null);
            }
            else
            {
                bc .ParametersDialog (this, RenewMover, ParamsChanged, null, bc .Title, null);
            }
        }
        // -------------------------------------------------        Click_miBarHideComment
        private void Click_miBarHideComment (object sender, EventArgs e)
        {
            BarChart bc = elems [iElement] .BarChart;
            if (bTextScaleCmntTouched)
            {
                bc .TextScale .HideComment (iCmntTouched);
            }
            else if (bNumScaleCmntTouched)
            {
                bc .NumScale .HideComment (iCmntTouched);
            }
            else
            {
                bc .HideComment (iCmntTouched);
            }
            RenewMover ();
            Invalidate ();
        }
        // -------------------------------------------------        Click_miBarDeleteComment
        private void Click_miBarDeleteComment (object sender, EventArgs e)
        {
            BarChart bc = elems [iElement] .BarChart;
            if (bTextScaleCmntTouched)
            {
                bc .TextScale .RemoveComment (iCmntTouched);
            }
            else if (bNumScaleCmntTouched)
            {
                bc .NumScale .RemoveComment (iCmntTouched);
            }
            else
            {
                bc .RemoveComment (iCmntTouched);
            }
            RenewMover ();
            Invalidate ();
        }

        // *****   menuOnEmpty   *****
        // -------------------------------------------------        Opening_menuOnEmpty
        private void Opening_menuOnEmpty (object sender, CancelEventArgs e)
        {
            ((ToolStripMenuItem) (menuOnEmpty .Items ["miCommentsRotationAngle"])) .Checked = bShowAngle;
        }
        // -------------------------------------------------        Click_miAddBarChart
        private void Click_miAddBarChart (object sender, EventArgs e)
        {
            DialogResult result;
            
            Form_DefineNewBarChart form = new Form_DefineNewBarChart (PointToScreen (ptMouse_Up));
            while (DialogResult .Retry == (result = form .ShowDialog ()))
            {
                form = new Form_DefineNewBarChart (form .Location);
            }
            if (result == DialogResult .OK)
            {
                PrimitiveBarChart chartPrim = form .Chart;
                BarChart barchart = new BarChart (this, new Rectangle (ptMouse_Up, new Size (220, 160)),
                                                  chartPrim .TwoDimensionalValues,
                                                  Side .S, form .PrepareTexts (), TextsDrawingDirection .LTtoRB, 
                                                  Side .E, 1.0, 0.0, GridOrigin .ByStep, 0.2);
                barchart .Colors = chartPrim .Colors;
                barchart .FillCoefficients (chartPrim .EmptyStartPart, chartPrim .ColoredPart);

                elems .Insert (0, new SingleElement (barchart));

                RenewMover ();
                Invalidate ();
            }
        }
        // -------------------------------------------------        Click_miAddPieChart
        private void Click_miAddPieChart (object sender, EventArgs e)
        {
            DialogResult result;
            Form_DefineNewPieChart form = new Form_DefineNewPieChart (PointToScreen (ptMouse_Up), 2, 26);
            while (DialogResult .Retry == (result = form .ShowDialog ()))
            {
                form = new Form_DefineNewPieChart (form .Location, 2, 26);
            }
            if (result == DialogResult .OK)
            {
                PrimitivePieChart pieSrc = form .PieChart;
                PieChart pie = new PieChart (this, ptMouse_Up, 120, pieSrc .Values);
                pie .AddComment (-90, -0.4, DateTime .Now .ToShortTimeString (),
                                 new Font ("Microsoft Sans Serif", 12, FontStyle .Bold | FontStyle .Italic), 0, Color .Blue);
                pie .Colors = pieSrc .Colors;
                pie .StartingAngle = pieSrc .Angle;
                for (int i = 0; i < pie .SectorComments .Count; i++)
                {
                    pie .SectorComments [i] .Text = form .Texts [i];
                }
                elems .Insert (0, new SingleElement (pie));

                RenewMover ();
                Invalidate ();
            }
        }
        // -------------------------------------------------        Click_miAddRingSet
        private void Click_miAddRingSet (object sender, EventArgs e)
        {
            DialogResult result;
            Form_DefineNewRing form = new Form_DefineNewRing (PointToScreen (ptMouse_Up), 2, 26);
            while (DialogResult .Retry == (result = form .ShowDialog ()))
            {
                form = new Form_DefineNewRing (form .Location, 2, 26);
            }
            if (result == DialogResult .OK)
            {
                PrimitiveRing ringSrc = form .Ring;
                RingSet ringset = new RingSet (this, ptMouse_Down, 120, 40, ringSrc .Values);
                ringset .AddComment (-90, -0.3, DateTime .Now .ToShortTimeString (),
                                     new Font ("Microsoft Sans Serif", 10, FontStyle .Bold | FontStyle .Italic), 0, Color .Blue);
                RingArea ra = ringset .Rings [0];
                ra .Colors = ringSrc .Colors;
                ra .StartingAngle = ringSrc .Angle;
                for (int i = 0; i < ra .Comments .Count; i++)
                {
                    ra .Comments [i] .Text = form .Texts [i];
                }
                elems .Insert (0, new SingleElement (ringset));

                RenewMover ();
                Invalidate ();
            }
        }
        // -------------------------------------------------		Click_miDefaultView
        private void Click_miDefaultView (object sender, EventArgs e)
        {
            elems .Clear ();
            DefaultView ();
            RenewMover ();
            Invalidate ();
        }

        // *****   menuOnInfo   *****
        // -------------------------------------------------        Opening_menuOnInfo
        private void Opening_menuOnInfo (object sender, CancelEventArgs e)
        {
            ((ToolStripMenuItem) (menuOnInfo .Items ["miInfoShowFrame"])) .Checked = info .ShowFrame;
        }
        // -------------------------------------------------        Click_miInfoFont
        private void Click_miInfoFont (object sender, EventArgs e)
        {
            FontDialog dlg = new FontDialog ();

            dlg .Font = info .Font;
            if (dlg .ShowDialog () == DialogResult .OK)
            {
                info .Font = dlg .Font;
                Invalidate ();
            }
        }
        // -------------------------------------------------        Click_miInfoTextColor
        private void Click_miInfoTextColor (object sender, EventArgs e)
        {
            ColorDialog dlg = new ColorDialog ();

            dlg .Color = info .Color;
            if (dlg .ShowDialog () == DialogResult .OK)
            {
                info .Color = dlg .Color;
                Invalidate ();
            }
        }
        // -------------------------------------------------        Click_miInfoBackColor
        private void Click_miInfoBackColor (object sender, EventArgs e)
        {
            ColorDialog dlg = new ColorDialog ();

            dlg .Color = info .BackColor;
            if (dlg .ShowDialog () == DialogResult .OK)
            {
                info .BackColor = dlg .Color;
                Invalidate ();
            }
        }
        // -------------------------------------------------        DropDownOpening_miInfoTransparency
        private void DropDownOpening_miInfoTransparency (object sender, EventArgs e)
        {
            ToolStripMenuItem itemParent = (ToolStripMenuItem) sender;
            ToolStripItemCollection items = itemParent .DropDownItems;

            int A = info .BackColor .A;
            for (int i = 0; i < items .Count; i++)
            {
                ((ToolStripMenuItem) items [i]) .Checked = A == Convert .ToInt32 (255 * (1 - Convert .ToSingle (items [i] .Text)));
            }
        }
        // -------------------------------------------------        Click_miInfoTransparency
        private void Click_miInfoTransparency (object sender, EventArgs e)
        {
            Color clrBack = info .BackColor;
            Color clrNew = Color .FromArgb (Convert .ToInt32 (255 * (1 - Convert .ToSingle ((sender as ToolStripMenuItem) .Text))),
                                            clrBack .R, clrBack .G, clrBack .B);
            info .BackColor = clrNew;
            Invalidate ();
        }
        // -------------------------------------------------        Click_miInfoShowFrame
        private void Click_miInfoShowFrame (object sender, EventArgs e)
        {
            info .ShowFrame = !info .ShowFrame;
            Invalidate ();
        }

        const string nameElemTypes = "ElemTypes";
        const string nameCommon = "Common";
        // -------------------------------------------------        SaveInfoToRegistry
        private void SaveInfoToRegistry ()
        {
            string strRegKey = Form_Main .strRegKey + strAddRegKey;

            RegistryKey regkey = null;
            try
            {
                regkey = Registry .CurrentUser .CreateSubKey (strRegKey);
                if (regkey != null)
                {
                    string [] strSizes = {  version .ToString (),         // 0 
                                            ClientSize .Width .ToString (),     // 1            
                                            ClientSize .Height .ToString (),    // 2
                                          };
                    regkey .SetValue (nameCommon, strSizes, RegistryValueKind .MultiString);
                    info .IntoRegistry (regkey, "Info");

                    string [] strTypes = new string [elems .Count];
                    for (int i = 0; i < elems .Count; i++)
                    {
                        switch (elems [i] .ElementType)
                        {
                            case MedleyElem .BarChart:
                                strTypes [i] = "Bar_";
                                elems [i] .BarChart .IntoRegistry (regkey, strTypes [i] + i .ToString ());
                                break;
                            case MedleyElem .PieChart:
                                strTypes [i] = "Pie_";
                                elems [i] .PieChart .IntoRegistry (regkey, strTypes [i] + i .ToString ());
                                break;
                            case MedleyElem .RingSet:
                                strTypes [i] = "Rings_";
                                elems [i] .RingSet .IntoRegistry (regkey, strTypes [i] + i .ToString ());
                                break;
                        }
                    }
                    regkey .SetValue (nameElemTypes, strTypes, RegistryValueKind .MultiString);
                }
            }
            catch
            {
            }
            finally
            {
                if (regkey != null) regkey .Close ();
            }
        }
        // -------------------------------------------------        RestoreFromRegistry
        private void RestoreFromRegistry ()
        {
            string namekey = Form_Main .strRegKey + strAddRegKey;

            RegistryKey regkey = null;
            try
            {
                regkey = Registry .CurrentUser .OpenSubKey (namekey);
                if (regkey != null)
                {
                    string [] strMain = (string []) regkey .GetValue (nameCommon);
                    if (strMain != null && strMain .Length == 3 && Convert .ToInt32 (strMain [0]) >= 606)
                    {
                        ClientSize = Auxi_Convert .ToSize (strMain, 1);
                        info = ClosableInfo .FromRegistry (this, regkey, "Info");

                        string [] strTypes = (string []) regkey .GetValue (nameElemTypes);
                        if (strTypes != null)
                        {
                            for (int i = 0; i < strTypes .Length; i++)
                            {
                                if (strTypes [i] == "Bar_")
                                {
                                    BarChart barchart = BarChart .FromRegistry (this, regkey, strTypes [i] + i .ToString ());
                                    if (barchart != null)
                                    {
                                        elems .Add (new SingleElement (barchart));
                                    }
                                }
                                else if (strTypes [i] == "Pie_")
                                {
                                    PieChart piechart = PieChart .FromRegistry (this, regkey, strTypes [i] + i .ToString ());
                                    if (piechart != null)
                                    {
                                        elems .Add (new SingleElement (piechart));
                                    }
                                }
                                else if (strTypes [i] == "Rings_")
                                {
                                    RingSet rings = RingSet .FromRegistry (this, regkey, strTypes [i] + i .ToString ());
                                    if (rings != null)
                                    {
                                        elems .Add (new SingleElement (rings));
                                    }
                                }
                            }
                            bRestore = true;
                        }
                    }
                    regkey .Close ();
                }
            }
            catch
            {
            }
            finally
            {
                if (regkey != null) regkey .Close ();
            }
        }

    }
}

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 | Terms of Use | Mobile
Web04 | 2.8.1411023.1 | Last Updated 10 Apr 2010
Article Copyright 2010 by SergeyAndreyev
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid