本文整理汇总了C#中DomNode.Is方法的典型用法代码示例。如果您正苦于以下问题:C# DomNode.Is方法的具体用法?C# DomNode.Is怎么用?C# DomNode.Is使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DomNode
的用法示例。
在下文中一共展示了DomNode.Is方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteChildElementsRecursive
protected override void WriteChildElementsRecursive(DomNode node, XmlWriter writer)
{
// Filter out external template file references that should not be in-lined
if (node.Is<TemplateFolder>())
{
var pathUri = node.GetAttribute(Schema.templateFolderType.referenceFileAttribute) as Uri;
if (pathUri != null)
return;
}
base.WriteChildElementsRecursive(node, writer);
}
示例2: CreateCircuitControl
internal D2dAdaptableControl CreateCircuitControl(DomNode circuitNode)
{
var control = new D2dAdaptableControl();
control.SuspendLayout();
control.BackColor = SystemColors.ControlLight;
control.AllowDrop = true;
var transformAdapter = new TransformAdapter();
transformAdapter.EnforceConstraints = false; //to allow the canvas to be panned to view negative coordinates
transformAdapter.UniformScale = true;
transformAdapter.MinScale = new PointF(0.25f, 0.25f);
transformAdapter.MaxScale = new PointF(4, 4);
var viewingAdapter = new ViewingAdapter(transformAdapter);
viewingAdapter.MarginSize = new Size(25, 25);
var canvasAdapter = new CanvasAdapter();
((ILayoutConstraint)canvasAdapter).Enabled = false; //to allow negative coordinates for circuit elements within groups
var autoTranslateAdapter = new AutoTranslateAdapter(transformAdapter);
var mouseTransformManipulator = new MouseTransformManipulator(transformAdapter);
var mouseWheelManipulator = new MouseWheelManipulator(transformAdapter);
var scrollbarAdapter = new ScrollbarAdapter(transformAdapter, canvasAdapter);
var hoverAdapter = new HoverAdapter();
hoverAdapter.HoverStarted += control_HoverStarted;
hoverAdapter.HoverStopped += control_HoverStopped;
var annotationAdaptor = new D2dAnnotationAdapter(m_theme); // display annotations under diagram
var d2dRectangleDragSelector = new D2dRectangleDragSelector();
var d2dRectangleDragRenderer = new D2dRectangleDragRenderer(d2dRectangleDragSelector);
if (circuitNode.Is<Circuit>())
{
var circuitAdapter = new D2dGraphAdapter<Module, Connection, ICircuitPin>(m_circuitRenderer, transformAdapter);
// The "AllFirst" policy will try to draw edges (wires) before nodes, as much as possible.
//circuitAdapter.EdgeRenderPolicy = D2dGraphAdapter<Module, Connection, ICircuitPin>.DrawEdgePolicy.AllFirst;
var circuitModuleEditAdapter = new D2dGraphNodeEditAdapter<Module, Connection, ICircuitPin>(
m_circuitRenderer, circuitAdapter, transformAdapter);
circuitModuleEditAdapter.DraggingSubNodes = false;
var circuitConnectionEditAdapter =
new D2dGraphEdgeEditAdapter<Module, Connection, ICircuitPin>(m_circuitRenderer, circuitAdapter, transformAdapter);
circuitConnectionEditAdapter.EdgeRouteTraverser = CircuitUtil.EdgeRouteTraverser;
control.Adapt(
// This end of the list is drawn first and receives mouse events last.
hoverAdapter,
scrollbarAdapter,
autoTranslateAdapter,
d2dRectangleDragSelector, //Needs to be before annotationAdaptor, so that drag-and-selecting text works.
transformAdapter,
viewingAdapter,
canvasAdapter,
mouseTransformManipulator,
mouseWheelManipulator,
new KeyboardIOGraphNavigator<Module, Connection, ICircuitPin>(),
new D2dGridAdapter(),
annotationAdaptor, //Needs to be before circuitAdapter so that comments appear under elements.
circuitAdapter,
circuitModuleEditAdapter, //lets user move circuit elements on canvas
circuitConnectionEditAdapter,
new LabelEditAdapter(),
d2dRectangleDragRenderer,
new SelectionAdapter(),
new DragDropAdapter(m_statusService),
new ContextMenuAdapter(m_commandService, m_contextMenuCommandProviders)
// This end of the list is drawn last and receives mouse events first.
);
}
else if (circuitNode.Is<Group>())
{
var circuitAdapter = new D2dSubgraphAdapter<Module, Connection, ICircuitPin>(m_subGraphRenderer,
transformAdapter);
var circuitModuleEditAdapter = new D2dGraphNodeEditAdapter<Module, Connection, ICircuitPin>(
m_subGraphRenderer, circuitAdapter, transformAdapter);
circuitModuleEditAdapter.DraggingSubNodes = false;
var circuitConnectionEditAdapter =
new D2dGraphEdgeEditAdapter<Module, Connection, ICircuitPin>(m_subGraphRenderer, circuitAdapter, transformAdapter);
circuitConnectionEditAdapter.EdgeRouteTraverser = CircuitUtil.EdgeRouteTraverser;
var groupPinEditor = new GroupPinEditor(transformAdapter);
groupPinEditor.GetPinOffset = m_subGraphRenderer.GetPinOffset;
canvasAdapter.UpdateTranslateMinMax = groupPinEditor.UpdateTranslateMinMax;
control.Adapt(
// This end of the list is drawn first and receives mouse events last.
hoverAdapter,
scrollbarAdapter,
autoTranslateAdapter,
d2dRectangleDragSelector,
transformAdapter,
viewingAdapter,
canvasAdapter,
mouseTransformManipulator,
mouseWheelManipulator,
new KeyboardIOGraphNavigator<Module, Connection, ICircuitPin>(),
//.........这里部分代码省略.........
示例3: IsPrototypeItem
private static bool IsPrototypeItem(DomNode child, DomNode parent)
{
return
child.Is<PrototypeFolder>() ||
(parent != null && parent.Is<PrototypeFolder>());
}
示例4: ShowBreakpointConditionForm
private void ShowBreakpointConditionForm(DomNode domNode)
{
if (domNode == null)
return;
if (!domNode.Is<SledProjectFilesBreakpointType>())
return;
var bp =
domNode.As<SledProjectFilesBreakpointType>();
if (bp == null)
return;
ShowBreakpointConditionFormInternal(bp);
}
示例5: IsLayerItem
private static bool IsLayerItem(DomNode node)
{
return node.Is<ILayer>() || node.Is<IReference<IGameObject>>();
}
示例6: IsTemplateItem
private static bool IsTemplateItem(DomNode child, DomNode parent)
{
return
child.Is<TemplateFolder>() ||
(parent != null && parent.Is<TemplateFolder>());
}
示例7: GatherNodeTypes
private static void GatherNodeTypes(DomNode domNode, ICollection<SledProjectFilesFolderType> lstFolders)
{
if (domNode.Is<SledProjectFilesFolderType>())
lstFolders.Add(domNode.As<SledProjectFilesFolderType>());
foreach (var child in domNode.Children)
{
GatherNodeTypes(child, lstFolders);
}
}
示例8: CanReference
/// <summary>
/// Returns true iff the template can reference the specified target item</summary>
public override bool CanReference(DomNode item)
{
return item.Is<Module>();
}
示例9: IsLayerItem
private static bool IsLayerItem(DomNode node)
{
return node.Is<LayerFolder>() || node.Is<ElementRef>() || node.Is<Element>();
}
示例10: CreateCircuitControl
internal D2dAdaptableControl CreateCircuitControl(DomNode circuitNode)
{
var control = new D2dAdaptableControl();
control.SuspendLayout();
control.BackColor = SystemColors.ControlLight;
control.AllowDrop = true;
var transformAdapter = new TransformAdapter();
transformAdapter.EnforceConstraints = false; //to allow the canvas to be panned to view negative coordinates
transformAdapter.UniformScale = true;
transformAdapter.MinScale = new PointF(0.25f, 0.25f);
transformAdapter.MaxScale = new PointF(4, 4);
var viewingAdapter = new ViewingAdapter(transformAdapter);
viewingAdapter.MarginSize = new Size(25, 25);
var canvasAdapter = new CanvasAdapter();
((ILayoutConstraint) canvasAdapter).Enabled = false; //to allow negative coordinates for circuit elements within groups
var autoTranslateAdapter = new AutoTranslateAdapter(transformAdapter);
var mouseTransformManipulator = new MouseTransformManipulator(transformAdapter);
var mouseWheelManipulator = new MouseWheelManipulator(transformAdapter);
var scrollbarAdapter = new ScrollbarAdapter(transformAdapter, canvasAdapter);
var hoverAdapter = new HoverAdapter();
hoverAdapter.HoverStarted += control_HoverStarted;
hoverAdapter.HoverStopped += control_HoverStopped;
var annotationAdaptor = new D2dAnnotationAdapter(m_theme); // display annotations under diagram
if (circuitNode.Is<Circuit>())
{
var circuitAdapter = new D2dGraphAdapter<Module, Connection, ICircuitPin>(m_circuitRenderer, transformAdapter);
var circuitModuleEditAdapter = new D2dGraphNodeEditAdapter<Module, Connection, ICircuitPin>(
m_circuitRenderer, circuitAdapter, transformAdapter);
circuitModuleEditAdapter.DraggingSubNodes = false;
var circuitConnectionEditAdapter =
new D2dGraphEdgeEditAdapter<Module, Connection, ICircuitPin>(m_circuitRenderer, circuitAdapter, transformAdapter);
circuitConnectionEditAdapter.EdgeRouteTraverser = CircuitUtil.EdgeRouteTraverser;
control.Adapt(
hoverAdapter,
scrollbarAdapter,
autoTranslateAdapter,
new RectangleDragSelector(),
transformAdapter,
viewingAdapter,
canvasAdapter,
mouseTransformManipulator,
mouseWheelManipulator,
new KeyboardIOGraphNavigator<Module, Connection, ICircuitPin>(),
new D2dGridAdapter(),
annotationAdaptor,
circuitAdapter,
circuitModuleEditAdapter,
circuitConnectionEditAdapter,
new LabelEditAdapter(),
new SelectionAdapter(),
new DragDropAdapter(m_statusService),
new ContextMenuAdapter(m_commandService, m_contextMenuCommandProviders)
);
}
else if (circuitNode.Is<Group>())
{
var circuitAdapter = new D2dSubgraphAdapter<Module, Connection, ICircuitPin>(m_subGraphRenderer,
transformAdapter);
var circuitModuleEditAdapter = new D2dGraphNodeEditAdapter<Module, Connection, ICircuitPin>(
m_subGraphRenderer, circuitAdapter, transformAdapter);
circuitModuleEditAdapter.DraggingSubNodes = false;
var circuitConnectionEditAdapter =
new D2dGraphEdgeEditAdapter<Module, Connection, ICircuitPin>(m_subGraphRenderer, circuitAdapter, transformAdapter);
circuitConnectionEditAdapter.EdgeRouteTraverser = CircuitUtil.EdgeRouteTraverser;
var groupPinEditor = new GroupPinEditor(transformAdapter);
groupPinEditor.GetPinOffset = m_subGraphRenderer.GetPinOffset;
canvasAdapter.UpdateTranslateMinMax = groupPinEditor.UpdateTranslateMinMax;
control.Adapt(
hoverAdapter,
scrollbarAdapter,
autoTranslateAdapter,
new RectangleDragSelector(),
transformAdapter,
viewingAdapter,
canvasAdapter,
mouseTransformManipulator,
mouseWheelManipulator,
new KeyboardIOGraphNavigator<Module, Connection, ICircuitPin>(),
new D2dGridAdapter(),
annotationAdaptor,
circuitAdapter,
circuitModuleEditAdapter,
circuitConnectionEditAdapter,
new LabelEditAdapter(),
groupPinEditor,
new SelectionAdapter(),
new DragDropAdapter(m_statusService),
new ContextMenuAdapter(m_commandService, m_contextMenuCommandProviders)
);
//.........这里部分代码省略.........