示例#1
0
文件: cftype.go 项目: sqp/godock
// Value returns an interface to the key value.
//
// Before the build, the storage value will be used.
// After the build, the widget value will be used.
//
func (key *Key) Value() valuer.Valuer {
	if key.widgetValue != nil { // After the build.
		val := key.widgetValue()

		return valuer.New(&val) // Need better valuer.
	}
	return key.Storage().Valuer(key.Group, key.Name)
}
示例#2
0
文件: vstorage.go 项目: sqp/godock
// Valuer creates a valuer for the key matching group and name.
//
func (c *vcf) Valuer(group, name string) valuer.Valuer {
	c.testK(group, name)
	return valuer.New(c.list[group][name])
}