Esempio n. 1
0
 /// <summary>
 /// Конструктор копирования
 /// </summary>
 public ApplicationMessageBinding(ApplicationMessageBinding k) : this(k.Message, k.mainKey, k.messageType)
 {
     stopFurtherProcessing = k.stopFurtherProcessing;
     mod1 = k.mod1;
     mod2 = k.mod2;
     ActionDescription = k.ActionDescription;
 }
Esempio n. 2
0
        /// <summary>
        /// применяет кастомные насройки, переданные в строке "diffString", к дефолтному списку горячих клавиш.
        /// </summary>
        /// <param name="diffString">кастомные настройки. Должны быть прочитаны из UserSettings</param>
        public static void ApplyDiffString(string diffString)
        {
            // вернуть дефолтовые
            hotKeys = defaultHotKeys.Select(k => new ApplicationMessageBinding(k)).ToList();

            // прочитать и обновить значения
            if (string.IsNullOrEmpty(diffString.Trim()))
            {
                return;
            }
            var keyStrings = diffString.Split(';');

            foreach (var keyString in keyStrings)
            {
                var msg = ApplicationMessageBinding.Parse(keyString);
                if (msg == null)
                {
                    continue;
                }
                var msgType = msg.Message;

                var hotKey = hotKeys.First(k => k.Message == msgType);
                if (hotKey.AreEqual(msg))
                {
                    continue;
                }
                hotKeys.Remove(hotKey);
                hotKeys.Add(msg);
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Конструктор копирования
 /// </summary>
 public ApplicationMessageBinding(ApplicationMessageBinding k)
     : this(k.Message, k.mainKey, k.messageType)
 {
     stopFurtherProcessing = k.stopFurtherProcessing;
     mod1 = k.mod1;
     mod2 = k.mod2;
     ActionDescription = k.ActionDescription;
 }
Esempio n. 4
0
        public HotKeySetForm(ApplicationMessageBinding objHotKey)
        {
            InitializeComponent();

            Localizer.LocalizeControl(this);
            ObjHotKey = objHotKey;
            txtActionName.Text = EnumFriendlyName<ApplicationMessage>.GetString(ObjHotKey.Message);
            txtbxHotKeyNewValue.Text = ObjHotKey.Key;

            mainForm = Application.OpenForms[0] as MainForm;
            if (mainForm != null)
                mainForm.KeyPressedEvent += MainFormKeyPressedEvent;
        }
        private void SetupGrid()
        {
            var blank = new ApplicationMessageBinding(ApplicationMessage.Quotes, Keys.F1, ApplicationMessageBinding.WindowMessage.KeyDown);
            grid.Columns.Add(new FastColumn(blank.Property(p => p.Title), Localizer.GetString("TitleAction"))
                {
                    ColumnMinWidth = 200,
                    IsHyperlinkStyleColumn = true,
                    HyperlinkActiveCursor = Cursors.Hand
                });
            grid.Columns.Add(new FastColumn(blank.Property(p => p.Key), Localizer.GetString("TitleCombination"))
                {
                    ColumnWidth = 200,
                    IsHyperlinkStyleColumn = true,
                    HyperlinkActiveCursor = Cursors.Hand
                });

            grid.CalcSetTableMinWidth();
            grid.UserHitCell += GridUserHitCell;
        }
Esempio n. 6
0
 public void ProcessApplicationMessageRegisteredKey(ApplicationMessageBinding objectBinding)
 {
     bool newBtnState;
     switch (objectBinding.Message)
     {
         case ApplicationMessage.SetupIndicators:
             ExecuteCommonButtonsCommand(SystemToolButton.Indicators, out newBtnState);
             break;
         case ApplicationMessage.ChartSnapshot:
             if (lastActiveChart != null)
                 lastActiveChart.chart.SaveAsImageCurrentFolder();
             break;
         case ApplicationMessage.NewOrder:
             MenuItemNewOrderClick(null, null);
             break;
         case ApplicationMessage.Quotes:
             MenuWindowQuoteClick(null, null);
             break;
         case ApplicationMessage.Chat:
             EnsureChatWindow();
             break;
         case ApplicationMessage.Statistics:
             EnsureStatisticsWindow();
             break;
         case ApplicationMessage.RobotSetup:
             break;
     }
 }
Esempio n. 7
0
 /// <summary>
 /// Сравнивает два экзампляра горячих клавиш по значениям полей
 /// </summary>
 /// <param name="b"></param>
 /// <returns></returns>
 public bool AreEqual(ApplicationMessageBinding b)
 {
     return mainKey == b.mainKey && mod1 == b.mod1 && mod2 == b.mod2 && messageType == b.messageType &&
         stopFurtherProcessing == b.stopFurtherProcessing;
 }
Esempio n. 8
0
 /// <summary>
 /// Сравнивает два экзампляра горячих клавиш по значениям полей
 /// </summary>
 /// <param name="b"></param>
 /// <returns></returns>
 public bool AreEqual(ApplicationMessageBinding b)
 {
     return(mainKey == b.mainKey && mod1 == b.mod1 && mod2 == b.mod2 && messageType == b.messageType &&
            stopFurtherProcessing == b.stopFurtherProcessing);
 }