示例#1
0
        public void CanStoreOneCustomizationInTwoProducts()
        {
            long customizationId;
              using (var session = sessionFactory.OpenSession())
              using (var tx = session.BeginTransaction())
              {
            var customizationRepository = new Repository<Customization>(session);
            var customization = new Customization {Name = "Milk", PossibleValues = {"skim", "semi", "whole"}};
            customizationRepository.MakePersistent(customization);
            customizationId = customization.Id;

            var productRepository = new Repository<Product>(session);
            productRepository.MakePersistent(new Product
                                         {
                                           Name = "Coffee 3",
                                           Price = 10.4m,
                                           Customizations = {customization}
                                         });
            productRepository.MakePersistent(new Product {Name = "Coffee 4", Price = 5.4m, Customizations = {customization}});

            tx.Commit();
              }

              using (var session = sessionFactory.OpenSession())
              {
            new Repository<Product>(session)
              .Retrieve(p => p.Customizations.Any(c => c.Id == customizationId))
              .Count().Should().Be.EqualTo(2);
              }
        }
        public void InitializeData()
        {
            using (var session = sessionFactory.OpenSession())
              using (var tx = session.BeginTransaction())
              {
            var milk = new Customization
                   {
                     Name = "Milk",
                     PossibleValues = {"skim", "semi", "whole"}
                   };

            var size = new Customization
                   {
                     Name = "Size",
                     PossibleValues = {"small", "medium", "large"}
                   };

            var shots = new Customization
                    {
                      Name = "Shots",
                      PossibleValues = {"single", "double", "triple"}
                    };

            var whippedCream = new Customization
                           {
                             Name = "Whipped Cream",
                             PossibleValues = {"yes", "no"}
                           };

            var kindOfCookie = new Customization
                           {
                             Name = "Kind",
                             PossibleValues = {"chocolate chip", "ginger"}
                           };

            var customizationRepository = new Repository<Customization>(session);
            customizationRepository.MakePersistent(milk, size, shots, whippedCream, kindOfCookie);
            var productRepository = new Repository<Product>(session);

            var coffees = new[] {"Latte", "Capuccino", "Espresso", "Tea"}
              .Select(
            coffeName =>
            new Product {Name = coffeName, Price = (decimal) coffeName.First()/10, Customizations = {milk, size, shots}})
              .ToArray();

            productRepository.MakePersistent(coffees);

            productRepository.MakePersistent(new Product
                                         {
                                           Name = "Hot Chocolate",
                                           Price = 10.5m,
                                           Customizations = {milk, size, whippedCream}
                                         });
            productRepository.MakePersistent(new Product {Name = "Cookie", Price = 1, Customizations = {kindOfCookie}});
            tx.Commit();
              }
        }
示例#3
0
        public void DutyCommand(Client player)
        {
            // We get the sex, job and faction from the player
            int playerSex     = player.GetData(EntityData.PLAYER_SEX);
            int playerJob     = player.GetData(EntityData.PLAYER_JOB);
            int playerFaction = player.GetData(EntityData.PLAYER_FACTION);

            if (player.GetData(EntityData.PLAYER_KILLED) != 0)
            {
                player.SendChatMessage(Constants.COLOR_ERROR + Messages.ERR_PLAYER_IS_DEAD);
            }
            else if (playerJob == 0 && playerFaction == 0)
            {
                player.SendChatMessage(Constants.COLOR_ERROR + Messages.ERR_PLAYER_NO_JOB);
            }
            else if (player.GetData(EntityData.PLAYER_ON_DUTY) == 1)
            {
                // Populate player's clothes
                Customization.ApplyPlayerClothes(player);

                // We set the player off duty
                player.SetData(EntityData.PLAYER_ON_DUTY, 0);

                // Notification sent to the player
                player.SendNotification(Messages.INF_PLAYER_FREE_TIME);
            }
            else
            {
                // Dress the player with the uniform
                foreach (UniformModel uniform in Constants.UNIFORM_LIST)
                {
                    if (uniform.type == 0 && uniform.factionJob == playerFaction && playerSex == uniform.characterSex)
                    {
                        player.SetClothes(uniform.uniformSlot, uniform.uniformDrawable, uniform.uniformTexture);
                    }
                    else if (uniform.type == 1 && uniform.factionJob == playerJob && playerSex == uniform.characterSex)
                    {
                        player.SetClothes(uniform.uniformSlot, uniform.uniformDrawable, uniform.uniformTexture);
                    }
                }

                // We set the player on duty
                player.SetData(EntityData.PLAYER_ON_DUTY, 1);

                // Notification sent to the player
                player.SendNotification(Messages.INF_PLAYER_ON_DUTY);
            }
        }
        //Customization options: Aliases, colors, etc.
        protected override void OnActionExecuted(ActionExecutedContext filterContext)
        {
            base.OnActionExecuted(filterContext);

            if (filterContext.Result is ViewResultBase result)
            {
                if (filterContext.Controller.ViewData.Model is BaseViewModel model)
                {
                    SubplatformManager platformManager = new SubplatformManager();
                    int           subPlatformID        = (int)RouteData.Values["SubPlatformID"];
                    Customization customization        = platformManager.GetCustomization(subPlatformID);
                    model.Customization           = Mapper.Map(customization, new CustomizationViewModel());
                    model.Customization.Questions = Mapper.Map(platformManager.GetQuestions(subPlatformID), new List <QuestionDTO>());
                }
            }
        }
    private void GetSlotMachineSprite()
    {
        string         spritePath     = string.Format("{0}/background.png", customFolderDataPath);
        SpriteRenderer spriteRenderer = slotMachineSpriteGameObject.GetComponent <SpriteRenderer>();
        Texture2D      image          = null;

        if (File.Exists(spritePath))
        {
            image = new Texture2D(1920, 1080, TextureFormat.ARGB32, true);
            StartCoroutine(Customization.LoadTexture2D(spritePath, image));
            Rect imageRect = new Rect(0, 0, 1920, 1080);
            spriteRenderer.sprite = Sprite.Create(image, imageRect, new Vector2(0.5f, 0.5f));
        }

        //print(Screen.width + " x " + Screen.height);
    }
示例#6
0
 public static void Load(ContentManager Content)
 {
     Title.Load(Content);
     HUD.Load(Content);
     Customization.Load(Content);
     ButtonLeft       = Content.Load <Texture2D>("Menu/ButtonLeft");
     ButtonCenter     = Content.Load <Texture2D>("Menu/ButtonCenter");
     ButtonRight      = Content.Load <Texture2D>("Menu/ButtonRight");
     ButtonFont       = Content.Load <SpriteFont>("UI");
     DisplayLeft      = Content.Load <Texture2D>("Menu/DisplayLeft");
     DisplayCenter    = Content.Load <Texture2D>("Menu/DisplayCenter");
     DisplayRight     = Content.Load <Texture2D>("Menu/DisplayRight");
     SmallDisplayFont = Content.Load <SpriteFont>("SmallUI");
     ButtonSquare     = Content.Load <Texture2D>("Menu/ButtonSquare");
     BaroqueScript16  = Content.Load <SpriteFont>("BaroqueScript");
 }
        internal static Customization GetCustomConfig()
        {
            Customization result = null;

            if (!File.Exists(Consts.CustomConfigFile))
            {
                return(null);
            }
            else
            {
                result = new Customization();
                ReadParameters(result);
            }

            return(result);
        }
示例#8
0
 public static void Event_PlayerDeath(Client player, Client entityKiller, uint weapon)
 {
     try
     {
         if (!Main.Players.ContainsKey(player))
         {
             return;
         }
         if (Main.Players[player].WorkID == 2 && NAPI.Data.GetEntityData(player, "ON_WORK"))
         {
             NAPI.Data.SetEntityData(player, "ON_WORK", false);
             Customization.ApplyCharacter(player);
         }
     }
     catch (Exception e) { Log.Write("PlayerDeath: " + e.Message, nLog.Type.Error); }
 }
示例#9
0
    public void AddCustomization(Customization CustomizationType)
    {
        switch (CustomizationType)
        {
        case Customization.PowerCore:
            currentUpgradeList.Add(selectedShipCell, new PowerCore());
            currentUpgradeList[selectedShipCell].AddUpgrade(playersShip);
            break;

        case Customization.CommandBridge:
            currentUpgradeList.Add(selectedShipCell, new CommandBridge());
            currentUpgradeList[selectedShipCell].AddUpgrade(playersShip);
            break;

        case Customization.WeaponModule:
            currentUpgradeList.Add(selectedShipCell, new WeaponModule());
            currentUpgradeList[selectedShipCell].AddUpgrade(playersShip);
            break;

        case Customization.ShieldSystem:
            currentUpgradeList.Add(selectedShipCell, new ShieldSystem());
            currentUpgradeList[selectedShipCell].AddUpgrade(playersShip);
            break;

        case Customization.WarpDrive:
            currentUpgradeList.Add(selectedShipCell, new WarpDrive());
            currentUpgradeList[selectedShipCell].AddUpgrade(playersShip);
            break;

        case Customization.SensorRelay:
            currentUpgradeList.Add(selectedShipCell, new SensorRelay());
            currentUpgradeList[selectedShipCell].AddUpgrade(playersShip);
            break;

        case Customization.CrewQuarter:
            currentUpgradeList.Add(selectedShipCell, new CrewQuarter());
            currentUpgradeList[selectedShipCell].AddUpgrade(playersShip);
            break;

        case Customization.ImpulseEngine:
            currentUpgradeList.Add(selectedShipCell, new ImpulseEngine());
            currentUpgradeList[selectedShipCell].AddUpgrade(playersShip);
            break;
        }

        UpdateUIStats();
    }
        /// <summary>
        /// Page management page of admin.
        /// </summary>
        public ActionResult PageManagement()
        {
            userManager     = new UserManager();
            platformManager = new SubplatformManager();

            //Map viewmodel
            int           subPlatformID = (int)RouteData.Values["SubPlatformID"];
            Customization custom        = platformManager.GetCustomization(subPlatformID);

            //Assembling the view
            CustomizationViewModel vm = Mapper.Map(custom, new CustomizationViewModel());

            vm.Questions = Mapper.Map(platformManager.GetQuestions(subPlatformID), new List <QuestionDTO>());
            vm.User      = userManager.GetUser(User.Identity.GetUserId());
            vm.PageTitle = Resources.PageManagement;
            return(View(vm));
        }
        public static void WriteCustomParameters(Customization _customization)
        {
            if (_customization == null)
            {
                return;
            }

            using (StreamWriter text = File.CreateText(Consts.CustomConfigFile))
            {
                foreach (PropertyInfo property in _customization.GetType().GetProperties())
                {
                    text.WriteLine(property.Name + "=" + property.GetValue(_customization, null));
                }
            }
            //megvárjuk, hogy kiíródjon a fájl
            System.Threading.Thread.Sleep(300);
        }
示例#12
0
        // Constructor ..
        public HistoryForm(ref Customization Cust, ref Communication Comm, Settings Setting)
        {
            // initialize form control component ..
            InitializeComponent();

            // assign customize class reference ..
            this.EnvCust = Cust;

            // assign communization class refrernce ..
            this.EnvComm = Comm;

            // assign environment structure ..
            this.EnvSetting = Setting;

            // initializing user interface behavior ..
            Language(Setting.Lang);
        }
        /// <summary>
        /// Retrieves the customization settings; or, creates them if they do not exist.
        /// </summary>
        /// <returns>A <see cref="Customization"/> instance containing the customization settings.</returns>
        public async Task <Customization> GetOrCreateCustomizationSettingsAsync()
        {
            Customization customizationSettings = null;

            using (var session = _storeProvider.Store.OpenAsyncSession())
            {
                customizationSettings = await session.LoadAsync <Customization>(DOCUMENT_KEY);
            }

            if (customizationSettings == null)
            {
                customizationSettings = Defaults.Customization;
                await PersistCustomizationSettingsAsync(customizationSettings);
            }

            return(customizationSettings);
        }
示例#14
0
        /// <summary>
        /// Retrieves the customization settings; or, creates them if they do not exist.
        /// </summary>
        /// <returns>A <see cref="Customization"/> instance containing the customization settings.</returns>
        public async Task <Customization> GetOrCreateCustomizationSettingsAsync()
        {
            Customization customizationSettings = null;

            using (var session = Database.DocumentStore.OpenAsyncSession())
            {
                customizationSettings = await session.LoadAsync <Customization>(KEY);
            }

            if (customizationSettings == null)
            {
                customizationSettings = Defaults.Customization;
                await PersistCustomizationSettingsAsync(customizationSettings);
            }

            return(customizationSettings);
        }
示例#15
0
        public IActionResult UpdateCustomization(int id, [FromBody] Customization item)
        {
            var customization = _unitOfWork.Customizations.Get(id);

            if (customization == null)
            {
                return(NotFound());
            }

            customization.Description = item.Description;
            customization.Name        = item.Name;
            customization.Price       = item.Price;

            _unitOfWork.Complete();

            return(Ok());
        }
示例#16
0
        public BitmapImage GetCustom(Customization custom)
        {
            string d = "";

            switch (custom.CustomizationType)
            {
            case CustomizationType.Avatar:
                d = "Avatars";
                break;

            case CustomizationType.Sleeve:
                d = "Sleeves";
                break;

            case CustomizationType.Border:
                d = "Borders";
                break;

            case CustomizationType.Partner:
                d = "Partners";
                break;
            }

            if (!File.Exists(Path.Combine(FormExecution.path, "Assets", d, custom.Id + ".png")))
            {
                string url = custom.IsHost ? custom.URL : string.Format("http://raw.githubusercontent.com/Battle-City-Alpha/BattleCityAlpha-v2-Assets/master/{0}/{1}.png", d, custom.Id);
                try
                {
                    using (WebClient wc = new WebClient())
                    {
                        wc.DownloadFile(
                            new System.Uri(url),
                            Path.Combine(FormExecution.path, "Assets", d, custom.Id + ".png")
                            );
                    }
                }
                catch (Exception ex)
                {
                    logger.Error(ex.ToString());
                    FormExecution.Client_PopMessageBox("Une erreur s'est produite lors du chargement de votre image.", "Erreur");
                }
            }

            return(GetImage(d, custom.Id.ToString()));
        }
示例#17
0
 private void OnCheckCustomizationStatus(Customization customization, string customData)
 {
     if (customization != null)
     {
         Log.Debug("TestSpeechToText", "Customization status: {0}", customization.status);
         if (customization.status != "ready" && customization.status != "available")
         {
             Runnable.Run(CheckCustomizationStatus(customData, 5f));
         }
         else
         {
             _isCustomizationReady = true;
         }
     }
     else
     {
         Log.Debug("TestSpeechToText", "Check customization status failed!");
     }
 }
 private void OnCheckCustomizationStatus(Customization customization, Dictionary <string, object> customData)
 {
     if (customization != null)
     {
         Log.Debug("ExampleSpeechToText.OnCheckCustomizationStatus()", "Customization status: {0}", customization.status);
         if (customization.status != "ready" && customization.status != "available")
         {
             Runnable.Run(CheckCustomizationStatus(customData["customizationID"].ToString(), 5f));
         }
         else
         {
             _isCustomizationReady = true;
         }
     }
     else
     {
         Log.Debug("ExampleSpeechToText.OnCheckCustomizationStatus()", "Check customization status failed!");
     }
 }
示例#19
0
 public void CanStoreACustomization()
 {
     long customizationId;
       using (var session = sessionFactory.OpenSession())
       using (var tx = session.BeginTransaction())
       {
     var repository = new Repository<Customization>(session);
     var customization = new Customization {Name = "Milk", PossibleValues = {"skim", "semi", "whole"}};
     repository.MakePersistent(customization);
     customizationId = customization.Id;
     tx.Commit();
       }
       using (var session = sessionFactory.OpenSession())
       {
     var repository = new Repository<Customization>(session);
     Customization readed = repository.GetById(customizationId);
     readed.Satisfy(c => c.Name == "Milk" && c.PossibleValues.SetEquals(new[] {"skim", "semi", "whole"}));
       }
 }
示例#20
0
        public static void mowerRent(Client player)
        {
            if (NAPI.Player.IsPlayerInAnyVehicle(player) || player.VehicleSeat != -1 || player.Vehicle.GetData("TYPE") != "MOWER")
            {
                var way = 0;
                Notify.Send(player, NotifyType.Info, NotifyPosition.BottomCenter, $"Вы начали работу газонокосильщика, следуйте по чекпоинтам", 3000);
                var vehicle = player.Vehicle;
                NAPI.Data.SetEntityData(player, "WORK", vehicle);
                Core.VehicleStreaming.SetEngineState(vehicle, true);
                NAPI.Data.SetEntityData(player, "ON_WORK", true);
                NAPI.Data.SetEntityData(player, "IN_WORK_CAR", true);
                NAPI.Data.SetEntityData(vehicle, "ON_WORK", true);
                NAPI.Data.SetEntityData(player, "WORKWAY", way);
                NAPI.Data.SetEntityData(player, "WORKCHECK", 0);
                NAPI.Data.SetEntityData(vehicle, "DRIVER", player);

                var gender = Main.Players[player].Gender;
                Core.Customization.ClearClothes(player, gender);
                if (gender)
                {
                    Customization.SetHat(player, 94, 9);
                    player.SetClothes(11, 82, 4);
                    player.SetClothes(4, 27, 10);
                    player.SetClothes(6, 1, 11);
                    player.SetClothes(11, Core.Customization.CorrectTorso[gender][82], 0);
                }
                else
                {
                    Customization.SetHat(player, 93, 9);
                    player.SetClothes(11, 14, 9);
                    player.SetClothes(4, 16, 2);
                    player.SetClothes(6, 1, 3);
                    player.SetClothes(11, Core.Customization.CorrectTorso[gender][14], 0);
                }

                Trigger.ClientEvent(player, "createCheckpoint", 4, 1, MowerWays[way][0] - new Vector3(0, 0, 1.12), 2, 0, 255, 0, 0, MowerWays[way][1] - new Vector3(0, 0, 1.12));
                Trigger.ClientEvent(player, "createWaypoint", MowerWays[way][0].X, MowerWays[way][0].Y);
            }
            else
            {
                Notify.Send(player, NotifyType.Error, NotifyPosition.BottomCenter, $"Вы должны находиться в транспорте", 3000);
            }
        }
示例#21
0
        private static void callback_armyclothes(Client client, Menu menu, Menu.Item item, string eventName, dynamic data)
        {
            switch (item.ID)
            {
            case "change":
                if (Main.Players[client].FractionLVL < 6)
                {
                    Notify.Send(client, NotifyType.Error, NotifyPosition.BottomCenter, $"Вы не можете переодеться/раздеться", 3000);
                    return;
                }
                if (!client.GetData("ON_DUTY"))
                {
                    Notify.Send(client, NotifyType.Success, NotifyPosition.BottomCenter, $"Вы переоделись в служебную форму", 3000);
                    Manager.setSkin(client, 14, Main.Players[client].FractionLVL);
                    client.SetData("ON_DUTY", true);
                }
                else
                {
                    Notify.Send(client, NotifyType.Success, NotifyPosition.BottomCenter, $"Вы переоделись в повседневную одежду", 3000);
                    Customization.ApplyCharacter(client);
                    if (client.HasData("HAND_MONEY"))
                    {
                        client.SetClothes(5, 45, 0);
                    }
                    else if (client.HasData("HEIST_DRILL"))
                    {
                        client.SetClothes(5, 41, 0);
                    }
                    client.SetData("ON_DUTY", false);
                }
                return;

            case "combat":
                MenuManager.Close(client);
                OpenArmyCombatMenu(client);
                return;

            case "close":
                MenuManager.Close(client);
                return;
            }
        }
示例#22
0
        public KeyboardCommands(Game1 game  = null, Pointer pointer = null,
                                Level level = null)
        {
            state            = new KeyboardState(null);
            this.keyCommands = new Dictionary <KeyboardState, ICommand>();

            CustomUpdate = () => { };
            if (game != null)
            {
                AddBasicGameKeyboard(game);
            }
            if (pointer != null)
            {
                AddBasicPointerKeyboard(pointer);
            }
            if (level != null)
            {
                AddBasicLevelKeyboard(level);
            }
        }
示例#23
0
        private void HandleGetCustomization(Customization customization, string customData)
        {
            if (!string.IsNullOrEmpty(customData))
            {
                Log.Debug("TestSpeechToText", "custom data: {0}", customData);
            }

            if (customization != null)
            {
                Log.Debug("TestSpeechToText", "Customization - name: {0} | description: {1} | status: {2}", customization.name, customization.description, customization.status);
                Log.Debug("TestSpeechToText", "GetCustomization() succeeded!");
            }
            else
            {
                Log.Debug("TestSpeechToText", "Failed to get customization {0}!", m_CreatedCustomizationID);
            }

            Test(customization != null);
            m_GetCustomizationTested = true;
        }
示例#24
0
        public IActionResult SetCustomization(string name)
        {
            var row = data.Customizations.Find(name);

            if (row == null)
            {
                row = new Customization {
                    Name = name
                };
                data.Customizations.Add(row);
            }

            using (var reader = new StreamReader(Request.Body))
            {
                row.Value = reader.ReadToEnd();
                data.SaveChanges();
            }

            return(Ok());
        }
示例#25
0
        /// <summary>
        /// Primary renbar client priority form constructor procedure.
        /// </summary>
        /// <param name="Cust">reference customize class.</param>
        /// <param name="Comm">refrernce communication class.</param>
        /// <param name="Setting">current environment setting information.</param>
        /// <param name="Machines">selected machine items.</param>
        public Priority_Form(ref Customization Cust, ref Communication Comm, Settings Setting, IList <string> ObjectItems, Client2Server.CommunicationType Commtype)
        {
            // initialize form control component ..
            InitializeComponent();

            // assign customize class reference ..
            this.EnvCust = Cust;

            // assign communization class refrernce ..
            this.EnvComm = Comm;

            // assign setting list to machine data list ..
            this.DataList = ObjectItems;

            //
            this.CommType = Commtype;

            // initializing user interface behavior ..
            Language(Setting.Lang);
        }
        public async Task <int> DeleteCustomizationAsync(int id)
        {
            bool exists = await CustomizationExistsAsync(id);

            if (exists)
            {
                var          entityToDelete = new Customization();
                Type         type           = entityToDelete.GetType();
                PropertyInfo prop           = type.GetProperty("Id");
                prop.SetValue(entityToDelete, id, null);
                _coditoContext.Customizations.Attach(entityToDelete);
                _coditoContext.Customizations.Remove(entityToDelete);

                // return number of changes
                return(await _coditoContext.SaveChangesAsync());
            }
            else
            {
                return(0);
            }
        }
示例#27
0
    private void HandleGetCustomization(Customization customization, string customData)
    {
        if (!string.IsNullOrEmpty(customData))
        {
            Log.Debug("ExampleSpeechToText", "custom data: {0}", customData);
        }

        if (customization != null)
        {
            Log.Debug("ExampleSpeechToText", "Customization - name: {0} | description: {1} | status: {2}", customization.name, customization.description, customization.status);
            Log.Debug("ExampleSpeechToText", "GetCustomization() succeeded!");

            //	test add custom corpora
            //TestAddCustomCorpus(m_CreatedCustomizationID, m_CreatedCorpusName, true, m_CustomCorpusFilePath);
            TestDeleteCustomization(m_CreatedCustomizationID);
        }
        else
        {
            Log.Debug("ExampleSpeechToText", "Failed to get customization {0}!", m_CreatedCustomizationID);
        }
    }
        public bool Equals(DestinyCharacterRenderComponent input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     CustomDyes == input.CustomDyes ||
                     (CustomDyes != null && CustomDyes.SequenceEqual(input.CustomDyes))
                     ) &&
                 (
                     Customization == input.Customization ||
                     (Customization != null && Customization.Equals(input.Customization))
                 ) &&
                 (
                     PeerView == input.PeerView ||
                     (PeerView != null && PeerView.Equals(input.PeerView))
                 ));
        }
示例#29
0
        public async Task CanPersistCustomization()
        {
            // Arrange
            var documentStoreProvider = DocumentStoreProvider;
            var newCustomization      = new Customization
            {
                InstanceName = "MyCustomInstance"
            };

            // Act
            var sut = new CustomizationManager(documentStoreProvider);
            await sut.PersistCustomizationSettingsAsync(newCustomization);

            // Assert
            using (var session = documentStoreProvider.Store.OpenAsyncSession())
            {
                var configuration = await session.LoadAsync <Customization>("urn:Augurk:Customization");

                configuration.InstanceName.ShouldBe("MyCustomInstance");
            }
        }
示例#30
0
        public void CanStoreACustomization()
        {
            long customizationId;

            using (var session = sessionFactory.OpenSession())
                using (var tx = session.BeginTransaction())
                {
                    var repository    = new Repository <Customization>(session);
                    var customization = new Customization {
                        Name = "Milk", PossibleValues = { "skim", "semi", "whole" }
                    };
                    repository.MakePersistent(customization);
                    customizationId = customization.Id;
                    tx.Commit();
                }
            using (var session = sessionFactory.OpenSession())
            {
                var           repository = new Repository <Customization>(session);
                Customization readed     = repository.GetById(customizationId);
                readed.Satisfy(c => c.Name == "Milk" && c.PossibleValues.SetEquals(new[] { "skim", "semi", "whole" }));
            }
        }
示例#31
0
 public void Update(DestinyCharacterRenderComponent?other)
 {
     if (other is null)
     {
         return;
     }
     if (!CustomDyes.DeepEqualsList(other.CustomDyes))
     {
         CustomDyes = other.CustomDyes;
         OnPropertyChanged(nameof(CustomDyes));
     }
     if (!Customization.DeepEquals(other.Customization))
     {
         Customization.Update(other.Customization);
         OnPropertyChanged(nameof(Customization));
     }
     if (!PeerView.DeepEquals(other.PeerView))
     {
         PeerView.Update(other.PeerView);
         OnPropertyChanged(nameof(PeerView));
     }
 }
示例#32
0
        public static void Initial()
        {
            var cfgFileExists = LoadConfigFile("dewrito_prefs.cfg", ref ConfigFile);

            if (!cfgFileExists)
            {
                ;
                SetVariable("Player.Representation", Customization.GetPrefsFromRace(Customization.DEFAULT_RACE), ref ConfigFile, false);
                SetVariable("Player.Armor.Accessory", "air_assault", ref ConfigFile, false);
                SetVariable("Player.Armor.Arms", Customization.Spartan.GetPrefsFromShoulder(Customization.Spartan.DEFAULT_RIGHT_SHOULDER), ref ConfigFile, false);
                SetVariable("Player.Armor.Chest", Customization.Spartan.GetPrefsFromChest(Customization.Spartan.DEFAULT_CHEST), ref ConfigFile, false);
                SetVariable("Player.Armor.Helmet", Customization.Spartan.GetPrefsFromHelmet(Customization.Spartan.DEFAULT_HELMET), ref ConfigFile, false);
                SetVariable("Player.Armor.Legs", "air_assault", ref ConfigFile, false);
                SetVariable("Player.Armor.Pelvis", "", ref ConfigFile, false);
                SetVariable("Player.Armor.Shoulders", Customization.Spartan.GetPrefsFromShoulder(Customization.Spartan.DEFAULT_LEFT_SHOULDER), ref ConfigFile, false);
                SetVariable("Player.Colors.Primary", Customization.GetPrefsFromColor(Customization.DEFAULT_PRIMARY_COLOR), ref ConfigFile, false);
                SetVariable("Player.Colors.Secondary", Customization.GetPrefsFromColor(Customization.DEFAULT_SECONDARY_COLOR), ref ConfigFile, false);
                SetVariable("Player.Colors.Visor", Customization.GetPrefsFromColor(Customization.DEFAULT_DETAIL_COLOR), ref ConfigFile, false);
                SetVariable("Player.Colors.Lights", "#000000", ref ConfigFile, false);
                SetVariable("Player.Colors.Holo", "#000000", ref ConfigFile, false);
            }
        }
示例#33
0
        /// <summary>
        /// Changes the FAQ title of a specific platform
        /// Updates the changes in database
        /// </summary>
        public Customization ChangeFAQTitle(int platformId, string title)
        {
            InitRepo();

            //Get Customization of platform
            SubPlatform platform = platformRepo.ReadSubplatformWithCustomization(platformId);

            if (platform == null || platform.Customization == null)
            {
                return(null);
            }

            //Change Customization
            Customization custom = platform.Customization;

            custom.FAQTitle = title;

            //Update platform
            platformRepo.UpdateSubplatform(platform);

            return(custom);
        }
示例#34
0
        public void CustomizeObjectWithOneOfTheCustomizationsBeingNullFails()
        {
            var obj = new SampleClass();
            var arrayOfCustomizationsContainingNull = new Customization<SampleClass>[] {null};

            var exception = Record.Exception(
                () => obj.Customize(arrayOfCustomizationsContainingNull));

            exception.Should().BeOfType<NullReferenceException>();
        }