public TableDescription(int hash, EnumTableType tableType, EnumPokerSites pokerSite, EnumGameType gameType)
 {
     Hash      = hash;
     TableType = tableType;
     PokerSite = pokerSite;
     GameType  = gameType;
 }
 /// <summary>
 /// 选择表类型后表格控件重新绑定
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void toolStripComboBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     this._trendTableType = (EnumTableType)this.toolStripComboBox1.ComboBox.SelectedValue;
     this._currentRow     = 0; //表间切换时记录了前一个表的索引,所以要重新清0
     this._isValidate     = true;
     BindDgdViewAll();
 }
Esempio n. 3
0
 /// <summary>
 /// 构造函数
 /// </summary>
 /// <param name="TableName"></param>
 /// <param name="ItemName"></param>
 /// <param name="ValueType"></param>
 public QueryEntity(EnumTableType TableType, string ItemName, string ValueType, bool isShowItem = false)
 {
     this._TableType  = TableType;
     this._ItemName   = ItemName;
     this._ValueType  = ValueType;
     this._isShowItem = _isShowItem;
 }
Esempio n. 4
0
 /// <summary>
 /// 初始化表,给表头、行头和单元格赋值
 /// </summary>
 public virtual void InitTable(OilInfoEntity oil, EnumTableType tableType, string dropDownTypeCode = null)
 {
     if (oil == null)
     {
         return;
     }
     _dropDownTypeCode = dropDownTypeCode;
     IsBusy            = true;
     try
     {
         TableType = tableType;
         var tableId = (int)tableType;
         Oil         = oil;
         this._datas = this.Oil.OilDatas.Where(d => d.OilTableTypeID == tableId).ToList();
         var rowCache = new OilTableRowBll();
         var colCache = new OilTableColBll();
         this._rows = rowCache.Where(r => r.oilTableTypeID == tableId).ToList();
         this._cols = colCache.Where(c => c.oilTableTypeID == tableId).ToList();
         OilTableTypeBll tableCache = new OilTableTypeBll();;
         this._tableType = tableCache.FirstOrDefault(t => t.libraryA && t.ID == tableId);
         this._setColHeader();
         this._setRowHeader();
         OnTableLayoutInitialized();
         Application.DoEvents();
         this._setCellValues();
         columnList.FixColumnCount = _cols.Count;
         undoRedoManager.Clear();
         InitDropDownList();
     }
     finally
     {
         IsBusy = false;
     }
 }
Esempio n. 5
0
        /// <summary>
        /// Gets positions of tool on HUD for all possible <see cref="EnumPokerSites"/> and <see cref="EnumGameType" />
        /// </summary>
        /// <returns></returns>
        private List <HudPositionsInfo> GetHudPositions(EnumTableType tableType, Point position)
        {
            // existing elements positions will be in default xml files

            // we have predefined position of player labels
            // so we need to calculate offset between UI player label and UI position, then apply those offsets to hud player label

            var hudPositions = new List <HudPositionsInfo>();

            var pokerSites = EntityUtils.GetSupportedPokerSites();

            foreach (var pokerSite in pokerSites)
            {
                foreach (var gameType in Enum.GetValues(typeof(EnumGameType)).OfType <EnumGameType>())
                {
                    var hudPositionsInfo = new HudPositionsInfo
                    {
                        PokerSite    = pokerSite,
                        GameType     = gameType,
                        HudPositions = GetHudPositionInfo(pokerSite, tableType, position)
                    };

                    hudPositions.Add(hudPositionsInfo);
                }
            }

            return(hudPositions);
        }
Esempio n. 6
0
        /// <summary>
        /// Gets the list of <see cref="HudPositionInfo"/> related to base position in designer
        /// </summary>
        /// <param name="tableType"><see cref="EnumTableType"/> of table</param>
        /// <param name="relativeTableType"><see cref="EnumTableType"/> to which position is set</param>
        /// <param name="position"><see cref="Point"/> position of base element</param>
        /// <returns>The list of <see cref="HudPositionInfo"/></returns>
        public List <HudPositionInfo> GetHudUIPositions(EnumTableType tableType, EnumTableType relativeTableType, Point position)
        {
            var positions = new List <HudPositionInfo>();

            var seats = (int)tableType;
            var relativeTableSeats = (int)relativeTableType;

            var playerLabelPositions         = HudDefaultSettings.TablePlayerLabelPositions[seats];
            var relativePlayerLabelPositions = HudDefaultSettings.TablePlayerLabelPositions[relativeTableSeats];

            var relativePlayerLabelPositionX = relativePlayerLabelPositions[0, 0];
            var relativePlayerLabelPositionY = relativePlayerLabelPositions[0, 1];

            var deltaX = position.X - relativePlayerLabelPositionX;
            var deltaY = position.Y - relativePlayerLabelPositionY;

            for (var seat = 0; seat < seats; seat++)
            {
                var playerLabelPositionX = playerLabelPositions[seat, 0];
                var playerLabelPositionY = playerLabelPositions[seat, 1];

                var positionInfo = new HudPositionInfo
                {
                    Position = new Point(playerLabelPositionX + deltaX, playerLabelPositionY + deltaY),
                    Seat     = seat + 1
                };

                positions.Add(positionInfo);
            }

            return(positions);
        }
Esempio n. 7
0
        private void MigrateDefaultLayout(EnumTableType tableType)
        {
            var layout    = GetDefaultLayout(tableType);
            var newLayout = ConvertLayout(layout);

            SaveLayout(newLayout);
        }
        public IEnumerable <ITableSeatArea> GetTableSeatAreas(EnumTableType tableType)
        {
            IEnumerable <ITableSeatArea> resultList;

            switch (tableType)
            {
            case EnumTableType.HU:
                resultList = GetHUList();
                break;

            case EnumTableType.Six:
                resultList = Get6MaxList();
                break;

            case EnumTableType.Nine:
                resultList = Get9MaxList();
                break;

            default:
                resultList = new List <ITableSeatArea>();
                LogProvider.Log.Warn(String.Format("Cannot find predefined bovada table seat areas for next table type: {0}", tableType));
                break;
            }
            resultList.ForEach(x => x.Initialize());

            return(resultList);
        }
        /// <summary>
        /// Initializes position and size for the current <see cref="HudPlainStatBoxViewModel"/> for the specified <see cref="EnumPokerSites"/> and <see cref="EnumGameType"/>
        /// </summary>
        /// <param name="pokerSite"><see cref="EnumPokerSites"/></param>
        /// <param name="gameType"><see cref="EnumGameType"/></param>
        /// <exception cref="DHBusinessException" />
        public override void InitializePositions(EnumPokerSites pokerSite, EnumTableType tableType, EnumGameType gameType)
        {
            if (!(Tool is T tool))
            {
                return;
            }

            var seats       = (int)tableType;
            var currentSeat = Parent.Seat - 1;

            var uiPosition = tool.UIPositions.FirstOrDefault(x => x.Seat == Parent.Seat);

            if (uiPosition == null)
            {
                LogProvider.Log.Warn($"Could not find UI positions for {pokerSite}, {gameType}, {Parent.Seat}, {tool.ToolType}");
            }

            var positionInfo = tool.Positions.FirstOrDefault(x => x.PokerSite == pokerSite && x.GameType == gameType);

            var hudPositionInfo = positionInfo?.HudPositions.FirstOrDefault(x => x.Seat == Parent.Seat);

            if (hudPositionInfo == null)
            {
                var positionProvider = ServiceLocator.Current.GetInstance <IPositionProvider>(pokerSite.ToString());

                if (!positionProvider.Positions.ContainsKey(seats))
                {
                    throw new DHBusinessException(new NonLocalizableString($"Could not find predefined positions for {pokerSite}, {gameType}, {Parent.Seat}"));
                }

                var playerLabelClientPosition = positionProvider.Positions[seats];

                var playerLabelPosition = HudDefaultSettings.TablePlayerLabelPositions[seats];

                var offsetX = playerLabelClientPosition[currentSeat, 0] - playerLabelPosition[currentSeat, 0];
                var offsetY = playerLabelClientPosition[currentSeat, 1] - playerLabelPosition[currentSeat, 1];

                var positionX = uiPosition != null ? uiPosition.Position.X : default(double);
                var positionY = uiPosition != null ? uiPosition.Position.Y : default(double);

                // do not change position if element is inside or above player label
                if (positionY > playerLabelPosition[currentSeat, 1] + HudDefaultSettings.TablePlayerLabelActualHeight)
                {
                    offsetY += positionProvider.PlayerLabelHeight - HudDefaultSettings.TablePlayerLabelHeight;
                }

                hudPositionInfo = new HudPositionInfo
                {
                    Seat     = Parent.Seat,
                    Position = new Point(positionX + offsetX, positionY + offsetY)
                };
            }

            Position = hudPositionInfo.Position;
            Opacity  = Parent.Opacity;

            Width  = uiPosition != null && uiPosition.Width != 0 && !UseDefaultSizesOnly ? uiPosition.Width : DefaultWidth;
            Height = uiPosition != null && uiPosition.Height != 0 && !UseDefaultSizesOnly ? uiPosition.Height : DefaultHeight;
        }
Esempio n. 10
0
        public WinamaxConfiguration()
        {
            prefferedSeat = new Dictionary <int, int>();

            tableTypes = new EnumTableType[]
            {
                EnumTableType.Four
            };
        }
Esempio n. 11
0
        /// <summary>
        /// 根据列代码和表类别删除取列
        /// </summary>
        /// <param name="colCode">列代码</param>
        /// <param name="tableType">表类别</param>
        public void Remove(string colCode, EnumTableType tableType)
        {
            var lst = _OilTableCol.Where(d => d.colCode == colCode && d.OilTableType.ID == (int)tableType).ToArray();

            foreach (var s in lst)
            {
                this.Remove(s);
            }
        }
Esempio n. 12
0
        public PokerBaaziSiteConfiguration()
        {
            prefferedSeat = new Dictionary <int, int>();

            tableTypes = new EnumTableType[]
            {
                EnumTableType.HU,
                EnumTableType.Six,
                EnumTableType.Nine
            };
        }
Esempio n. 13
0
        protected override string GetBackgroundImage(EnumTableType tableType)
        {
            switch (tableType)
            {
            case EnumTableType.Nine:
                return(string.Format(BackgroundTableImage, $"pokerstars-{(byte)tableType}"));

            default:
                return(string.Format(BackgroundTableImage, (byte)tableType));
            }
        }
Esempio n. 14
0
        private HudLayoutInfo GetDefaultLayout(EnumTableType tableType)
        {
            var resourcesAssembly = typeof(ResourceRegistrator).Assembly;

            var path = $"DriveHUD.Common.Resources.Layouts.Default-{CommonResourceManager.Instance.GetEnumResource(tableType)}.xml";

            using (var stream = resourcesAssembly.GetManifestResourceStream(path))
            {
                return(LoadLayoutFromStream(stream));
            }
        }
Esempio n. 15
0
        public BovadaConfiguration()
        {
            tableTypes = new EnumTableType[]
            {
                EnumTableType.HU,
                EnumTableType.Three,
                EnumTableType.Six,
                EnumTableType.Nine
            };

            HeroName = heroName;
        }
        public int GetHash(EnumPokerSites pokerSite, EnumGameType gameType, EnumTableType tableType)
        {
            unchecked
            {
                var hashCode = (int)2166136261;

                hashCode = (hashCode * 16777619) ^ pokerSite.GetHashCode();
                hashCode = (hashCode * 16777619) ^ gameType.GetHashCode();
                hashCode = (hashCode * 16777619) ^ tableType.GetHashCode();

                return(hashCode);
            }
        }
Esempio n. 17
0
        /// <summary>
        ///
        /// </summary>
        public FrmExperienceTrendCheck()
        {
            InitializeComponent();
            InitStyle();//设置表格显示样式
            OilTableRowAccess trendParmTableAccess = new OilTableRowAccess();

            this._trendParmTableList = trendParmTableAccess.Get("1=1");
            SetHeader();//设置表格的头部
            BindToolStripCmbTableType();
            this._trendTableType = (EnumTableType)this.toolStripComboBox1.ComboBox.SelectedValue;

            BindDgdViewAll();
        }
Esempio n. 18
0
        public override Point GetPositionShift(EnumTableType tableType, int seat)
        {
            var tableSize = (int)tableType;

            if (!plainPositionsShifts.ContainsKey(tableSize))
            {
                return(base.GetPositionShift(tableType, seat));
            }

            var shift = plainPositionsShifts[tableSize];

            return(new Point(shift[seat - 1, 0], shift[seat - 1, 1]));
        }
Esempio n. 19
0
        private Point GetOffset(EnumPokerSites pokerSite, EnumGameType gameType, EnumTableType tableType, int seat)
        {
            if (pokerSite == EnumPokerSites.Ignition || pokerSite == EnumPokerSites.Bovada || pokerSite == EnumPokerSites.Bodog)
            {
                return(new Point(0, -27));
            }

            var hudPanelService = ServiceLocator.Current.GetInstance <IHudPanelService>(pokerSite.ToString());

            var shifts = hudPanelService.GetPositionShift(tableType, seat);

            return(shifts);
        }
Esempio n. 20
0
        protected override string GetBackgroundImage(EnumTableType tableType)
        {
            switch (tableType)
            {
            case EnumTableType.Three:
            case EnumTableType.Six:
            case EnumTableType.Nine:
                return(String.Format(BackgroundTableImage, $"bovada-{(byte)tableType}"));

            default:
                return(String.Format(BackgroundTableImage, (byte)tableType));
            }
        }
Esempio n. 21
0
        public Adda52SiteConfiguration()
        {
            prefferedSeat = new Dictionary <int, int>();

            tableTypes = new EnumTableType[]
            {
                EnumTableType.HU,
                EnumTableType.Four,
                EnumTableType.Six,
                EnumTableType.Eight,
                EnumTableType.Nine
            };
        }
Esempio n. 22
0
        private DataTable CalcData(DataTable orginalData)
        {
            DataTable table = new DataTable();

            table.Columns.Add("SeqNo", typeof(string));

            table.Columns.Add("RecDate", typeof(string));
            table.Columns.Add("TableName", typeof(string));
            table.Columns.Add("status", typeof(string));
            table.Columns.Add("PKValue", typeof(string));

            m_FixColumnCount = table.Columns.Count;


            int updateRowCount = 0;

            for (int i = 0; i < orginalData.Rows.Count; i++)
            {
                DataRow row = orginalData.Rows[i];


                EnumOperatorType status    = (EnumOperatorType)Util.ToInt(row["status"]);
                EnumTableType    tableType = (EnumTableType)Util.ToInt(row["tabletype"]);

                //处理更新
                if (status == EnumOperatorType.Update && tableType == EnumTableType.Deleted)
                {
                    updateRowCount = 0;
                    //更新的数据,delete已经处理过了,继续循环
                    continue;
                }

                //处理新增或删除
                if (status == EnumOperatorType.New || status == EnumOperatorType.Delete)
                {
                    CreateNewOrDeleteRowData(table, m_FixColumnCount, row, status);
                }
                else
                {
                    if (updateRowCount == 0)
                    {
                        updateRowCount = GetUpdateRowCount(orginalData, updateRowCount, i);
                    }
                    DataRow oldRow = orginalData.Rows[i + updateRowCount];

                    CreateUpdateRowData(table, m_FixColumnCount, row, oldRow);
                }
            }

            return(table);
        }
Esempio n. 23
0
        public AmericasCardroomConfiguration()
        {
            prefferedSeat = new Dictionary <int, int>();

            tableTypes = new EnumTableType[]
            {
                EnumTableType.HU,
                EnumTableType.Three,
                EnumTableType.Four,
                EnumTableType.Six,
                EnumTableType.Eight,
                EnumTableType.Nine
            };
        }
Esempio n. 24
0
        public IPokerConfiguration()
        {
            prefferedSeat = new Dictionary <int, int>();

            tableTypes = new EnumTableType[]
            {
                EnumTableType.HU,
                EnumTableType.Three,
                EnumTableType.Four,
                EnumTableType.Six,
                EnumTableType.Nine,
                EnumTableType.Ten
            };
        }
Esempio n. 25
0
        private ComboBox _cellCmbOutExcel = new ComboBox(); //cmbox控件
        #endregion

        #region "构造函数"
        /// <summary>
        /// 构造函数
        /// </summary>
        public FrmInputRowOption(bool bZH = false)
        {
            InitializeComponent();
            InitStyle();//设置表格显示样式
            SetHeader(bZH);
            BindToolStripCmbTableType(bZH);
            this._tableType = (EnumTableType)this.toolStripCmbTableType.ComboBox.SelectedValue;
            BindDgdViewAll();
            initButton();
            toolStripSplitButton1.Visible = false; //暂时
            initTableHead();

            this._cellCmbOutExcel.Visible = false;                                                         // 设置下拉列表框不可见
            cmbOutExcelBinding();
            this._cellCmbOutExcel.SelectedIndexChanged += new EventHandler(cmb_Temp_SelectedIndexChanged); // 添加下拉列表框事件
            this.dgdViewAll.Controls.Add(this._cellCmbOutExcel);                                           // 将下拉列表框加入到DataGridView控件中
        }
Esempio n. 26
0
        /// <summary>
        /// 获取更新行数
        /// </summary>
        /// <param name="orginalData"></param>
        /// <param name="updateRowCount"></param>
        /// <param name="rowIndex"></param>
        /// <returns></returns>
        private static int GetUpdateRowCount(DataTable orginalData, int updateRowCount, int rowIndex)
        {
            for (int i = rowIndex; i < orginalData.Rows.Count; i++)
            {
                DataRow       nextRow   = orginalData.Rows[i];
                EnumTableType tableType = (EnumTableType)Util.ToInt(nextRow["tabletype"]);

                if (tableType == EnumTableType.Deleted)
                {
                    //删除行,Update行已经结束
                    break;
                }

                updateRowCount++;
            }
            return(updateRowCount);
        }
Esempio n. 27
0
        public static PreferredSeatModel GetSeatSetting(EnumTableType tableType, EnumPokerSites pokerSite)
        {
            var settings          = settingsService.GetSettings();
            var preferredSettings = settings.SiteSettings.SitesModelList.FirstOrDefault(x => x.PokerSite == pokerSite);

            var currentSeatSetting = preferredSettings?.PrefferedSeats?.FirstOrDefault(x => x.TableType == tableType);

            if (currentSeatSetting == null)
            {
                return(new PreferredSeatModel()
                {
                    IsPreferredSeatEnabled = false, PreferredSeat = -1, TableType = tableType
                });
            }

            return(currentSeatSetting);
        }
Esempio n. 28
0
        public BetOnlineConfiguration()
        {
            prefferedSeat = new Dictionary <int, int>();

            tableTypes = new EnumTableType[]
            {
                EnumTableType.HU,
                EnumTableType.Three,
                EnumTableType.Four,
                EnumTableType.Six,
                EnumTableType.Eight,
                EnumTableType.Nine,
                EnumTableType.Ten
            };

            HeroName = heroName;
        }
Esempio n. 29
0
        public HorizonConfiguration()
        {
            prefferedSeat = new Dictionary <int, int>();

            tableTypes = new EnumTableType[]
            {
                EnumTableType.HU,
                EnumTableType.Three,
                EnumTableType.Four,
                EnumTableType.Five,
                EnumTableType.Six,
                EnumTableType.Seven,
                EnumTableType.Eight,
                EnumTableType.Nine,
                EnumTableType.Ten
            };
        }
Esempio n. 30
0
        /// <summary>
        /// 批注And条件查询
        /// </summary>
        /// <param name="remarkList">一条原油中所有的批注信息</param>
        /// <param name="andSearchList">And查询条件</param>
        /// <param name="queryListResult">查询结果实体集合</param>
        /// <returns></returns>
        private bool getRemarkAndQueryResult(OilInfoEntity oil, EnumTableType tableType, List <OilRangeSearchEntity> andSearchList, List <RemarkEntity> oilAToolQueryList)
        {
            bool BResult = false;
            List <RemarkEntity> remarkList = oil.RemarkList.Where(o => o.OilTableTypeID == (int)tableType && (o.LabRemark != string.Empty || o.CalRemark != string.Empty)).ToList(); //对应表中所有数据

            foreach (OilRangeSearchEntity rangeSearchEntity in andSearchList)                                                                                                        //循环每一个查询条件
            {
                List <RemarkEntity> colDataList = new List <RemarkEntity>();
                string Min      = rangeSearchEntity.downLimit;
                string itemName = rangeSearchEntity.ItemName;

                List <RemarkEntity> itemNameRemarkList = remarkList.Where(o => o.OilTableRow.itemName == itemName).ToList();//对应表中所有数据

                #region "colDataList"
                if (string.IsNullOrWhiteSpace(Min))
                {
                    List <RemarkEntity> result = itemNameRemarkList.Where(o => o.LabRemark.Contains(rangeSearchEntity.RemarkKeyWord) ||
                                                                          o.CalRemark.Contains(rangeSearchEntity.RemarkKeyWord)).ToList();//对应表中所有数据
                    colDataList.AddRange(result);
                }
                else
                {
                    List <RemarkEntity> result = itemNameRemarkList.Where(
                        o => (o.LabRemark.Contains(rangeSearchEntity.RemarkKeyWord) && o.LabRemark.Contains(Min)) ||
                        (o.CalRemark.Contains(rangeSearchEntity.RemarkKeyWord) && o.CalRemark.Contains(Min))).ToList();  //对应表中所有数据

                    colDataList.AddRange(result);
                }

                #endregion

                if (colDataList.Count > 0)//and条件满足一个
                {
                    BResult = true;
                    oilAToolQueryList.AddRange(colDataList);
                }
                else
                {
                    BResult = false;
                    break;
                }
            }

            return(BResult);
        }
Esempio n. 31
0
 private void SetTableErrorlog(List<string> errors, EnumTableType tableType)
 {
     if (errors.Count() > 0)
     {
         StringBuilder tableErrorBuilder = new StringBuilder();
         tableErrorBuilder.AppendLine(string.Format("{0} {1} failed", errors.Count(), tableType.ToString()));
         tableErrorBuilder.AppendLine("**********************************************************************");
         foreach (var item in errors)
         {
             tableErrorBuilder.AppendLine(string.Format("{1} name : {0} , has no {2} .", item, tableType.ToString(), tableType == EnumTableType.Table ? "primary key" : "keyID"));
         }
         tableErrorBuilder.AppendLine("**********************************************************************");
         OnSetLogHandler(this, new WorkEventArgs(WorkStage.DoWork, "") { ErrorInfo = tableErrorBuilder.ToString() });
     }
 }
Esempio n. 32
0
        private void CommonInitialGridView(IList<Table> tables,DataGridView gridView,EnumTableType tableType)
        {
            gridView.AutoGenerateColumns = false;
            if (gridView.ColumnCount <= 1)
            {
                DataGridViewTextBoxColumn ColTemplateName = new DataGridViewTextBoxColumn();
                ColTemplateName.DataPropertyName = "Name";
                ColTemplateName.Name = "name";
                ColTemplateName.HeaderText = "Name";
                ColTemplateName.ReadOnly = true;
                ColTemplateName.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;

                DataGridViewTextBoxColumn ColRemark = new DataGridViewTextBoxColumn();
                ColRemark.DataPropertyName = "Remark";
                ColRemark.Name = "Remark";
                ColRemark.HeaderText = "Remark";
                ColRemark.ReadOnly = true;
                ColRemark.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;
                gridView.Columns.Add(ColTemplateName);
                gridView.Columns.Add(ColRemark);
                gridView.AllowUserToResizeRows = false;
            }
            gridView.DataSource = tables.Where(x=>x.TableType==tableType).ToList();
        }