Esempio n. 1
0
        //private string IsRepeat(bool mathProp, bool Letter, ShapeData data, BindableCollection<ShapeData> given)
        //{
        //    string result = string.Empty;

        //    var repeatMath = 0;
        //    var repeatLetter = 0;

        //    if (mathProp == true)
        //    {
        //        foreach (var item in given)
        //        {
        //            if (item.MathematicalProperty.Name == data.MathematicalProperty.Name)
        //            {
        //                repeatMath++;
        //                if (repeatMath == 1)
        //                {
        //                    repeatMath = 0;
        //                    return data.MathematicalProperty.Name;
        //                }
        //            }
        //        }
        //    }
        //    if (Letter == true)
        //    {
        //        foreach (var item in given)
        //        {
        //            if (item.Letter == data.Letter)
        //            {
        //                repeatLetter++;
        //                if (repeatLetter == 1)
        //                {
        //                    repeatLetter = 0;
        //                    return data.Letter;
        //                }
        //            }
        //        }
        //    }
        //
        //    return result;
        //}

        private string SetLetter(BindableCollection <ShapeData> Collection, int par, List <TextBoxDropDownModel> props,
                                 string Letter)
        {
            var textBox = new TextBoxDropDownModel();

            if (Collection.Count > par)
            {
                var shapeData = Collection[par];

                var Prop = props[par];

                if (shapeData != null)
                {
                    Prop.Name = shapeData.Letter;


                    if (shapeData.MyVisibility == Visibility.Collapsed)
                    {
                        textBox.Name = Letter;

                        shapeData.Letter = Letter;

                        Collection[par] = shapeData;

                        props[par] = textBox;
                    }
                }

                Formatting(shapeData);

                //shapeData.IsRepeat = IsRepeat(true, false, shapeData, GivenInput);

                //if (shapeData.IsRepeat)
                //{
                //    RemoveShapeHelp(GivenInput, shapeData, MathProps, LetterProps);
                //}

                Collection.Refresh();

                Figures = da.BrushLine(GivenInput, FindInput, "#5983EB", "#33AF63", Figures);

                return(Prop.Name);
            }


            return(null);
        }
Esempio n. 2
0
        private string FindButtonHelp(BindableCollection <ShapeData> Collection, int par, List <TextBoxDropDownModel> props,
                                      string MathProp)
        {
            var textBox = new TextBoxDropDownModel();

            //for (int i = 0; i < Collection.Count; i++)
            //{
            //    Collection[i].ShapeId = i;
            //}

            if (Collection.Count > par)
            {
                var shapeData = Collection[par];

                var Prop = props[par];

                Prop = shapeData.MathematicalProperty;

                СheckVisibility(Collection, par);

                if (shapeData.MyVisibility == Visibility.Collapsed)
                {
                    textBox.Name = MathProp;

                    shapeData.MathematicalProperty.Name = MathProp;

                    Collection[par] = shapeData;

                    props[par] = textBox;

                    //Formatting(shapeData);
                }

                Collection.Refresh();

                return(Prop.Name);
            }
            return(null);
        }