private void UpdContent() { ContentId = _path + (_view == null ? string.Empty : ("?view=" + _view)); if (_view == "IN") { if ((ccMain.Content as InspectorForm) == null) { if (contentForm != null) { contentForm.Dispose(); } contentForm = new InspectorForm(_data); } } else if (_view == "LO") { if ((ccMain.Content as LogramForm) == null) { if (contentForm != null) { contentForm.Dispose(); } contentForm = new LogramForm(_data); } } }
protected virtual void UpdateType(JSC.JSValue manifest) { this._manifest = manifest; string nv = null; int attr = 0; BitmapSource ni = null; if (_manifest != null && _manifest.ValueType == JSC.JSValueType.Object && _manifest.Value != null) { var vv = _manifest["editor"]; string tmp_s; if (vv.ValueType == JSC.JSValueType.String && !string.IsNullOrEmpty(tmp_s = vv.Value as string)) { nv = tmp_s; } var iv = _manifest["icon"]; if (iv.ValueType == JSC.JSValueType.String && !string.IsNullOrEmpty(tmp_s = iv.Value as string)) { ni = App.GetIcon(tmp_s); } JSC.JSValue js_attr; if ((js_attr = _manifest["attr"]).IsNumber) { attr = (int)js_attr; } } IsReadonly = (attr & 2) != 0; IsRequired = (attr & 1) != 0; if (nv == null) { nv = DTopic.JSV2Type(value); } if (ni == null) { if (value.ValueType == JSC.JSValueType.Object && value.Value == null) { ni = App.GetIcon((this is InTopic) ? string.Empty : "Null"); // Folder or Null } } if (ni == null) { ni = App.GetIcon(nv); } if (ni != icon) { icon = ni; PropertyChangedReise("icon"); } if (nv != _editorName) { _editorName = nv; editor = InspectorForm.GetEditor(_editorName, this, _manifest); PropertyChangedReise("editor"); } this.editor.TypeChanged(_manifest); }
private veEditor(InBase owner, JSC.JSValue manifest) { this._owner = owner; base.ItemsSource = InspectorForm.GetEditors(); base.IsEditable = false; base.BorderBrush = Brushes.Black; base.Padding = new System.Windows.Thickness(10, 0, 10, 0); base.MinWidth = 90; base.GotFocus += ve_GotFocus; ValueChanged(_owner.value); TypeChanged(manifest); base.SelectionChanged += ve_SelectionChanged; }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { try { var v = FindParent <GridViewRowPresenter>(this); _c2 = v.Columns[1]; _inspForm = FindParent <InspectorForm>(v); grJsEditor.Width = _c2.ActualWidth; v.LayoutUpdated += RowPresenter_LayoutUpdated; } catch (Exception) { } }
public uiWorkspace() { ContentId = "file://local/?view=wks"; Title = "Workspace"; InitializeComponent(); _content = new InspectorForm(null); ccWorkspace.Content = _content; foreach (var cl in App.Workspace.Clients) { _content.CollectionChange(new InTopic(cl.root, null, _content.CollectionChange), true); } App.Workspace.Clients.CollectionChanged += Clients_CollectionChanged; }
private void UpdateData(JSC.JSValue val) { bool o_hc = HasChildren; _value = val; if (_value.ValueType == JSC.JSValueType.Object) { InValue vc; int i; foreach (var kv in _value.OrderBy(z => z.Key)) { vc = _items.OfType <InValue>().FirstOrDefault(z => z.name == kv.Key); if (vc != null) { vc.UpdateData(kv.Value); } else { for (i = _items.Count - 1; i >= 0; i--) { if (string.Compare(_items[i].name, kv.Key) < 0) { break; } } JSC.JSValue cs; { JSC.JSValue pr; if (_manifest == null || (pr = _manifest["Fields"]).ValueType != JSC.JSValueType.Object || (cs = pr[kv.Key]).ValueType != JSC.JSValueType.Object) { cs = null; } } var ni = new InValue(_data, this, kv.Key, kv.Value, cs, _collFunc); _items.Insert(i + 1, ni); if (_isVisible && _isExpanded) { _collFunc(ni, true); } } } var keys = _value.Select(z => z.Key).ToArray(); for (i = _items.Count - 1; i >= 0; i--) { if (!keys.Contains(_items[i].name)) { if (_isVisible && _isExpanded) { _items[i].Deleted(); } _items.RemoveAt(i); } } } if (editor == null) { editor = InspectorForm.GetEditor(_editorName, this, _manifest); PropertyChangedReise("editor"); } else { editor.ValueChanged(_value); } if (o_hc != this.HasChildren) { PropertyChangedReise("HasChildren"); } }