任何人都可以举例说明如何以编程方式将属性添加到Umbraco CMS中的现有文档类型中吗?这是我试过的:
var dt = DocumentType.GetByAlias("TestDocType");
dt.AddPropertyType(new DataTypeDefinition(-49),"testprop", "test prop");
Run Code Online (Sandbox Code Playgroud)
但它引发了一个例外:
Method not found: 'Void umbraco.cms.businesslogic.ContentType.AddPropertyType(umbraco.cms.businesslogic.datatype.DataTypeDefinition, System.String, System.String)'.
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我正在使用C和MPI.如果程序在同一台机器上的多个处理器上运行,如何为数组分配内存?该阵列是在所有参与任务之间共享还是每个任务都有自己的副本?
我创建了一个自定义行,旁边有一些文本.形状是一个子类System.Windows.Shapes.Shape.由于某种原因,当我更改线的坐标时,文本不会刷新.我知道这种InvalidateVisual()方法,但每次我移动元素时我都要调用它来重绘形状.我相信有更好的方法.我究竟做错了什么?ATM我没有想法.
public class MyShape : Shape
{
LineGeometry line;
FormattedText text;
public MyShape()
{
line = new LineGeometry();
text = new FormattedText(
Edge.Length.ToString(),
Thread.CurrentThread.CurrentCulture,
System.Windows.FlowDirection.LeftToRight,
new Typeface("Verdana"), 10, Brushes.Black);
}
// Specify the X1 dependency property:
public static readonly DependencyProperty X1Property =
DependencyProperty.Register("X1",
typeof(double), typeof(MyShape),
new FrameworkPropertyMetadata(0.0,
FrameworkPropertyMetadataOptions.AffectsMeasure));
public double X1
{
set { SetValue(X1Property, value); }
get { return (double)GetValue(X1Property); }
}
// Specify the Y1 dependency property:
public static readonly DependencyProperty Y1Property =
DependencyProperty.Register("Y1", …Run Code Online (Sandbox Code Playgroud)