コード例 #1
0
ファイル: FormulaData.cs プロジェクト: Bulletz4mysa/NBTrade
        public void SetAttr(string s)
        {
            try
            {
                this.RenderType = (FormulaRenderType)Enum.Parse(typeof(FormulaRenderType), s, true);
                return;
            }
            catch
            {
            }

            try
            {
                this.Dot = (FormulaDot)Enum.Parse(typeof(FormulaDot), s, true);
                return;
            }
            catch
            {
            }

            try
            {
                this.Align = (FormulaAlign)Enum.Parse(typeof(FormulaAlign), s, true);
                return;
            }
            catch
            {
            }

            try
            {
                this.Smoothing = (SmoothingMode)Enum.Parse(typeof(SmoothingMode), s, true);
                return;
            }
            catch
            {
            }

            try
            {
                this.VAlign = (VerticalAlign)Enum.Parse(typeof(VerticalAlign), s, true);
                return;
            }
            catch
            {
            }

            try
            {
                this.Transform = (Transform)Enum.Parse(typeof(Transform), s, true);
                return;
            }
            catch
            {
            }
            s = s.ToUpper();
            SetProperties(s);
        }
コード例 #2
0
ファイル: FormulaData.cs プロジェクト: Bulletz4mysa/NBTrade
        public void SetAttr(string s)
        {
            try
            {
                this.RenderType = (FormulaRenderType)Enum.Parse(typeof(FormulaRenderType), s, true);
            }
            catch
            {
            }
            return;

            try
            {
                this.Dot = (FormulaDot)Enum.Parse(typeof(FormulaDot), s, true);
            }
            catch
            {
            }
            return;

            try
            {
                this.Align = (FormulaAlign)Enum.Parse(typeof(FormulaAlign), s, true);
            }
            catch
            {
            }
            return;

            try
            {
                this.Smoothing = (SmoothingMode)Enum.Parse(typeof(SmoothingMode), s, true);
            }
            catch
            {
            }
            return;

            try
            {
                this.VAlign = (VerticalAlign)Enum.Parse(typeof(VerticalAlign), s, true);
            }
            catch
            {
            }
            return;

            try
            {
                this.Transform = (Easychart.Finance.Transform)Enum.Parse(typeof(Easychart.Finance.Transform), s, true);
            }
            catch
            {
            }
            s = s.ToUpper();
            if (s.StartsWith("COLOR"))
            {
                this.SetColor(s.Substring(5));
            }
            else if (s.StartsWith("WIDTH"))
            {
                this.SetWidth(s.Substring(5));
            }
            else if (s.StartsWith("LINETHICK"))
            {
                this.SetWidth(s.Substring(9));
            }
            else if (s.StartsWith("ALIGN"))
            {
                this.SetAlign(s.Substring(5));
            }
            else if (s.StartsWith("BRUSH"))
            {
                this.SetBrush(s.Substring(5));
            }
            else if (s.StartsWith("LABEL"))
            {
                this.SetLabel(s.Substring(5));
            }
            else if (s.StartsWith("VALIGN"))
            {
                this.SetVAlign(s.Substring(6));
            }
            else if (s.StartsWith("AXISMARGIN"))
            {
                this.SetAxisMargin(s.Substring(10));
            }
            else if (s.StartsWith("STYLE"))
            {
                this.SetStyle(s.Substring(5));
            }
        }
コード例 #3
0
ファイル: FormulaData.cs プロジェクト: Bulletz4mysa/NBTrade
        public void SetAttr(string s)
        {
            try
            {
                RenderType = (FormulaRenderType)Enum.Parse(typeof(FormulaRenderType), s, true);
                return;
            }
            catch
            {
            }

            try
            {
                Dot = (FormulaDot)Enum.Parse(typeof(FormulaDot), s, true);
                return;
            }
            catch
            {
            }

            try
            {
                Align = (FormulaAlign)Enum.Parse(typeof(FormulaAlign), s, true);
                return;
            }
            catch
            {
            }

            try
            {
                Smoothing = (SmoothingMode)Enum.Parse(typeof(SmoothingMode), s, true);
                return;
            }
            catch
            {
            }

            try
            {
                VAlign = (VerticalAlign)Enum.Parse(typeof(VerticalAlign), s, true);
                return;
            }
            catch
            {
            }

            try
            {
                Transform = (Transform)Enum.Parse(typeof(Transform), s, true);
            }
            catch
            {
            }

            string su = s.ToUpper();

            if (su == "SAMECOLOR")
            {
                SameColor = true;
            }
            else if (su.StartsWith("COLOR"))
            {
                SetColor(s.Substring(5), false);
            }
            else if (su.StartsWith("UPCOLOR"))
            {
                SetColor(s.Substring(7), false);
            }
            else if (su.StartsWith("DOWNCOLOR"))
            {
                SetColor(s.Substring(9), true);
            }
            else if (su.StartsWith("WIDTH"))
            {
                SetWidth(s.Substring(5));
            }
            else if (su.StartsWith("LINETHICK"))
            {
                SetWidth(s.Substring(9));
            }
            else if (su.StartsWith("ALIGN"))
            {
                SetAlign(s.Substring(5));
            }
            else if (su.StartsWith("BRUSH"))
            {
                SetBrush(s.Substring(5));
            }
            else if (su.StartsWith("LABEL"))
            {
                SetLabel(s.Substring(5));
            }
            else if (su.StartsWith("VALIGN"))
            {
                SetVAlign(s.Substring(6));
            }
            else if (su.StartsWith("AXISMARGIN"))
            {
                SetAxisMargin(s.Substring(10));
            }
            else if (su.StartsWith("STYLE"))
            {
                SetStyle(s.Substring(5));
            }
            else if (su.StartsWith("FONT"))
            {
                SetFont(s.Substring(4));
            }
            else if (su.StartsWith("HIGH"))
            {
                SetPercent(s.Substring(4), true);
            }
            else if (su.StartsWith("LOW"))
            {
                SetPercent(s.Substring(3), false);
            }
            else if (su.StartsWith("ALPHA"))
            {
                SetAlpha(s.Substring(5));
            }
            else if (su.StartsWith("YLABEL"))
            {
                LastValueInAxis = true;
            }
            else if (su == "VALUETEXT.NONE" || su == "NOVALUELABEL")
            {
                //TextInvisible = true;
                ValueTextMode = ValueTextMode.None;
            }
            else if (su == "VALUETEXT.TEXTONLY")
            {
                ValueTextMode = ValueTextMode.TextOnly;
            }
            else if (su == "VALUETEXT.VALUEONLY")
            {
                ValueTextMode = ValueTextMode.ValueOnly;
            }
            else if (su == "HORIZONTAL")
            {
                Horizontal = true;
            }
        }