Exemplo n.º 1
0
        internal void SetLayout(HudLayout layout)
        {
            using (var write = readerWriterLock.Write())
            {
                if (layout != null)
                {
                    if (TableType.HasValue && TableType != layout.TableType)
                    {
                        PanelOffsets.Clear();
                    }

                    this.layout = layout;
                    LayoutName  = layout.LayoutName;

                    if (!lastHands.Contains(layout.GameNumber))
                    {
                        lastHands.Add(layout.GameNumber);
                    }

                    if (layout.AvailableLayouts != null)
                    {
                        LayoutsCollection = new ObservableCollection <string>(layout.AvailableLayouts);
                        SelectedLayout    = LayoutsCollection.FirstOrDefault(x => x == layout.LayoutName);
                    }

                    RaisePropertyChanged(nameof(PreLoadMode));
                    RaisePropertyChanged(nameof(PreLoadText));
                }
            }
        }
Exemplo n.º 2
0
        private async void DoTreatAs(object obj)
        {
            if (obj == null)
            {
                return;
            }

            await Task.Run(() =>
            {
                using (var readToken = readerWriterLock.Read())
                {
                    var tableType = (EnumTableType)obj;
                    TableType     = tableType;

                    PanelOffsets.Clear();

                    HudNamedPipeBindingService.TreatTableAs(WindowHandle, tableType);
                }
            });
        }