Beispiel #1
0
        public ITMViewModel(string path) : base(path)
        {
            _context = new ITM(path);

            foreach (var item in _context.Items)
            {
                Items.Add(new ITMItemViewModel(item, this));
            }

            LinkGmdCommand = new RelayCommand(LinkGmd, () => true);
        }
Beispiel #2
0
            public override void Process(HttpWebResponse rsp)
            {
                string txt = null;

                using (var rdr = new StreamReader(rsp.GetResponseStream())) {
                    txt = rdr.ReadToEnd();
                }

                if (string.IsNullOrEmpty(txt))
                {
                    return;
                }
                else if (this.ReX != null)
                {
                    var emch = this.ReX.Matches(txt);
                    foreach (rx.Match mch in emch)
                    {
                        ITM.Message(ITM, new EventArgsMessage(getMatch(mch), TMessage.CommandResult));
                    }
                }
                else
                {
                    ITM.Message(ITM, new EventArgsMessage(txt));
                }


                string getMatch(rx.Match item)
                {
                    rx.Group grp;

                    if (string.IsNullOrEmpty(this.GroupName))
                    {
                    }
                    else if ((grp = item.Groups[this.GroupName]) != null)
                    {
                        return(grp.Success ? grp.Value : string.Empty);
                    }

                    return(item.Value);
                }
            }
Beispiel #3
0
 public void Load__itemData()
 {
     ITM itm = new ITM(Utility.GetFullPath(@"chunk0/common/item/itemData.itm"));
 }