Example #1
0
 public void Set(string key, byte[] value)
 {
     GetDictionary.Add(key, value);
     Keys = Keys.Concat(new List <string> {
         key
     });
 }
Example #2
0
        // Ex: http://localhost/dictionary
        // Ex: http://localhost/dictionary?showInstanceIds=true
        public void Process(ISemanticProcessor proc, IMembrane membrane, GetDictionary msg)
        {
            StringBuilder sb = new StringBuilder();

            sb.StartHtml();

            sb.StartHead().
            Script("/js/wireUpValueChangeNotifier.js").
            Stylesheet("/css/styles.css").
            EndHead();
            sb.StartBody();

            sb.StartParagraph().Append("<b>Dictionary:</b>").EndParagraph();
            sb.StartParagraph().StartDiv().ID("dictionary").EndDiv().EndParagraph();

            sb.StartParagraph().Append("<b>Type Nodes:</b>").EndParagraph();
            sb.StartParagraph().StartDiv().ID("nodes").EndDiv().EndParagraph();

            sb.StartScript().Javascript("(function() {getDictionaryHtml(" + msg.ShowInstanceIDs.ToString().ToLower() + ");})();").EndScript();
            sb.EndBody().EndHtml();

            proc.ProcessInstance <WebServerMembrane, HtmlResponse>(r =>
            {
                r.Context = msg.Context;
                r.Html    = sb.ToString();
            });
        }
Example #3
0
        public IActionResult Load(long?ID, long?langId)
        {
            GetDictionary operation = new GetDictionary();

            operation.ID = ID;

            if (langId.HasValue)
            {
                operation.LangID = langId;
            }
            else
            {
                operation.LangID = 1;
            }

            var result = operation.QueryAsync().Result;

            if (result is ValidationsOutput)
            {
                return(Ok(new ApiResult <List <ValidationItem> >()
                {
                    Data = ((ValidationsOutput)result).Errors
                }));
            }
            else
            {
                return(Ok((List <Dictionary>)result));
            }
        }
Example #4
0
        public void Remove(string key)
        {
            GetDictionary.Remove(key);
            var newKeys = Keys.ToList();

            newKeys.Remove(key);
            Keys = newKeys;
        }
Example #5
0
 Dictionary <string, object> First(CultureInfo culture)
 {
     resources = localizator.CreateDictionary(culture);
     dict      = Last;
     return(resources);
 }
Example #6
0
 private Localizator(ILocalizator localizator)
 {
     this.localizator = localizator;
     dict             = First;
 }
Example #7
0
 public void Clear()
 {
     GetDictionary.Clear();
     Keys = new List <string>();
 }