private void LoadModel() { //Hide elements during an action Component.Instance.HideActions = true; //Get a stencil containing some basic shapes BasicStencil stencil = (BasicStencil)Component.Instance.GetStencil(typeof(BasicStencil)); //Set up "prospect" Shape shape = new Shape(stencil[BasicStencilType.Circle]); shape.Size = new Size(70, 70); shape.Label = new TextLabel("Prospect"); shape.GradientColor = Color.Brown; shape.BorderColor = Color.Brown; shape.BorderWidth = 2; shape.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; shape.Visible = false; shape.Animation = new SalesAnimation(12); model1.Shapes.Add("Prospect", shape); //Set up "Qualify", using previous shape as a prototype shape = new Shape(shape); shape.Label = new TextLabel("Qualify"); shape.GradientColor = Color.Red; shape.BorderColor = Color.Red; shape.Animation = new SalesAnimation(24); model1.Shapes.Add("Qualify", shape); //Set up "Propose", using previous shape as a prototype shape = new Shape(shape); shape.Label = new TextLabel("Propose"); shape.GradientColor = Color.Purple; shape.BorderColor = Color.Purple; shape.Animation = new SalesAnimation(36); model1.Shapes.Add("Propose", shape); //Set up "Pilot", using previous shape as a prototype shape = new Shape(shape); shape.Label = new TextLabel("Pilot"); shape.GradientColor = Color.Blue; shape.BorderColor = Color.Blue; shape.Animation = new SalesAnimation(48); model1.Shapes.Add("Pilot", shape); //Set up "Close", using previous shape as a prototype shape = new Shape(shape); shape.Label = new TextLabel("Close"); shape.GradientColor = Color.GreenYellow; shape.BorderColor = Color.GreenYellow; shape.Animation = new SalesAnimation(60); model1.Shapes.Add("Green", shape); //Set up "Deploy", using previous shape as a prototype shape = new Shape(shape); shape.Label = new TextLabel("Deploy"); shape.GradientColor = Color.Orange; shape.BorderColor = Color.Orange; shape.Animation = new SalesAnimation(72); model1.Shapes.Add("Deploy", shape); //Add the arrow ArrowStencil stencil2 = (ArrowStencil)Component.Instance.GetStencil(typeof(ArrowStencil)); Shape arrow = new Shape(stencil2[ArrowStencilType.Left]); arrow.Size = new Size(30, 18); arrow.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; arrow.BorderWidth = 2; arrow.Visible = false; arrow.DrawBackground = false; arrow.Animation = new ArrowAnimation(); model1.Shapes.Add("Arrow", arrow); //Begin Animation model1.Animator.AnimatorStart += new EventHandler(Animator_AnimatorStart); model1.Animator.AnimatorPause += new EventHandler(Animator_AnimatorPause); model1.Animator.AnimatorEnd += new EventHandler(Animator_AnimatorEnd); model1.Animator.FinalTick = 84; model1.Animator.Start(); }
// // CONSTRUCTOR // public EsriShape(T parent) : base() { this._parent = parent; // this.SuspendEvents = true; // Get a stencil containing some basic shapes BasicStencil stencil = (BasicStencil)Crainiate.ERM4.Component.Instance.GetStencil(typeof(BasicStencil)); this.BorderWidth = 2f; this.Size = new Size(100, 40); this.SmoothingMode = SmoothingMode.HighQuality; this.StencilItem = stencil[BasicStencilType.RoundedRectangle]; this.Label = new TextLabel(); this.Label.Color = ModelSettings.Default.TextColor; if (typeof(T) == typeof(DomainCodedValue)) { DomainCodedValue domainCodedValue = this._parent as DomainCodedValue; this.BorderColor = ColorSettings.Default.CodedValueDomainColor; this.GradientColor = ColorSettings.Default.CodedValueDomainColor; this.Label.Text = domainCodedValue.Name; this.Tooltip = domainCodedValue.Name; } else if (typeof(T) == typeof(DomainRange)) { DomainRange domainRange = this._parent as DomainRange; this.BorderColor = ColorSettings.Default.RangeDomainColor; this.GradientColor = ColorSettings.Default.RangeDomainColor; this.Label.Text = domainRange.Name; this.Tooltip = domainRange.Name; } else if (typeof(T) == typeof(FeatureClass)) { FeatureClass featureClass = this._parent as FeatureClass; this.BorderColor = ColorSettings.Default.FeatureClassColor; this.GradientColor = ColorSettings.Default.FeatureClassColor; this.Label.Text = featureClass.Name; this.Tooltip = featureClass.Name; } else if (typeof(T) == typeof(ObjectClass)) { ObjectClass objectClass = this._parent as ObjectClass; this.BorderColor = ColorSettings.Default.ObjectClassColor; this.GradientColor = ColorSettings.Default.ObjectClassColor; this.Label.Text = objectClass.Name; this.Tooltip = objectClass.Name; } else if (typeof(T) == typeof(RelationshipClass)) { RelationshipClass relationship = this._parent as RelationshipClass; this.BorderColor = ColorSettings.Default.RelationshipColor; this.GradientColor = ColorSettings.Default.RelationshipColor; this.Label.Text = relationship.Name; this.Tooltip = relationship.Name; } else if (typeof(T) == typeof(Subtype)) { Subtype subtype = this._parent as Subtype; this.BorderColor = ColorSettings.Default.SubtypeColor; this.GradientColor = ColorSettings.Default.SubtypeColor; this.Label.Text = subtype.SubtypeName; this.Tooltip = subtype.SubtypeName; } else if (typeof(T) == typeof(Field)) { Field field = this._parent as Field; this.BorderColor = ColorSettings.Default.FieldColor; this.GradientColor = ColorSettings.Default.FieldColor; this.Label.Text = field.Name; this.Tooltip = field.Name; } else if (typeof(T) == typeof(SubtypeField)) { SubtypeField subtypeField = this._parent as SubtypeField; this.BorderColor = ColorSettings.Default.SubtypeFieldColor; this.GradientColor = ColorSettings.Default.SubtypeFieldColor; this.Label.Text = subtypeField.FieldName; this.Tooltip = subtypeField.FieldName; } else if (typeof(T) == typeof(FeatureDataset)) { FeatureDataset featureDataset = this._parent as FeatureDataset; this.BorderColor = ColorSettings.Default.FeatureDatasetColor; this.GradientColor = ColorSettings.Default.FeatureDatasetColor; this.Label.Text = featureDataset.Name; this.Tooltip = featureDataset.Name; } else if (typeof(T) == typeof(GeometricNetwork)) { GeometricNetwork geometricNetwork = this._parent as GeometricNetwork; this.BorderColor = ColorSettings.Default.GeometricNetworkColor; this.GradientColor = ColorSettings.Default.GeometricNetworkColor; this.Label.Text = geometricNetwork.Name; this.Tooltip = geometricNetwork.Name; } else if (typeof(T) == typeof(Network)) { Network network = this._parent as Network; this.BorderColor = ColorSettings.Default.NetworkColor; this.GradientColor = ColorSettings.Default.NetworkColor; this.Label.Text = network.Name; this.Tooltip = network.Name; } else if (typeof(T) == typeof(Topology)) { Topology topology = this._parent as Topology; this.BorderColor = ColorSettings.Default.TopologyColor; this.GradientColor = ColorSettings.Default.TopologyColor; this.Label.Text = topology.Name; this.Tooltip = topology.Name; } else if (typeof(T) == typeof(Terrain)) { Terrain terrain = this._parent as Terrain; this.BorderColor = ColorSettings.Default.TerrainColor; this.GradientColor = ColorSettings.Default.TerrainColor; this.Label.Text = terrain.Name; this.Tooltip = terrain.Name; } // this.SuspendEvents = false; }