Exemple #1
0
 private void _srcT_changed(Data.DTopic.Art a, Data.DTopic t)
 {
     if (a == Data.DTopic.Art.value)
     {
         textEditor.Text = _srcT.State.Value as string;
     }
 }
 private void _checkTopic_changed(Data.DTopic.Art art, Data.DTopic t)
 {
     if (art == Data.DTopic.Art.type)
     {
         Refresh();
     }
     else if (art == Data.DTopic.Art.RemoveChild && t == _checkTopic)
     {
         _checkTopic   = null;
         _actVersion   = new Version(0, 0);
         RemoveEnabled = false;
         base.PropertyChangedReise("ActVer");
     }
 }
 public CatalogItem(string serverUrl, Data.DTopic root, Action <CatalogItem, bool> collFunc)
 {
     _loaded              = false;
     _collFunc            = collFunc;
     _url                 = serverUrl;
     _rootT               = root;
     _path                = "/";
     _name                = new Uri(_url).DnsSafeHost;
     _srcVersion          = new Version(0, 0);
     _actVersion          = new Version(0, 0);
     ActionButtonsVisible = Visibility.Collapsed;
     IsVisible            = true;
     IsExpanded           = true;
 }
        public CatalogItem(CatalogItem parent, JSC.JSValue inf)
        {
            _loaded   = false;
            _parent   = parent;
            _collFunc = _parent._collFunc;
            _rootT    = _parent._rootT;
            _name     = inf["name"].Value as string;
            _hint     = inf["hint"].Value as string;
            var tmp_s = inf["children"].Value as string;

            if (string.IsNullOrEmpty(tmp_s))
            {
                _url = null;
            }
            else if (tmp_s.StartsWith("http"))
            {
                _url = tmp_s;
            }
            else if (tmp_s.StartsWith("/"))
            {
                _url = (new Uri(_parent._url)).GetLeftPart(UriPartial.Authority) + tmp_s + "/";
            }
            else
            {
                _url = _parent._url + tmp_s + "/";
            }
            _path       = _parent._path + _name + "/";
            _src        = inf["src"].Value as string;
            _checkPath  = inf["path"].Value as string;
            tmp_s       = inf["ver"].Value as string;
            _actVersion = new Version(0, 0);
            if (string.IsNullOrWhiteSpace(tmp_s) || !Version.TryParse(tmp_s, out _srcVersion))
            {
                _srcVersion          = new Version(0, 0);
                ActionButtonsVisible = Visibility.Collapsed;
            }
            else if (_src != null && _checkPath != null)
            {
                _rootT.GetAsync(_checkPath).ContinueWith(CheckTopicLoaded);
                ActionButtonsVisible = Visibility.Visible;
            }
            _isExpanded = false;
            _items      = null;
            IsVisible   = _parent._isVisible && _parent._isExpanded;
        }