Ejemplo n.º 1
0
 private void Reset()
 {
     m_LightingProfiles = new LightingDictionary()
     {
         {
             ProfileName.CloseQuarters,
             new LightingProfile()
             {
                 fogMode         = FogMode.Exponential,
                 fogDensity      = 0.1f,
                 backgroundColor = new Color32(20, 25, 30, 255),
                 spotAngle       = 125.0f
             }
         },
         {
             ProfileName.OpenSpaces,
             new LightingProfile()
             {
                 fogMode         = FogMode.Exponential,
                 fogDensity      = 0.05f,
                 backgroundColor = new Color32(200, 200, 200, 255),
                 spotAngle       = 180.0f
             }
         }
     };
 }
        public Token Post([FromBody] Token token)
        {
            var prevToken = (from t in Context.LightingDictionaries
                             where t.ItemKey == "Token"
                             select t).FirstOrDefault();

            var newToken = new Token();
            var temp     = new LightingDictionary();

            if (prevToken == null)
            {
                temp.ItemKey = "Token";
                temp.Value   = token.Value;

                Context.LightingDictionaries.InsertOnSubmit(temp);
            }
            else
            {
                prevToken.Value = token.Value;
            }
            Context.SubmitChanges();
            newToken.Success = true;
            newToken.Value   = token.Value;
            return(newToken);
        }