예제 #1
0
    const float ShowScale = .6f;//展示缩放
    #endregion

    #region 初始化
    void Start()
    {
        Instance = this;
        SlotContain = transform;
        LoadTable();
        LoadRepertory();
    }
        private static List <OpenBookingFlowRequirement> OpenBookingFlowRequirement(SlotTable slot)
        {
            List <OpenBookingFlowRequirement> openBookingFlowRequirement = null;

            if (slot.RequiresApproval)
            {
                openBookingFlowRequirement = openBookingFlowRequirement ?? new List <OpenBookingFlowRequirement>();
                openBookingFlowRequirement.Add(OpenActive.NET.OpenBookingFlowRequirement.OpenBookingApproval);
            }

            if (slot.RequiresAttendeeValidation)
            {
                openBookingFlowRequirement = openBookingFlowRequirement ?? new List <OpenBookingFlowRequirement>();
                openBookingFlowRequirement.Add(OpenActive.NET.OpenBookingFlowRequirement.OpenBookingAttendeeDetails);
            }

            if (slot.RequiresAdditionalDetails)
            {
                openBookingFlowRequirement = openBookingFlowRequirement ?? new List <OpenBookingFlowRequirement>();
                openBookingFlowRequirement.Add(OpenActive.NET.OpenBookingFlowRequirement.OpenBookingIntakeForm);
            }

            if (slot.AllowsProposalAmendment)
            {
                openBookingFlowRequirement = openBookingFlowRequirement ?? new List <OpenBookingFlowRequirement>();
                openBookingFlowRequirement.Add(OpenActive.NET.OpenBookingFlowRequirement.OpenBookingNegotiation);
            }
            return(openBookingFlowRequirement);
        }
예제 #3
0
        private void button1_Click_1(object sender, EventArgs e)
        {
            SA46Team10BsportsEntities ctx = new SA46Team10BsportsEntities();
            TransactionTable          tt  = new TransactionTable();

            try
            {
                tt.CustomerID = Convert.ToInt32(CIDTextBox.Text);
                CourtTable ct = ctx.CourtTables.Where(x => x.CourtType == comboBox1.Text).First();
                tt.CourtTable = ct;
                tt.DateBook   = dateTimePicker1.Value.Date;
                SlotTable st = ctx.SlotTables.Where(x => x.Time == timeSlotListBox1.Text).First();
                tt.SlotTable = st;
                tt.Status    = "Booked";

                ctx.TransactionTables.Add(tt);
                ctx.SaveChanges();
                MessageBox.Show("Booking for " + comboBox1.Text + " on " + dateTimePicker1.Value.ToString("dd/MM/yyyy") + " at " + timeSlotListBox1.Text + " is completed.");
                ClearContent();
            }

            catch (System.FormatException)
            {
                MessageBox.Show("Please ensure all fields are manually selected");
            }
        }
예제 #4
0
        private ContentListType ManageContentListTypeOneAttempt(Dictionary <string, FieldDescriptor> fieldInfoList, Dictionary <string, List <string> > oldBindings, bool modify, out List <FieldSetting> fieldSettings)
        {
            fieldSettings = new List <FieldSetting>();
            if (!modify)
            {
                // Load
                foreach (string name in fieldInfoList.Keys)
                {
                    fieldSettings.Add(FieldSetting.Create(fieldInfoList[name], oldBindings[name], null));
                }
                return(this.ContentListType);
            }

            SchemaEditor editor = new SchemaEditor();

            editor.Load();
            bool hasChanges = false;
            var  listType   = this.ContentListType;
            Dictionary <string, List <string> > newBindings = new Dictionary <string, List <string> >();
            SlotTable slotTable = new SlotTable(oldBindings);

            if (listType == null)
            {
                // new
                listType = editor.CreateContentListType(Guid.NewGuid().ToString());
                foreach (string name in fieldInfoList.Keys)
                {
                    fieldSettings.Add(CreateNewFieldType(fieldInfoList[name], newBindings, listType, slotTable, editor));
                }
                hasChanges = true;
            }
            else
            {
                // merge
                listType    = editor.ContentListTypes[listType.Name];
                hasChanges |= RemoveUnusedFields(fieldInfoList, oldBindings, listType, editor);
                foreach (string name in fieldInfoList.Keys)
                {
                    FieldSetting origField = GetFieldTypeByName(name, _fieldSettings);
                    if (origField == null)
                    {
                        fieldSettings.Add(CreateNewFieldType(fieldInfoList[name], newBindings, listType, slotTable, editor));
                        hasChanges = true;
                    }
                    else
                    {
                        List <string> bindList = new List <string>(origField.Bindings.ToArray());
                        fieldSettings.Add(FieldSetting.Create(fieldInfoList[name], bindList, null));
                        newBindings.Add(name, bindList);
                    }
                }
            }
            if (hasChanges)
            {
                editor.Register();
            }
            this.ContentListBindings = newBindings;
            return(ActiveSchema.ContentListTypes[listType.Name]);
        }
예제 #5
0
        private void OnSynchronized(int OpenID, int SlotID)
        {
            _slot   = (Slot)_sf.GetSlot(0);
            _tables = (SlotTables)_slot.tables;
            int count = _tables.Count;

            for (int i = 1; i <= count; i++)
            {
                SlotTable table = (SlotTable)_tables.Item[i];

                if (table.Name == "SECURITIES")
                {
                    _securities_table          = table;
                    _securities_table.AddRow  += OnAddRow;
                    _securities_table.ReplEnd += OnReplEnd;
                    _securities_table.Open(_slot.ID, _securities_table.Name, ""); // таблицу инструментов открываем сразу, а остальные таблицы после
                }
                if (table.Name == "TRDACC")
                {
                    _trdacc_table         = table;
                    _trdacc_table.AddRow += OnAddRow;
                }
                else if (table.Name == "ALL_TRADES")
                {
                    _all_trades_table         = table;
                    _all_trades_table.AddRow += OnAddRow;
                }
                else if (table.Name == "ORDERS")
                {
                    _orders_table            = table;
                    _orders_table.AddRow    += OnAddRow;
                    _orders_table.UpdateRow += OnUpdateRow;
                }
                else if (table.Name == "STOPORDERS")
                {
                    _stoporders_table            = table;
                    _stoporders_table.AddRow    += OnAddRow;
                    _stoporders_table.UpdateRow += OnUpdateRow;
                }
                else if (table.Name == "TRADES")
                {
                    _trades_table         = table;
                    _trades_table.AddRow += OnAddRow;
                }
                else if (table.Name == "HOLDING")
                {
                    _holding_table            = table;
                    _holding_table.AddRow    += OnAddRow;
                    _holding_table.UpdateRow += OnUpdateRow;
                }
                else if (table.Name == "POSITIONS")
                {
                    _positions_table            = table;
                    _positions_table.AddRow    += OnAddRow;
                    _positions_table.UpdateRow += OnUpdateRow;
                }
            }
        }
예제 #6
0
        public override string ToString()
        {
            StringBuilder sb  = new StringBuilder();
            string        tab = "    ";

            sb.AppendLine($"{tab}Version: {Version}");
            sb.AppendLine($"{tab}CodeLength: {CodeLength}");
            sb.AppendLine($"{tab}ReturnKind: {Enum.GetName(typeof(ReturnKinds), ReturnKind)}");
            sb.AppendLine($"{tab}ValidRangeStart: {ValidRangeStart}");
            sb.AppendLine($"{tab}ValidRangeEnd: {ValidRangeEnd}");
            if (SecurityObjectStackSlot != -1)
            {
                sb.AppendLine($"{tab}SecurityObjectStackSlot: {SecurityObjectStackSlot}");
            }
            if (GSCookieStackSlot != -1)
            {
                sb.AppendLine($"{tab}GSCookieStackSlot: {GSCookieStackSlot}");
            }
            if (PSPSymStackSlot != -1)
            {
                sb.AppendLine($"{tab}PSPSymStackSlot: {PSPSymStackSlot}");
            }
            if (GenericsInstContextStackSlot != -1)
            {
                sb.AppendLine($"{tab}GenericsInstContextStackSlot: {GenericsInstContextStackSlot}");
            }
            if (StackBaseRegister != 0xffffffff)
            {
                sb.AppendLine($"{tab}StackBaseRegister: {StackBaseRegister}");
            }
            if (SizeOfEditAndContinuePreservedArea != 0xffffffff)
            {
                sb.AppendLine($"{tab}SizeOfEditAndContinuePreservedArea: {SizeOfEditAndContinuePreservedArea}");
            }
            if (ReversePInvokeFrameStackSlot != -1)
            {
                sb.AppendLine($"{tab}ReversePInvokeFrameStackSlot: {ReversePInvokeFrameStackSlot}");
            }
            sb.AppendLine($"{tab}SizeOfStackOutgoingAndScratchArea: {SizeOfStackOutgoingAndScratchArea}");
            sb.AppendLine($"{tab}NumSafePoints: {NumSafePoints}");
            sb.AppendLine($"{tab}NumInterruptibleRanges: {NumInterruptibleRanges}");
            sb.AppendLine($"{tab}SafePointOffsets:");
            foreach (uint offset in SafePointOffsets)
            {
                sb.AppendLine($"{tab}{tab}{offset}");
            }
            sb.AppendLine($"{tab}InterruptibleRanges:");
            foreach (InterruptibleRange range in InterruptibleRanges)
            {
                sb.AppendLine($"{tab}{tab}start:{range.StartOffset}, end:{range.StopOffset}");
            }
            sb.AppendLine($"{tab}SlotTable:");
            sb.Append(SlotTable.ToString());
            sb.AppendLine($"{tab}Size: {Size} bytes");

            return(sb.ToString());
        }
예제 #7
0
파일: GSM.cs 프로젝트: JingChen1988/Bubble
    void Start()
    {
        Instance = this;
        SlotTable = SlotTable.Instance;
        CannonCtl = CannonCtl.Instance;
        //忽略碰撞
        Physics2D.IgnoreLayerCollision(Layer.Bubble, Layer.BubbleFall);
        Physics2D.IgnoreLayerCollision(Layer.Bubble, Layer.Ground);
        Physics2D.IgnoreLayerCollision(Layer.BubbleFall, Layer.BubbleFall);

        StartCoroutine(SlotTable.ShowTable());
    }
예제 #8
0
 /// <summary>
 /// Default ctor
 /// </summary>
 public Master(LocoBuffer lb, RailwayState railwayState, ICommandStationState cs, IStateDispatcher stateDispatcher, Logger log)
 {
     if (lb == null)
     {
         throw new ArgumentNullException("lb");
     }
     if (cs == null)
     {
         throw new ArgumentNullException("cs");
     }
     if (stateDispatcher == null)
     {
         throw new ArgumentNullException("stateDispatcher");
     }
     this.railwayState    = railwayState;
     this.lb              = lb;
     this.log             = log;
     this.stateDispatcher = stateDispatcher;
     this.cs              = cs;
     slotTable            = new SlotTable(cs);
 }
예제 #9
0
        private FieldSetting CreateNewFieldType(FieldDescriptor fieldInfo, Dictionary <string, List <string> > newBindings, ContentListType listType, SlotTable slotTable, SchemaEditor editor)
        {
            List <string> bindList = new List <string>();

            foreach (RepositoryDataType slotType in FieldManager.GetDataTypes(fieldInfo.FieldTypeShortName))
            {
                if (slotType == RepositoryDataType.NotDefined)
                {
                    continue;
                }
                int    slotNumber = slotTable.ReserveSlot((DataType)slotType);
                string binding    = EncodeBinding(slotType, slotNumber);
                bindList.Add(binding);

                PropertyType pt = editor.PropertyTypes[binding];
                if (pt == null)
                {
                    pt = editor.CreateContentListPropertyType((DataType)slotType, slotNumber);
                }
                editor.AddPropertyTypeToPropertySet(pt, listType);
            }
            newBindings.Add(fieldInfo.FieldName, bindList);

            return(FieldSetting.Create(fieldInfo, bindList, null));
        }
예제 #10
0
		private FieldSetting CreateNewFieldType(FieldDescriptor fieldInfo, Dictionary<string, List<string>> newBindings, ContentListType listType, SlotTable slotTable, SchemaEditor editor)
		{
			List<string> bindList = new List<string>();
			foreach (RepositoryDataType slotType in FieldManager.GetDataTypes(fieldInfo.FieldTypeShortName))
			{
				if (slotType == RepositoryDataType.NotDefined)
					continue;
				int slotNumber = slotTable.ReserveSlot((DataType)slotType);
				string binding = EncodeBinding(slotType, slotNumber);
				bindList.Add(binding);

				PropertyType pt = editor.PropertyTypes[binding];
				if (pt == null)
					pt = editor.CreateContentListPropertyType((DataType)slotType, slotNumber);
				editor.AddPropertyTypeToPropertySet(pt, listType);
			}
			newBindings.Add(fieldInfo.FieldName, bindList);

			return FieldSetting.Create(fieldInfo, bindList);
		}
예제 #11
0
		private ContentListType ManageContentListType(Dictionary<string, FieldDescriptor> fieldInfoList, Dictionary<string, List<string>> oldBindings, bool modify, out List<FieldSetting> fieldSettings)
		{
			fieldSettings = new List<FieldSetting>();
			if (!modify)
			{
				//-- Load
                foreach (string name in fieldInfoList.Keys)
                    fieldSettings.Add(FieldSetting.Create(fieldInfoList[name], oldBindings[name]));
                return this.ContentListType;
			}

			SchemaEditor editor = new SchemaEditor();
			editor.Load();
			bool hasChanges = false;
            var listType = this.ContentListType;
			Dictionary<string, List<string>> newBindings = new Dictionary<string, List<string>>();
			SlotTable slotTable = new SlotTable(oldBindings);
			if (listType == null)
			{
				//-- new
				listType = editor.CreateContentListType(Guid.NewGuid().ToString());
				foreach (string name in fieldInfoList.Keys)
					fieldSettings.Add(CreateNewFieldType(fieldInfoList[name], newBindings, listType, slotTable, editor));
				hasChanges = true;
			}
			else
			{
				//-- merge
				listType = editor.ContentListTypes[listType.Name];
				hasChanges |= RemoveUnusedFields(fieldInfoList, oldBindings, listType, editor);
				foreach (string name in fieldInfoList.Keys)
				{
					FieldSetting origField = GetFieldTypeByName(name, _fieldSettings);
					if (origField == null)
					{
						fieldSettings.Add(CreateNewFieldType(fieldInfoList[name], newBindings, listType, slotTable, editor));
						hasChanges = true;
					}
					else
					{
						List<string> bindList = new List<string>(origField.Bindings.ToArray());
                        fieldSettings.Add(FieldSetting.Create(fieldInfoList[name], bindList));
                        newBindings.Add(name, bindList);
					}
				}
			}
			if (hasChanges)
				editor.Register();
            this.ContentListBindings = newBindings;
			return ActiveSchema.ContentListTypes[listType.Name];
		}
예제 #12
0
        public override string ToString()
        {
            StringBuilder sb  = new StringBuilder();
            string        tab = "    ";

            sb.AppendLine($"{tab}Version: {Version}");
            sb.AppendLine($"{tab}CodeLength: {CodeLength}");
            sb.AppendLine($"{tab}ReturnKind: {Enum.GetName(typeof(ReturnKinds), ReturnKind)}");
            sb.AppendLine($"{tab}ValidRangeStart: {ValidRangeStart}");
            sb.AppendLine($"{tab}ValidRangeEnd: {ValidRangeEnd}");
            if (SecurityObjectStackSlot != -1)
            {
                sb.AppendLine($"{tab}SecurityObjectStackSlot: caller.sp{SecurityObjectStackSlot:+#;-#;+0}");
            }

            if (GSCookieStackSlot != -1)
            {
                sb.AppendLine($"{tab}GSCookieStackSlot: caller.sp{GSCookieStackSlot:+#;-#;+0}");
                sb.AppendLine($"GS cookie valid range: [{ValidRangeStart};{ValidRangeEnd})");
            }

            if (PSPSymStackSlot != -1)
            {
                if (_machine == Machine.Amd64)
                {
                    sb.AppendLine($"{tab}PSPSymStackSlot: initial.sp{PSPSymStackSlot:+#;-#;+0}");
                }
                else
                {
                    sb.AppendLine($"{tab}PSPSymStackSlot: caller.sp{PSPSymStackSlot:+#;-#;+0}");
                }
            }

            if (GenericsInstContextStackSlot != -1)
            {
                sb.AppendLine($"{tab}GenericsInstContextStackSlot: caller.sp{GenericsInstContextStackSlot:+#;-#;+0}");
            }

            if (StackBaseRegister != 0xffffffff)
            {
                sb.AppendLine($"{tab}StackBaseRegister: {(Amd64Registers)StackBaseRegister}");
            }
            if (_machine == Machine.Amd64)
            {
                sb.AppendLine($"{tab}Wants Report Only Leaf: {_wantsReportOnlyLeaf}");
            }
            else if (_machine == Machine.Arm || _machine == Machine.Arm64)
            {
                sb.AppendLine($"{tab}Has Tailcalls: {_wantsReportOnlyLeaf}");
            }

            sb.AppendLine($"{tab}Size of parameter area: 0x{SizeOfStackOutgoingAndScratchArea:X}");
            if (SizeOfEditAndContinuePreservedArea != 0xffffffff)
            {
                sb.AppendLine($"{tab}SizeOfEditAndContinuePreservedArea: 0x{SizeOfEditAndContinuePreservedArea:X}");
            }
            if (ReversePInvokeFrameStackSlot != -1)
            {
                sb.AppendLine($"{tab}ReversePInvokeFrameStackSlot: {ReversePInvokeFrameStackSlot}");
            }
            sb.AppendLine($"{tab}NumSafePoints: {NumSafePoints}");
            sb.AppendLine($"{tab}NumInterruptibleRanges: {NumInterruptibleRanges}");
            sb.AppendLine($"{tab}SafePointOffsets:");
            foreach (uint offset in SafePointOffsets)
            {
                sb.AppendLine($"{tab}{tab}{offset}");
            }
            sb.AppendLine($"{tab}InterruptibleRanges:");
            foreach (InterruptibleRange range in InterruptibleRanges)
            {
                sb.AppendLine($"{tab}{tab}start:{range.StartOffset}, end:{range.StopOffset}");
            }
            sb.AppendLine($"{tab}SlotTable:");
            sb.Append(SlotTable.ToString());
            sb.AppendLine($"{tab}Transitions:");
            foreach (GcTransition trans in Transitions)
            {
                sb.AppendLine(trans.ToString());
            }
            sb.AppendLine($"{tab}Size: {Size} bytes");

            return(sb.ToString());
        }
예제 #13
0
        public static BaseTable ReadXBin(BinaryReader reader, ulong hash)
        {
            BaseTable XBinData = null;

            switch (hash)
            {
            case 0x5E42EF29E8A3E1D3:     // StringTable
                XBinData = new StringTable();
                XBinData.ReadFromFile(reader);
                break;

            case 0xA869F8A3AC7656E1:           // M3
            case 0xA869F8A3ED0CDAFC:           // M1: DE
                XBinData = new VehicleTable(); // VehicleTable
                XBinData.ReadFromFile(reader);
                break;

            case 0x3759788EC437536C:     // CarGearboxTable
                XBinData = new CarGearBoxesTable();
                XBinData.ReadFromFile(reader);
                break;

            case 0xF5D56763013A2B0A:     // CarInteriorColorsTable
                XBinData = new CarInteriorColorsTable();
                XBinData.ReadFromFile(reader);
                break;

            case 0x44FA070D73C43CBD:     // CarTrafficTuningTable for M1:DE
            case 0x44FA070D55388F65:     // CarTrafficTuningTable for M3
                XBinData = new CarTrafficTuningTable();
                XBinData.ReadFromFile(reader);
                break;

            case 0x09B5140FA382AF8F:     // CarTuningModificatorsTable
                XBinData = new CarTuningModificatorsTable();
                XBinData.ReadFromFile(reader);
                break;

            case 0x2793BB7847F84081:     // GameMeshBindingTable
                XBinData = new GameMeshBindingTable();
                XBinData.ReadFromFile(reader);
                break;

            case 0x493DEA76C9A390F0:     // SlotTable
                XBinData = new SlotTable();
                XBinData.ReadFromFile(reader);
                break;

            case 0xB77D0A522C8E12A3:     // MissionsTable
                XBinData = new MissionsTable();
                XBinData.ReadFromFile(reader);
                break;

            case 0x3990790678078A1C:     // GenericSpeechSituations
                XBinData = new GenericSpeechSituationsTable();
                XBinData.ReadFromFile(reader);
                break;

            case 0xEF795C84CA85E193:     // CharacterCinematicsTable
                XBinData = new CharacterCinematicsTable();
                XBinData.ReadFromFile(reader);
                break;

            case 0x5D69A41C1FBD6565:     // TableContainer (Mafia I: DE)
            case 0x5D69A41CDC82936C:     // TableContainer (Mafia III)
                XBinData = new TableContainer();
                XBinData.ReadFromFile(reader);
                break;

            case 0x06F579D51CE129A5:     // GfxEnvContainer (Mafia III)
            case 0x06F579D595DA02AD:     // GfxEnvContainer (Mafia I: DE)
                XBinData = new GfxEnvContainer();
                XBinData.ReadFromFile(reader);
                break;

            case 0xAD5CF0F7FC3717F0:     // GameGuiContainer (Mafia I: DE)
            case 0xAD5CF0F764C39370:     // GameGuiContainer (Mafia III)
                XBinData = new GameGuiContainer();
                XBinData.ReadFromFile(reader);
                break;

            case 0x0E2FBBCF46754F66:     // CarTuningPackAvailabilityTable (Mafia I: DE and Mafia III)
                XBinData = new CarTuningPackAvailabilityTable();
                XBinData.ReadFromFile(reader);
                break;

            //case 0xDC327944DD83627E: // TODO: Fix for M1: DE. look for 0xA for PaintCombination array entries.
            //    XBinData = new PaintCombinationsTable(); // PaintCombinations
            //    XBinData.ReadFromFile(reader);
            //    break;
            default:
                throw new Exception("We lack the support for this type.");
                break;
            }

            Debug.Assert(XBinData != null, "XBinData is null, but we should have actually read this.");
            return(XBinData);
        }
예제 #14
0
        private List <TaxChargeSpecification> GetUnitTaxSpecification(BookingFlowContext flowContext, SlotTable slot)
        {
            switch (flowContext.TaxPayeeRelationship)
            {
            case TaxPayeeRelationship.BusinessToBusiness when _appSettings.Payment.TaxCalculationB2B:
            case TaxPayeeRelationship.BusinessToConsumer when _appSettings.Payment.TaxCalculationB2C:
                return(new List <TaxChargeSpecification>
                {
                    new TaxChargeSpecification
                    {
                        Name = "VAT at 20%",
                        Price = slot.Price * (decimal?)0.2,
                        PriceCurrency = "GBP",
                        Rate = (decimal?)0.2
                    }
                });

            case TaxPayeeRelationship.BusinessToBusiness when !_appSettings.Payment.TaxCalculationB2B:
            case TaxPayeeRelationship.BusinessToConsumer when !_appSettings.Payment.TaxCalculationB2C:
                return(null);

            default:
                throw new ArgumentOutOfRangeException();
            }
        }