Exemplo n.º 1
0
 public LaunchRequest(SkillRequest skillRequest)
 {
     this.userProfile       = new UserProfileDB(skillRequest.Session.User.UserId, LOGGER.log);
     this.sessionAttributes = new SessionAttributes(LOGGER.log);
     this.productInventory  = new ProductInventory(skillRequest);
     AlexaResponse.SetSessionAttributeHandler(sessionAttributes);
 }
Exemplo n.º 2
0
 /// <summary>
 /// クラスの情報を SessionAttributes に設定する。
 /// </summary>
 /// <param name="sessionValue">セッション情報</param>
 public void SetSessionAttributesFrom(object sessionValue)
 {
     SessionAttributes.Clear();
     if (sessionValue != null)
     {
         JsonConvert.PopulateObject(JsonConvert.SerializeObject(sessionValue), SessionAttributes);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// クラスの情報を SessionAttributes に設定する。
 /// </summary>
 /// <param name="sessionValue">セッション情報</param>
 public CEKResponse SetSessionAttributesFrom(object sessionValue)
 {
     SessionAttributes.Clear();
     if (sessionValue != null)
     {
         JsonConvert.PopulateObject(JsonConvert.SerializeObject(sessionValue), SessionAttributes);
     }
     return(this);
 }
Exemplo n.º 4
0
 public Intent(SkillRequest request)
 {
     this.skillRequest      = request;
     this.userProfile       = new UserProfileDB(skillRequest.Session.User.UserId, LOGGER.log);
     this.sessionAttributes = new SessionAttributes(LOGGER.log);
     this.sessionAttributes.UpdateSessionAttributes(skillRequest.Session.Attributes);
     AlexaResponse.SetSessionAttributeHandler(sessionAttributes);
     this.products = new ProductInventory(request);
 }
Exemplo n.º 5
0
 /// <summary>
 /// マルチターン対話で、対話の中間情報を保存する
 /// </summary>
 /// <param name="key">セッション情報のキー</param>
 /// <param name="value">セッション情報の値</param>
 public void AddSession(string key, object value)
 {
     if (SessionAttributes.ContainsKey(key))
     {
         SessionAttributes[key] = value;
     }
     else
     {
         SessionAttributes.Add(key, value);
     }
 }
Exemplo n.º 6
0
 /// <summary>
 /// マルチターン対話で、対話の中間情報を保存する
 /// </summary>
 /// <param name="key">セッション情報のキー</param>
 /// <param name="value">セッション情報の値</param>
 public CEKResponse SetSession(string key, object value)
 {
     if (SessionAttributes.ContainsKey(key))
     {
         SessionAttributes[key] = value;
     }
     else
     {
         SessionAttributes.Add(key, value);
     }
     return(this);
 }
Exemplo n.º 7
0
 public AlexaResponse()
 {
     Version  = "1.0";
     Session  = new SessionAttributes();
     Response = new ResponseAttributes();
 }
 /// <summary>
 /// Gets special attributes.
 /// </summary>
 /// <param name="attrib">The attribute to find</param>
 /// <returns>The attribute name</returns>
 public string getSpecialAttribute(SessionAttributes.SpecialAttributes attrib)
 {
     switch (attrib)
     {
         case SessionAttributes.SpecialAttributes.FOLDER:
             return PUTTY_PSM_FOLDER_ATTRIB;
         case SessionAttributes.SpecialAttributes.HOSTNAME:
             return PUTTY_HOSTNAME_ATTRIB;
         case SessionAttributes.SpecialAttributes.USERNAME:
             return PUTTY_USERNAME_ATTRIB;
     }
     return "";
 }
 /// <summary>
 /// Get a list for attribute names for the group
 /// </summary>
 /// <param name="group">The attribute group to find</param>
 /// <returns>The list of attributes</returns>
 public List<string> getAttributeGroup(SessionAttributes.AttribGroups group)
 {
     List<string> attribList;
     dictAllAttribGroups.TryGetValue(group, out attribList);
     return attribList;
 }
 /// <summary>
 /// Gets special attributes.
 /// Delegates to the sessionAttribProvider
 /// </summary>
 /// <param name="attrib">The attribute to find</param>
 /// <returns>The attribute name</returns>
 public string getSpecialAttribute(SessionAttributes.SpecialAttributes attrib)
 {
     return sessionAttribProvider.getSpecialAttribute(attrib);
 }
 /// <summary>
 /// Get a list for attribute names for the group
 /// Delegates to the sessionAttribProvider
 /// </summary>
 /// <param name="group">The attribute group to find</param>
 /// <returns>The list of attributes</returns>
 public List<string> getAttributeGroup(SessionAttributes.AttribGroups group)
 {
     return sessionAttribProvider.getAttributeGroup(group);
 }
Exemplo n.º 12
0
 public void AddSessoin(string key, object value)
 {
     SessionAttributes.Add(key, value);
 }
Exemplo n.º 13
0
 public void WithSessionAttribute(string key, List <object> values)
 {
     SessionAttributes.Add(key, values);
 }
Exemplo n.º 14
0
 public void WithSessionAttribute(string key, object value)
 {
     SessionAttributes.Add(key, new List <object> {
         value
     });
 }
        private CheckState getGroupStatus(SessionAttributes.AttribGroups ag)
        {
            CheckState cs = CheckState.Unchecked;

            // Get the list of attributes associated with this group
            List<string> attribList = sc.getAttributeGroup(ag);

            // Get the selected attributes
            List<string> selectedAttributes = getSelectedAttributes();

            int attribCount = 0;
            foreach (string attrib in attribList)
            {
                if (selectedAttributes.Contains(attrib))
                {
                    attribCount++;
                }
            }

            if (attribCount == 0)
                cs = CheckState.Unchecked;
            else if (attribCount < attribList.Count)
                cs = CheckState.Indeterminate;
            else
                cs = CheckState.Checked;

            return cs;
        }