IsStrDescriptionRelevant() public static method

It tells if the strategy description is relevant.
public static IsStrDescriptionRelevant ( ) : bool
return bool
Exemplo n.º 1
0
 /// <summary>
 /// Sets the strategy description button icon
 /// </summary>
 private void SetStrategyDescriptionButton()
 {
     if (string.IsNullOrEmpty(Data.Strategy.Description))
     {
         ButtonStrategyInfo.Image = Resources.str_info_noinfo;
     }
     else
     {
         ButtonStrategyInfo.Image = Data.IsStrDescriptionRelevant() ? Resources.str_info_infook : Resources.str_info_warning;
     }
 }
 /// <summary>
 /// Sets the strategy description button icon
 /// </summary>
 void SetSrategyDescriptionButton()
 {
     if (Data.Strategy.Description == "")
     {
         tsbtStrategyInfo.Image = Properties.Resources.str_info_noinfo;
     }
     else
     {
         if (Data.IsStrDescriptionRelevant())
         {
             tsbtStrategyInfo.Image = Properties.Resources.str_info_infook;
         }
         else
         {
             tsbtStrategyInfo.Image = Properties.Resources.str_info_warning;
         }
     }
 }
        /// <summary>
        /// Make a form
        /// </summary>
        public Strategy_Description()
        {
            pnlBase     = new Panel();
            pnlWarnBase = new Fancy_Panel();
            lblWarning  = new Label();
            pnlTbxBase  = new Fancy_Panel(Language.T("Strategy Description"));
            txboxInfo   = new TextBox();
            btnClose    = new Button();
            btnAccept   = new Button();
            btnClear    = new Button();

            // BBCode_viewer
            AcceptButton = btnClose;
            BackColor    = LayoutColors.ColorFormBack;
            Icon         = Data.Icon;
            MinimumSize  = new System.Drawing.Size(400, 400);
            Text         = Language.T("Strategy Description");
            FormClosing += new FormClosingEventHandler(Actions_FormClosing);

            Controls.Add(pnlBase);
            Controls.Add(btnAccept);
            Controls.Add(btnClose);
            Controls.Add(btnClear);

            // pnlWarnBase
            pnlWarnBase.Parent  = this;
            pnlWarnBase.Padding = new Padding(2, 4, 2, 2);

            // lblWarning
            lblWarning.Parent    = pnlWarnBase;
            lblWarning.TextAlign = ContentAlignment.MiddleCenter;
            lblWarning.BackColor = Color.Transparent;;
            lblWarning.ForeColor = LayoutColors.ColorControlText;
            lblWarning.AutoSize  = false;
            lblWarning.Dock      = DockStyle.Fill;
            if (Data.Strategy.Description != "")
            {
                if (!Data.IsStrDescriptionRelevant())
                {
                    lblWarning.Font = new Font(Font, FontStyle.Bold);
                    lblWarning.Text = Language.T("This description might be outdated!");
                }
                else
                {
                    lblWarning.Text = System.IO.Path.GetFileNameWithoutExtension(Data.StrategyName);
                }
            }
            else
            {
                lblWarning.Text = Language.T("You can write a description to the strategy!");
            }

            pnlTbxBase.Parent  = pnlBase;
            pnlTbxBase.Padding = new Padding(4, (int)pnlTbxBase.CaptionHeight + 1, 2, 3);
            pnlTbxBase.Dock    = DockStyle.Fill;


            // txboxInfo
            txboxInfo.Parent        = pnlTbxBase;
            txboxInfo.Dock          = DockStyle.Fill;
            txboxInfo.BackColor     = LayoutColors.ColorControlBack;
            txboxInfo.ForeColor     = LayoutColors.ColorControlText;
            txboxInfo.BorderStyle   = BorderStyle.None;
            txboxInfo.Multiline     = true;
            txboxInfo.AcceptsReturn = true;
            txboxInfo.AcceptsTab    = true;
            txboxInfo.ScrollBars    = ScrollBars.Vertical;
            txboxInfo.KeyDown      += new KeyEventHandler(TxboxInfo_KeyDown);
            txboxInfo.Text          = Data.Strategy.Description;
            txboxInfo.Select(0, 0);

            oldInfo = Data.Strategy.Description;

            // btnClose
            btnClose.Text   = Language.T("Close");
            btnClose.Click += new System.EventHandler(BtnClose_Click);
            btnClose.UseVisualStyleBackColor = true;

            // btnAccept
            btnAccept.Text   = Language.T("Accept");
            btnAccept.Click += new System.EventHandler(BtnAccept_Click);
            btnAccept.UseVisualStyleBackColor = true;

            // btnClear
            btnClear.Text   = Language.T("Clear");
            btnClear.Click += new System.EventHandler(BtnClear_Click);
            btnClear.UseVisualStyleBackColor = true;
        }
        /// <summary>
        /// Make a form
        /// </summary>
        public StrategyDescription()
        {
            PnlBase     = new Panel();
            PnlWarnBase = new FancyPanel();
            LblWarning  = new Label();
            PnlTbxBase  = new FancyPanel(Language.T("Strategy Description"));
            TxboxInfo   = new TextBox();
            BtnClose    = new Button();
            BtnAccept   = new Button();
            BtnClear    = new Button();

            AcceptButton = BtnClose;
            BackColor    = LayoutColors.ColorFormBack;
            Icon         = Data.Icon;
            MinimumSize  = new Size(400, 400);
            Text         = Language.T("Strategy Description");
            FormClosing += ActionsFormClosing;

            Controls.Add(PnlBase);
            Controls.Add(BtnAccept);
            Controls.Add(BtnClose);
            Controls.Add(BtnClear);

            // PnlWarnBase
            PnlWarnBase.Parent  = this;
            PnlWarnBase.Padding = new Padding(2, 4, 2, 2);

            // LblWarning
            LblWarning.Parent    = PnlWarnBase;
            LblWarning.TextAlign = ContentAlignment.MiddleCenter;
            LblWarning.BackColor = Color.Transparent;
            LblWarning.ForeColor = LayoutColors.ColorControlText;
            LblWarning.AutoSize  = false;
            LblWarning.Dock      = DockStyle.Fill;
            if (Data.Strategy.Description != "")
            {
                if (!Data.IsStrDescriptionRelevant())
                {
                    LblWarning.Font = new Font(Font, FontStyle.Bold);
                    LblWarning.Text = Language.T("This description might be outdated!");
                }
                else
                {
                    LblWarning.Text = Path.GetFileNameWithoutExtension(Data.StrategyName);
                }
            }
            else
            {
                LblWarning.Text = Language.T("You can write a description of the strategy!");
            }

            PnlTbxBase.Parent  = PnlBase;
            PnlTbxBase.Padding = new Padding(4, (int)PnlTbxBase.CaptionHeight + 1, 2, 3);
            PnlTbxBase.Dock    = DockStyle.Fill;


            // TxboxInfo
            TxboxInfo.Parent        = PnlTbxBase;
            TxboxInfo.Dock          = DockStyle.Fill;
            TxboxInfo.BackColor     = LayoutColors.ColorControlBack;
            TxboxInfo.ForeColor     = LayoutColors.ColorControlText;
            TxboxInfo.BorderStyle   = BorderStyle.None;
            TxboxInfo.Multiline     = true;
            TxboxInfo.AcceptsReturn = true;
            TxboxInfo.AcceptsTab    = true;
            TxboxInfo.ScrollBars    = ScrollBars.Vertical;
            TxboxInfo.KeyDown      += TxboxInfo_KeyDown;
            TxboxInfo.Text          = Data.Strategy.Description;
            TxboxInfo.Select(0, 0);

            // BtnClose
            BtnClose.Text   = Language.T("Close");
            BtnClose.Click += BtnCloseClick;
            BtnClose.UseVisualStyleBackColor = true;

            // BtnAccept
            BtnAccept.Text   = Language.T("Accept");
            BtnAccept.Click += BtnAcceptClick;
            BtnAccept.UseVisualStyleBackColor = true;

            // BtnClear
            BtnClear.Text   = Language.T("Clear");
            BtnClear.Click += BtnClearClick;
            BtnClear.UseVisualStyleBackColor = true;

            _oldInfo = Data.Strategy.Description;
        }