CSReportEditor.cEditor.getRegionForControlAux C# (CSharp) Метод

getRegionForControlAux() приватный Метод

private getRegionForControlAux ( cIReportGroupSections rptSections, float x, float y, cReportSection &rptSection, bool isFreeCtrl ) : bool
rptSections cIReportGroupSections
x float
y float
rptSection CSReportDll.cReportSection
isFreeCtrl bool
Результат bool
        private bool getRegionForControlAux(cIReportGroupSections rptSections, 
                                            float x, 
                                            float y, 
                                            out cReportSection rptSection, 
                                            bool isFreeCtrl) 
        {
            float y1 = 0;
            float y2 = 0;
            cReportSection rtnSec = null;

            rptSection = null;

            for (int _i = 0; _i < rptSections.count(); _i++) {
                
                cReportSection rptSec = rptSections.item(_i);
                cReportAspect w_aspect = rptSec.getAspect();

                y1 = w_aspect.getTop();
                y2 = w_aspect.getTop() + w_aspect.getHeight();

                if (isFreeCtrl) {
                    if (y1 <= y) {
                        rtnSec = rptSec;
                    }
                } 
                else {
                    if (y1 <= y && y2 >= y) { 
                        return true; 
                    }
                }
            }

            if (rtnSec != null) {
                rptSection = rtnSec;
                return true;
            }
            else {
                return false;
            }
        }
cEditor