public static string ElementToString(this DecoratorType decoratorType) { switch (decoratorType) { case DecoratorType.Debug: return("Debug"); case DecoratorType.ForceStatus: return("ForceStatus"); case DecoratorType.Invert: return("Invert"); case DecoratorType.Loop: return("Loop"); case DecoratorType.Retry: return("Retry"); case DecoratorType.TimeLimit: return("TimeLimit"); case DecoratorType.Wait_Seconds: return("Wait_Seconds"); case DecoratorType.Wait_Ticks: return("Wait_Ticks"); default: return("Unrecognized DeceratorType"); } }
public static void SAFE_DECOR_REGISTER(string propertyName, DecoratorType type) { if (DECOR_IS_REGISTERED_AS_TYPE(propertyName, type)) { return; } DECOR_REGISTER(propertyName, type); }
internal DecoratorGroupBlockBase(BinaryReader binaryReader) { this.decoratorSet = binaryReader.ReadByteBlockIndex1(); this.decoratorType = (DecoratorType)binaryReader.ReadByte(); this.shaderIndex = binaryReader.ReadByte(); this.compressedRadius = binaryReader.ReadByte(); this.cluster = binaryReader.ReadInt16(); this.cacheBlock = binaryReader.ReadShortBlockIndex1(); this.decoratorStartIndex = binaryReader.ReadInt16(); this.decoratorCount = binaryReader.ReadInt16(); this.vertexStartOffset = binaryReader.ReadInt16(); this.vertexCount = binaryReader.ReadInt16(); this.indexStartOffset = binaryReader.ReadInt16(); this.indexCount = binaryReader.ReadInt16(); this.compressedBoundingCenter = binaryReader.ReadInt32(); }
public static BaseDecorator Decorate(this IBatchProcess component, DecoratorType decorator) { switch (decorator) { case DecoratorType.FileDownload: return(ActivatorUtilities.CreateInstance(Startup.ServiceProvider , typeof(FileDownloadDecorator), new object[] { component , Startup.ServiceProvider.GetService <IOptions <FTPConfigModel> >() , Startup.ServiceProvider.GetService <IHostEnvironment>() }) as BaseDecorator); case DecoratorType.ExecuteSP: return(ActivatorUtilities.CreateInstance(Startup.ServiceProvider , typeof(ExecuteSPDecorator), new object[] { component , Startup.ServiceProvider.GetService <IConfiguration>() }) as BaseDecorator); case DecoratorType.FileUpload: return(ActivatorUtilities.CreateInstance(Startup.ServiceProvider , typeof(FileUploadDecorator), new object[] { component , Startup.ServiceProvider.GetService <IOptions <FTPConfigModel> >() , Startup.ServiceProvider.GetService <IConfiguration>() , Startup.ServiceProvider.GetService <IHostEnvironment>() }) as BaseDecorator); default: return(ActivatorUtilities.CreateInstance(Startup.ServiceProvider , typeof(FileDownloadDecorator), new object[] { component , Startup.ServiceProvider.GetService <IOptions <FTPConfigModel> >() , Startup.ServiceProvider.GetService <IHostEnvironment>() }) as BaseDecorator); } }
public void ReadXml(XmlReader reader) { reader.ReadStartElement("Decorator"); reader.ReadStartElement("Child"); string typeName = reader.ReadString(); if (!typeName.Equals("NULL")) { Type type = System.Type.GetType(typeName); _child = (INode)Activator.CreateInstance(type); _child.SetParent(this); _child.ReadXml(reader); } reader.ReadEndElement(); reader.ReadStartElement("DecoratorType"); string decoType = reader.ReadString(); Type = (DecoratorType)Enum.Parse(typeof(DecoratorType), decoType); reader.ReadEndElement(); reader.ReadEndElement(); }
private void DrawDecorator(Decorator decorator) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Decorator", BehaviorTreeEditorSettings.Instance.DecoratorLabelStyle); DrawRemoveChildOption(decorator); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginVertical(); GUILayout.FlexibleSpace(); if (decorator.Child == null) { DrawAddChildOption(decorator); } else { int selected = _decorators.IndexOf(decorator.Type.ToString()); int newSelected = EditorGUILayout.Popup(selected, _decorators.ToArray()); if (newSelected != selected && newSelected >= 0 && newSelected < _decorators.Count) { DecoratorType newDT = (DecoratorType)Enum.Parse(typeof(DecoratorType), _decorators[newSelected]); decorator.Type = newDT; } } EditorGUILayout.EndVertical(); }
private void ButtonTouch(object sender, EventArgs e) { ImageButtonView view = sender as ImageButtonView; view.ButtonSelected = true; switch (view.ImageId) { case "mindmapconttree.png": simpleCurveTree = "contCurveTree"; SfGraphicsPath path = new SfGraphicsPath(); path.MoveTo(0, 0); path.MoveTo(0, 50); path.LineTo(100, 50); path.MoveTo(100, 100); gra.DrawPath(path); Pen pe = new Pen(); pe.StrokeBrush = new SolidBrush(Color.ParseColor("#949494")); pe.StrokeWidth = 5; point.Add(new Point(0, 50)); point.Add(new Point(100, 50)); gra.DrawLines(pe, point); objShape1 = ShapeType.Ellipse; objShape2 = gra; objShape3 = gra; objShape4 = gra; objShape5 = gra; segment = SegmentType.CurveSegment; TextStyleVerticalAlignment = VerticalAlignment.Top; Dectype = DecoratorType.None; connColor = Color.Black; connLineApplyColorFrom = ApplyColorFrom.TargetBorder; connDecApplyColorFrom = ApplyColorFrom.TargetBorder; break; case "mindmapDefault.png": simpleCurveTree = "default"; objShape1 = ShapeType.RoundedRectangle; objShape2 = ShapeType.RoundedRectangle; objShape3 = ShapeType.RoundedRectangle; objShape4 = ShapeType.RoundedRectangle; objShape5 = ShapeType.RoundedRectangle; segment = SegmentType.CurveSegment; TextStyleVerticalAlignment = VerticalAlignment.Center; Dectype = DecoratorType.None; connColor = Color.Black; connLineApplyColorFrom = ApplyColorFrom.TargetBorder; connDecApplyColorFrom = ApplyColorFrom.TargetBorder; break; case "mindmaportho.png": simpleCurveTree = "orthotree"; objShape1 = ShapeType.Rectangle; objShape2 = ShapeType.Rectangle; objShape3 = ShapeType.Rectangle; objShape4 = ShapeType.Rectangle; objShape5 = ShapeType.Rectangle; segment = SegmentType.OrthoSegment; TextStyleVerticalAlignment = VerticalAlignment.Center; Dectype = DecoratorType.None; connColor = Color.Black; connLineApplyColorFrom = ApplyColorFrom.TargetBorder; connDecApplyColorFrom = ApplyColorFrom.TargetBorder; break; case "mindmapsimpletree.png": simpleCurveTree = "simpleCurveTree"; objShape1 = ShapeType.RoundedRectangle; objShape2 = ShapeType.RoundedRectangle; objShape3 = ShapeType.RoundedRectangle; objShape4 = ShapeType.RoundedRectangle; objShape5 = ShapeType.RoundedRectangle; segment = SegmentType.CurveSegment; TextStyleVerticalAlignment = VerticalAlignment.Center; Dectype = DecoratorType.None; connColor = Color.ParseColor("#949494"); connLineApplyColorFrom = ApplyColorFrom.Custom; connDecApplyColorFrom = ApplyColorFrom.Custom; break; } UpdateTheme(); for (int i = 0; i < scrollLayout.ChildCount; i++) { ImageButtonView childView = (ImageButtonView)scrollLayout.GetChildAt(i); if (childView.ImageId == view.ImageId) { continue; } childView.ButtonSelected = false; } }
Connector DrawConnector(Node Src, Node Trgt, Port srcport, Port trgtport, SegmentType type, Color strokeColor, StrokeStyle style, DecoratorType decorator, Color fillColor, Color strokeFill, float sw) { var Conn = new Connector(m_context, Src, Trgt); Conn.SourcePort = srcport; Conn.TargetPort = trgtport; Conn.SegmentType = type; Conn.TargetDecoratorType = decorator; Conn.TargetDecoratorStyle.Fill = fillColor; Conn.TargetDecoratorStyle.StrokeColor = strokeFill; Conn.Style.StrokeWidth = 1 * 2 * MainActivity.factor; Conn.Style.StrokeBrush = new SolidBrush(strokeColor); Conn.Style.StrokeStyle = style; Conn.TargetDecoratorStyle.Size = sw; Conn.TargetDecoratorStyle.StrokeWidth = 2 * 2 * MainActivity.factor; return(Conn); }
public DecoratorGroupBlock(BinaryReader binaryReader) { this.decoratorSet = binaryReader.ReadByteBlockIndex1(); this.decoratorType = (DecoratorType)binaryReader.ReadByte(); this.shaderIndex = binaryReader.ReadByte(); this.compressedRadius = binaryReader.ReadByte(); this.cluster = binaryReader.ReadInt16(); this.cacheBlock = binaryReader.ReadShortBlockIndex1(); this.decoratorStartIndex = binaryReader.ReadInt16(); this.decoratorCount = binaryReader.ReadInt16(); this.vertexStartOffset = binaryReader.ReadInt16(); this.vertexCount = binaryReader.ReadInt16(); this.indexStartOffset = binaryReader.ReadInt16(); this.indexCount = binaryReader.ReadInt16(); this.compressedBoundingCenter = binaryReader.ReadInt32(); }
Connector DrawConnector(Node Src, Node Trgt, Port srcport, Port trgtport, SegmentType type, Color strokeColor, StrokeStyle style, DecoratorType decorator, Color fillColor, Color strokeFill, float sw) { var Conn = new Connector(); Conn.SourceNode = Src; Conn.TargetNode = Trgt; Conn.SourcePort = srcport; Conn.TargetPort = trgtport; Conn.SegmentType = type; Conn.TargetDecoratorType = decorator; Conn.TargetDecoratorStyle.Fill = fillColor; Conn.TargetDecoratorStyle.Stroke = strokeFill; Conn.Style.StrokeWidth = 1 * DiagramUtility.factor; Conn.Style.StrokeBrush = new SolidBrush(strokeColor); Conn.Style.StrokeStyle = style; Conn.TargetDecoratorStyle.Width = sw * DiagramUtility.factor; Conn.TargetDecoratorStyle.StrokeThickness = 1 * DiagramUtility.factor; return(Conn); }
public static bool DECOR_IS_REGISTERED_AS_TYPE(string propertyName, DecoratorType type) { return(Function.Call <bool>(Hash.DECOR_IS_REGISTERED_AS_TYPE, propertyName, (int)type)); }
public static void DECOR_REGISTER(string propertyName, DecoratorType type) { Function.Call(Hash.DECOR_REGISTER, propertyName, (int)type); }