public void RightRoll()
        {
            var listBase = DrawningFraemworkElements.ToList().FindAll(x => (x.DataContext is BaseDrawClass));

            if (listBase.Count > 0)
            {
                foreach (var var in listBase)
                {
                    if ((var.DataContext as BaseDrawClass).IsSelected)
                    {
                        (var.DataContext as BaseDrawClass).PositiveRotation();
                    }
                }
            }
            var listBaseCell = DrawningFraemworkElements.ToList().FindAll(x => (x.DataContext is CellAreaBlock));

            if (listBaseCell.Count > 0)
            {
                foreach (var vari in listBaseCell)
                {
                    if ((vari.DataContext as CellAreaBlock).IsSelected)
                    {
                        (vari.DataContext as CellAreaBlock).RotationRight();
                    }
                }
            }
        }
        private void LoadDialog(double width, double depth)
        {
            var dw = new DialogWindow(
                "Загруженная конфигурация не подходит по размерам к шаблону. Попробуйте загрузить другую конфигурация или выбрать подходящий шаблон",
                "Неподходящий шаблон");

            if (dw.ShowDialog() != true)
            {
                switch (dw.GetSelection())
                {
                case Selection.None:
                    IToastNotifications.ShowError("Конфигурация не загружена");
                    break;
                }
            }


            switch (dw.GetSelection())
            {
            case Selection.LoadConfig:
                if (_roomType == RoomType.HighVoltage)
                {
                    FileLoad(Handler.RUVN, null);
                    MainDataParsing(_iCommonData.RUVN_GetCommonData(), AreaType.HighVoltage);
                }

                if (_roomType == RoomType.LowVoltage)
                {
                    FileLoad(Handler.RUNN, null);
                    MainDataParsing(_iCommonData.RUNN_GetCommonData(), AreaType.LowVoltage);
                }

                break;

            case Selection.ResizeComposite:
            {
                if (_roomType == RoomType.HighVoltage)
                {
                    List <ClassCompositeBMZ> lst = GetInformBMZ.GetList();
                    var listCell  = DrawningFraemworkElements.ToList().FindAll(x => x is CellAreaBlock);
                    var blockcell = listCell.Find(x =>
                                                  (x as CellAreaBlock)._cellAreaData.AreaType == AreaType.LowVoltage);
                    if (blockcell == null)
                    {
                        var lstf = lst.FindAll(x => (x.idBMZ == MyBMZ.idBMZ) &&
                                               (x.InformationForBuild.Gv1 == depth) &&
                                               (x.InformationForBuild.Dv1 + x.InformationForBuild.Dv2 > width));
                        if (lstf.Count != 0)
                        {
                            Mouse.OverrideCursor       = Cursors.Wait;
                            lstf[0].dOneSQuestParametr = GetInformBMZ.SelectBMZ().dOneSQuestParametr;
                            lstf[0].elementFloor       = MyBMZ.elementFloor;
                            lstf[0].schemeRUVN         = MyBMZ.schemeRUVN;
                            lstf[0].schemeRUNN         = MyBMZ.schemeRUNN;
                            GetInformBMZ.GetSelectBMZ(lstf[0]);
                            BuildBMZ(GetInformBMZ.SelectBMZ());
                            var listPlace       = BaseDrawElements.ToList().FindAll(x => x is VMRUVNPlace);
                            var placeforHidesht = listPlace.Find(x =>
                                                                 string.Equals((x as VMRUVNPlace).namePlaceFrame, _placeforHide.namePlaceFrame, System.StringComparison.OrdinalIgnoreCase));
                            _placeforHide = (VMRUVNPlace)placeforHidesht;
                            MainDataParsing(_iCommonData.RUVN_GetCommonData(), AreaType.HighVoltage);
                            Mouse.OverrideCursor = null;
                        }
                        else
                        {
                            DialogAfterNoFind();
                        }
                    }
                    else
                    {
                        var places = DrawningFraemworkElements.ToList().FindAll(x => x is CellAreaBlock);
                        var place  = places.Find(x =>
                                                 (x as CellAreaBlock)._cellAreaData.AreaType == AreaType.LowVoltage);
                        var goodLst   = BaseDrawElements.ToList().FindAll(x => x is PVMCell);
                        var goodCells = goodLst.Find(x => (x as PVMCell).type == AreaType.LowVoltage);



                        var lstf = lst.FindAll(x => (x.idBMZ == MyBMZ.idBMZ) &&
                                               (x.InformationForBuild.Gv1 == depth) &&
                                               (x.InformationForBuild.Dv1 + x.InformationForBuild.Dv2 > width) &&
                                               (x.InformationForBuild.Gn1 > (place as CellAreaBlock)._cellAreaData.Height) &&
                                               (x.InformationForBuild.Dn1 + x.InformationForBuild.Dn2 > (goodCells as PVMCell).WidthAllCell));
                        if (lstf.Count != 0)
                        {
                            Mouse.OverrideCursor       = Cursors.Wait;
                            lstf[0].dOneSQuestParametr = GetInformBMZ.SelectBMZ().dOneSQuestParametr;
                            lstf[0].schemeRUVN         = MyBMZ.schemeRUVN;
                            lstf[0].schemeRUNN         = MyBMZ.schemeRUNN;
                            GetInformBMZ.GetSelectBMZ(lstf[0]);
                            BuildBMZ(GetInformBMZ.SelectBMZ());
                            var listPlace       = BaseDrawElements.ToList().FindAll(x => x is VMRUVNPlace);
                            var placeforHidesht = listPlace.Find(x =>
                                                                 string.Equals((x as VMRUVNPlace).namePlaceFrame, _placeforHide.namePlaceFrame, System.StringComparison.OrdinalIgnoreCase));
                            _placeforHide = (VMRUVNPlace)placeforHidesht;
                            MainDataParsing(_iCommonData.RUVN_GetCommonData(), AreaType.HighVoltage);
                            Mouse.OverrideCursor = null;
                        }
                        else
                        {
                            DialogAfterNoFind();
                        }
                    }
                }

                if (_roomType == RoomType.LowVoltage)
                {
                    List <ClassCompositeBMZ> lst = GetInformBMZ.GetList();
                    var listCell  = DrawningFraemworkElements.ToList().FindAll(x => x is CellAreaBlock);
                    var blockcell = listCell.Find(x =>
                                                  (x as CellAreaBlock)._cellAreaData.AreaType == AreaType.HighVoltage);
                    if (blockcell == null)
                    {
                        var lstf = lst.FindAll(x => (x.idBMZ == MyBMZ.idBMZ) &&
                                               (x.InformationForBuild.Gn1 == depth) &&
                                               (x.InformationForBuild.Dn1 + x.InformationForBuild.Dn2 >
                                                width));
                        if (lstf.Count != 0)
                        {
                            Mouse.OverrideCursor       = Cursors.Wait;
                            lstf[0].dOneSQuestParametr = GetInformBMZ.SelectBMZ().dOneSQuestParametr;
                            lstf[0].schemeRUVN         = MyBMZ.schemeRUVN;
                            lstf[0].schemeRUNN         = MyBMZ.schemeRUNN;
                            lstf[0].elementFloor       = MyBMZ.elementFloor;
                            GetInformBMZ.GetSelectBMZ(lstf[0]);
                            BuildBMZ(GetInformBMZ.SelectBMZ());
                            var listPlace       = BaseDrawElements.ToList().FindAll(x => x is VMRUVNPlace);
                            var placeforHidesht = listPlace.Find(x =>
                                                                 string.Equals((x as VMRUVNPlace).namePlaceFrame, _placeforHide.namePlaceFrame, System.StringComparison.OrdinalIgnoreCase));
                            _placeforHide = (VMRUVNPlace)placeforHidesht;
                            MainDataParsing(_iCommonData.RUNN_GetCommonData(), AreaType.LowVoltage);
                            Mouse.OverrideCursor = null;
                        }
                        else
                        {
                            DialogAfterNoFind();
                        }
                    }
                    else
                    {
                        var places = DrawningFraemworkElements.ToList().FindAll(x => x is CellAreaBlock);
                        var place  = places.Find(x =>
                                                 (x as CellAreaBlock)._cellAreaData.AreaType == AreaType.HighVoltage);

                        var goodLst   = BaseDrawElements.ToList().FindAll(x => x is PVMCell);
                        var goodCells = goodLst.Find(x => (x as PVMCell).type == AreaType.HighVoltage);
                        var lstf      = lst.FindAll(x => (x.idBMZ == MyBMZ.idBMZ) &&
                                                    (x.InformationForBuild.Gn1 == depth) &&
                                                    (x.InformationForBuild.Dn1 + x.InformationForBuild.Dn2 >
                                                     width) &&
                                                    (x.InformationForBuild.Gv1 > (place as CellAreaBlock)._cellAreaData.Height) &&
                                                    (x.InformationForBuild.Dv1 + x.InformationForBuild.Dv2 > (goodCells as PVMCell).WidthAllCell));
                        if (lstf.Count != 0)
                        {
                            Mouse.OverrideCursor       = Cursors.Wait;
                            lstf[0].dOneSQuestParametr = GetInformBMZ.SelectBMZ().dOneSQuestParametr;
                            lstf[0].schemeRUVN         = MyBMZ.schemeRUVN;
                            lstf[0].schemeRUNN         = MyBMZ.schemeRUNN;
                            lstf[0].elementFloor       = MyBMZ.elementFloor;
                            GetInformBMZ.GetSelectBMZ(lstf[0]);
                            BuildBMZ(GetInformBMZ.SelectBMZ());
                            var listPlace       = BaseDrawElements.ToList().FindAll(x => x is VMRUVNPlace);
                            var placeforHidesht = listPlace.Find(x =>
                                                                 string.Equals((x as VMRUVNPlace).namePlaceFrame, _placeforHide.namePlaceFrame, System.StringComparison.OrdinalIgnoreCase));
                            _placeforHide = (VMRUVNPlace)placeforHidesht;
                            MainDataParsing(_iCommonData.RUNN_GetCommonData(), AreaType.LowVoltage);
                            Mouse.OverrideCursor = null;
                        }
                        else
                        {
                            DialogAfterNoFind();
                        }
                    }
                }
            }
            break;

            case Selection.RebuildConfig:

                if (_roomType == RoomType.HighVoltage)
                {
                    StartMaster(Handler.RUVN, AreaType.HighVoltage,
                                (int)_iCommonData.RUVN_GetCommonData().ProductType,
                                _iCommonData.RUVN_GetCommonData().FilePath);
                }
                if (_roomType == RoomType.LowVoltage)
                {
                    StartMaster(Handler.RUNN, AreaType.LowVoltage,
                                (int)_iCommonData.RUNN_GetCommonData().ProductType,
                                _iCommonData.RUNN_GetCommonData().FilePath);
                }
                return;

            case Selection.None:
                IToastNotifications.ShowError("Конфигурация не загружена");
                break;
            }
        }