/// <summary>
        /// 初始化预售时间提醒
        /// </summary>
        void InitStartStationTip()
        {
            ilStartTip.Images.Add(UiUtility.Get20PxImageFrom16PxImg(Properties.Resources.info_16));
            lvSellTip.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
            btnEnableSellTip.Visible = false;

            lvSellTip.DoubleClick += (s, e) =>
            {
                var item = lvSellTip.SelectedItems.Cast <ListViewItem>().FirstOrDefault();
                if (item == null)
                {
                    return;
                }

                var train = item.Tag as QueryResultItem[];
                if (train != null)
                {
                    var stationInfo = train[0].StartStationSellInfo;
                    var query       = QueryParam.Clone() as QueryParam;

                    //添加车次
                    query.EnableAutoPreSubmit = true;
                    query.AutoPreSubmitConfig.HideOtherTrains = true;
                    train.Select(x => x.Code).ForEach(query.AutoPreSubmitConfig.TrainList.Add);
                    query.FromStationCode = stationInfo.Code;
                    query.FromStationName = stationInfo.Name;

                    Session.UserProfile.QueryParams.Add(query);
                }
            };
            sellTipClose.Click += (s, e) =>
            {
                pSellTipContainer.Visible          = false;
                btnEnableSellTip.Visible           = true;
                QueryParam.UiSetting.EnableSellTip = false;
            };
            btnEnableSellTip.Click += (s, e) =>
            {
                pSellTipContainer.Visible          = true;
                btnEnableSellTip.Visible           = false;
                QueryParam.UiSetting.EnableSellTip = true;
            };
        }
Example #2
0
 public SoftwareConflictionWarning()
 {
     InitializeComponent();
     imageList1.Images.Add(UiUtility.Get20PxImageFrom16PxImg(Properties.Resources.warning_16));
 }