/// <summary> /// 在内存管理中设置属性的值 /// </summary> /// <param name="item"></param> protected override void SetValue(IParatItem item) { ParatItem ipt = item as ParatItem; if (ipt.LinkIProperty != null) { manager.GetValue(ipt.LinkIProperty.Id).SetValue(ipt.LinkIProperty.Name, ipt.Value); } }
/// <summary> /// 获取属性的值 /// </summary> /// <param name="item"></param> /// <returns></returns> protected override object GetValue(IParatItem item) { ParatItem ipt = item as ParatItem; if (ipt.LinkIProperty != null) { return(manager.GetValue(ipt.LinkIProperty.Id).GetValue(ipt.LinkIProperty.Name)); } else { return(ipt.Value); } }
/// <summary> /// 设置数据源 /// </summary> /// <param name="ips"></param> public void SetOrigValues(ObservableCollection <IPropertyIt> ips, IParatItem ip) { propertyCombox.ItemsSource = ips; propertyCombox.DisplayMemberPath = "Name"; //output.DataContext = ip; //output.InitParatItemLayout(); this.DataContext = ip; paramter = ip as ParatItem; if (paramter.LinkIProperty != null) { this.isopen.IsChecked = true; } }
/// <summary> /// 设置数据源 /// </summary> /// <param name="fbs"></param> public void SetOrigValues(ObservableCollection <IPropertyIt> ips, IParatItem ip) { this.propertyCombox.ItemsSource = ips; this.propertyCombox.DisplayMemberPath = "Name"; if (ips.Count > 0) { propertyCombox.SelectedIndex = 0; } //input.DataContext = ip; //input.InitParatItemLayout(); this.DataContext = ip; paramter = ip as ParatItem; }
/// <summary> /// 获取左值 /// </summary> /// <param name="pi"></param> /// <param name="sm"></param> /// <returns></returns> protected static object getValue(ParatItem pi, ScriptObjectManager sm) { if (pi.LinkIParatItem == null) { return(pi.Value); } else { if (pi.LinkIParatItem.ParentItemBox.BoxType == ItemBoxEnum.GETFUNCTION) { object reo = null; ScriptOutput so = (pi.LinkIParatItem.ParentItemBox as ItemBox).DoScriptFunction(null); reo = so.GetValue(pi.LinkIParatItem.Name); so.Dispose(); so = null; return(reo); } else { return(sm.GetValue(pi.LinkIParatItem.ParentItemBox.Id).GetValue(pi.LinkIParatItem.Name)); } } }