void PropertyGrid_PropertyValueChanged(object sender, PropertyGridItemValueChangedEventArgs e)
        {
            //if this property has an on value changed command
            string propertyName = GetLongPropertyName(e.Item);

            if (onValueChangedCommands.ContainsKey(propertyName))
            {
                string commandClassName = onValueChangedCommands[propertyName];

                if (!String.IsNullOrEmpty(commandClassName))
                {
                    //create the command dynamically and execute it
                    Assembly a             = Assembly.GetExecutingAssembly();
                    string   fullClassName = String.Format("CodeTorch.Designer.Designers.PropertyValueChanged.{0}", commandClassName);
                    IPropertyValueChangedCommand command = (IPropertyValueChangedCommand)a.CreateInstance(fullClassName, true);
                    command.Execute(this.PropertyGrid);
                }
            }
        }
 private void radPropertyGrid1_PropertyValueChanged(object sender, PropertyGridItemValueChangedEventArgs e)
 {
     this.ShowEventMessage("PropertyValueChanged");
 }
Exemple #3
0
        private void pgrdStudy_PropertyValueChanged(object sender, PropertyGridItemValueChangedEventArgs e)
        {
            Color StudyColor = (Color)pgrdStudy.Items[0].Value;

            Enums.LineStyle StudyLineStyle      = (Enums.LineStyle)pgrdStudy.Items[1].Value;
            int             StudyLineThickness  = (int)pgrdStudy.Items[2].Value;
            bool            StudyRightExtension = (bool)pgrdStudy.Items[3].Value;
            bool            StudyLeftExtension  = (bool)pgrdStudy.Items[4].Value;
            bool            StudyExtension      = (bool)pgrdStudy.Items[5].Value;
            double          StudyParam00        = (bool)pgrdStudy.Items[10].Value ? 0.0 : NULL_VALUE;
            double          StudyParam38        = (bool)pgrdStudy.Items[9].Value ? 0.382 : NULL_VALUE;
            double          StudyParam50        = (bool)pgrdStudy.Items[8].Value ? 0.5 : NULL_VALUE;
            double          StudyParam61        = (bool)pgrdStudy.Items[7].Value ? 0.618 : NULL_VALUE;
            double          StudyParam100       = (bool)pgrdStudy.Items[6].Value ? 1.0 : NULL_VALUE;
            double          StudyParam161       = (bool)pgrdStudy.Items[11].Value ? 1.618 : NULL_VALUE;
            double          StudyParam261       = (bool)pgrdStudy.Items[12].Value ? 2.618 : NULL_VALUE;
            double          StudyValue          = (double)pgrdStudy.Items[13].Value;

            infoGrid = new StudyInfo
            {
                ColorParameters          = StudyColor,
                LineStyleParameters      = StudyLineStyle,
                LineThicknessParameters  = StudyLineThickness,
                RightExtensionParameters = StudyRightExtension,
                LeftExtensionParameters  = StudyLeftExtension,
                ExtensionParameters      = StudyExtension
            };
            if (LineStudyType == "TrendLine")
            {
                StockChartX1.UpdateTrendLine(LineStudyKey, StudyLineStyle.GetHashCode(), StudyLineThickness,
                                             StudyColor.R, StudyColor.G,
                                             StudyColor.B, false, StudyRightExtension, StudyLeftExtension, 0);
            }
            else if (LineStudyType == "RayLine")
            {
                StockChartX1.UpdateTrendLine(LineStudyKey, StudyLineStyle.GetHashCode(), StudyLineThickness,
                                             StudyColor.R, StudyColor.G,
                                             StudyColor.B, true, StudyExtension, StudyExtension, 0);
            }
            else if (LineStudyType == "VerticalLine")
            {
                StockChartX1.UpdateTrendLine(LineStudyKey, StudyLineStyle.GetHashCode(), StudyLineThickness,
                                             StudyColor.R, StudyColor.G,
                                             StudyColor.B, false, false, false, 0);
            }
            else if (LineStudyType == "HorizontalLine")
            {
                StockChartX1.UpdateTrendLine(LineStudyKey, StudyLineStyle.GetHashCode(), StudyLineThickness,
                                             StudyColor.R, StudyColor.G,
                                             StudyColor.B, false, false, StudyExtension, StudyValue);
            }
            else if (LineStudyType == "Rectangle")
            {
                StockChartX1.UpdateTrendLine(LineStudyKey, StudyLineStyle.GetHashCode(), StudyLineThickness,
                                             StudyColor.R, StudyColor.G,
                                             StudyColor.B, false, false, false, 0);
            }
            else if (LineStudyType == "Ellipse")
            {
                StockChartX1.UpdateTrendLine(LineStudyKey, StudyLineStyle.GetHashCode(), StudyLineThickness,
                                             StudyColor.R, StudyColor.G,
                                             StudyColor.B, false, false, false, 0);
            }
            else if (LineStudyType == "Arrow")
            {
                StockChartX1.UpdateTrendLine(LineStudyKey, StudyLineStyle.GetHashCode(), StudyLineThickness,
                                             StudyColor.R, StudyColor.G,
                                             StudyColor.B, false, false, false, 0);
            }
            else if (LineStudyType == "FreeHand")
            {
                StockChartX1.UpdateTrendLine(LineStudyKey, StudyLineStyle.GetHashCode(), StudyLineThickness,
                                             StudyColor.R, StudyColor.G,
                                             StudyColor.B, false, false, false, 0);
            }
            else if (LineStudyType == "Polyline")
            {
                StockChartX1.UpdateTrendLine(LineStudyKey, StudyLineStyle.GetHashCode(), StudyLineThickness,
                                             StudyColor.R, StudyColor.G,
                                             StudyColor.B, false, false, false, 0);
            }
            else if (LineStudyType == "Channel")
            {
                StockChartX1.UpdateTrendLine(LineStudyKey, StudyLineStyle.GetHashCode(), StudyLineThickness,
                                             StudyColor.R, StudyColor.G,
                                             StudyColor.B, false, true, StudyExtension, 0);
            }
            else if (LineStudyType == "Fibonacci Arcs")
            {
                StockChartX1.UpdateTrendLine(LineStudyKey, StudyLineStyle.GetHashCode(), StudyLineThickness,
                                             StudyColor.R, StudyColor.G,
                                             StudyColor.B, false, true, false, 0);
            }
            else if (LineStudyType == "Fibonacci Fan")
            {
                StockChartX1.UpdateTrendLine(LineStudyKey, StudyLineStyle.GetHashCode(), StudyLineThickness,
                                             StudyColor.R, StudyColor.G,
                                             StudyColor.B, false, true, false, 0);
            }
            else if (LineStudyType == "Fibonacci Projections")
            {
                StockChartX1.UpdateTrendLine(LineStudyKey, StudyLineStyle.GetHashCode(), StudyLineThickness,
                                             StudyColor.R, StudyColor.G,
                                             StudyColor.B, false, true, false, 0);
                StockChartX1.UpdateFibonacciParams(LineStudyKey, StudyParam100, StudyParam61, StudyParam50, StudyParam38, StudyParam00, StudyParam161, StudyParam261, NULL_VALUE, NULL_VALUE, NULL_VALUE);
            }
            else if (LineStudyType == "Fibonacci Retracements")
            {
                StockChartX1.UpdateTrendLine(LineStudyKey, StudyLineStyle.GetHashCode(), StudyLineThickness,
                                             StudyColor.R, StudyColor.G,
                                             StudyColor.B, false, true, false, 0);
                StockChartX1.UpdateFibonacciParams(LineStudyKey, StudyParam100, StudyParam61, StudyParam50, StudyParam38, StudyParam00, StudyParam161, StudyParam261, NULL_VALUE, NULL_VALUE, NULL_VALUE);
            }
            else if (LineStudyType == "Fibonacci Timezones")
            {
                StockChartX1.UpdateTrendLine(LineStudyKey, StudyLineStyle.GetHashCode(), StudyLineThickness,
                                             StudyColor.R, StudyColor.G,
                                             StudyColor.B, false, true, false, 0);
            }
            else if (LineStudyType == "Speed Line")
            {
                StockChartX1.UpdateTrendLine(LineStudyKey, StudyLineStyle.GetHashCode(), StudyLineThickness,
                                             StudyColor.R, StudyColor.G,
                                             StudyColor.B, false, true, false, 0);
            }
            else if (LineStudyType == "Gann Fan")
            {
                StockChartX1.UpdateTrendLine(LineStudyKey, StudyLineStyle.GetHashCode(), StudyLineThickness,
                                             StudyColor.R, StudyColor.G,
                                             StudyColor.B, false, true, false, 0);
            }
        }
 private void radPropertyGrid1_PropertyValueChanged(object sender, PropertyGridItemValueChangedEventArgs e)
 {
     this.ProcessProgressBarValues();
 }