private void Init() { m_leftConnector = new Connector(this, "Left", true); Connectors.Add(m_leftConnector); m_yesConnector = new Connector(this, "Yes", true); m_yesConnector.AllowNewConnectionsTo = false; Connectors.Add(m_yesConnector); m_noConnector = new Connector(this, "No", true); m_noConnector.AllowNewConnectionsTo = false; Connectors.Add(m_noConnector); }
/// <summary> /// Deletes all connectors attached to this PortModel. /// </summary> internal void DestroyConnectors() { if (Owner == null) { return; } while (Connectors.Any()) { ConnectorModel connector = Connectors[0]; connector.Delete(); } }
public void CreateModel(XmlElement modelData) { XmlElementHelper helper = new XmlElementHelper(modelData); string typeName = helper.ReadString("type", String.Empty); if (string.IsNullOrEmpty(typeName)) { // If there wasn't a "type" attribute, then we fall-back onto // the name of the XmlElement itself, which is usually the type // name. typeName = modelData.Name; if (string.IsNullOrEmpty(typeName)) { string guid = helper.ReadString("guid"); throw new InvalidOperationException( string.Format("No type information: {0}", guid)); } } #if USE_DSENGINE if (typeName.Equals("Dynamo.Nodes.DSFunction") || typeName.Equals("Dynamo.Nodes.DSVarArgFunction")) { // For DSFunction and DSVarArgFunction node types, the type name // is actually embedded within "name" attribute (for an example, // "UV.ByCoordinates@double,double"). // typeName = modelData.Attributes["name"].Value; } #endif if (typeName.StartsWith("Dynamo.Models.ConnectorModel")) { ConnectorModel connector = ConnectorModel.Make(); connector.Deserialize(modelData, SaveContext.Undo); Connectors.Add(connector); } else if (typeName.StartsWith("Dynamo.Models.NoteModel")) { NoteModel noteModel = new NoteModel(0.0, 0.0); noteModel.Deserialize(modelData, SaveContext.Undo); Notes.Add(noteModel); } else // Other node types. { NodeModel nodeModel = DynamoModel.CreateNodeInstance(typeName); nodeModel.WorkSpace = this; nodeModel.Deserialize(modelData, SaveContext.Undo); Nodes.Add(nodeModel); } }
/// <summary> /// Deletes all connectors attached to this PortModel. /// </summary> public void DestroyConnectors() { if (Owner == null) { return; } while (Connectors.Any()) { ConnectorModel connector = Connectors[0]; Owner.WorkSpace.Connectors.Remove(connector); connector.NotifyConnectedPortsOfDeletion(); } }
/// <summary> /// the ctor /// </summary> public BitPlotter() : base() { Rectangle = new RectangleF(0, 0, 100, 112); IsResizable = false; inConnector = new Connector(this, "In bits", false); inConnector.ConnectorLocation = ConnectorLocation.West; Connectors.Add(inConnector); RGBColor = new Connector(this, "RGB Color", false); RGBColor.ConnectorLocation = ConnectorLocation.West; Connectors.Add(RGBColor); InitEntity(); }
public void AddPrimitives(IEnumerable <Drawable> primitives) { var enumerable = primitives as Drawable[] ?? primitives.ToArray(); _primitives.AddRange(enumerable.Where(p => !(p is Connector))); Connectors.AddRange(enumerable.Where(p => p is Connector).Cast <Connector>().Where(c => c.Center.Y < 1).ToList()); var j = Join.FirstOrDefault(s => s.Position.X == Position.X && s.Position.Y == Position.Y + 1); if (j != null) { j.Connectors.AddRange(enumerable.Where(p => p is Connector).Cast <Connector>().Where(c => c.Center.Y >= 1).ToList()); } }
protected IfShape(SerializationInfo info, StreamingContext context) : base(info, context) { m_leftConnector = (Connector)info.GetValue("m_leftConnector", typeof(Connector)); m_leftConnector.BelongsTo = this; Connectors.Add(m_leftConnector); m_yesConnector = (Connector)info.GetValue("m_yesConnector", typeof(Connector)); m_yesConnector.BelongsTo = this; Connectors.Add(m_yesConnector); m_noConnector = (Connector)info.GetValue("m_noConnector", typeof(Connector)); m_noConnector.BelongsTo = this; Connectors.Add(m_noConnector); }
protected void EnableTransitionTriggers() { if (IsLive) { return; } IsLive = true; base.EnableConnectors(); foreach (var transition in Connectors.OfType <UmlTransition>()) { transition.EnableTriggers(); } }
private void Delete() { if (SelectedObject is Connector) { Connectors.Remove(SelectedObject as Connector); } if (SelectedObject is Node) { var node = SelectedObject as Node; //Connectors.Where(x => x.Start == node || x.End == node).ToList().ForEach(x => Connectors.Remove(x)); Nodes.Remove(node); } }
public TaskEvent() { mTitle = "Task"; mSubtitle = "Here you can set a sub-title."; mObservation = "Observation text" + Environment.NewLine + "..."; Rectangle = new RectangleF(0, 0, 200, 100); mCentralConnector = new Connector(this, "", true); mCentralConnector.ConnectorLocation = ConnectorLocation.North; Connectors.Add(mCentralConnector); mCollapsed = true; IsResizable = false; this.OnMouseUp += new MouseEventHandler(TaskEvent_OnMouseUp); }
public override void onAddConnector(Connector connector, Client client) { APlay.Common.Logging.Logger.LogDesigned(2, "Sheet.onAddConnector called", "AplayTest.Server.Sheet"); connector.Sheet = this; _undoService.StartTransaction(client.Id, "Add connector [" + connector.Id + "]"); var connectorUndoable = new ConnectorUndoable(connector); _undoService.AddInsert(Id, connectorUndoable, Connections.Count, "Adding connector [" + connectorUndoable.Id + "]", client.Id); Connectors.Add(connector); _undoService.EndTransaction(client.Id); }
private string GetInterNameById(int idx) { string name = string.Empty; foreach (ValueType item in this.connList) { Connectors connItem = (Connectors)item; if (connItem.Idx == idx) { name = connItem.Name; break; } } return(name); }
/// <summary> /// Deserialization constructor /// </summary> /// <param name="info"></param> /// <param name="context"></param> protected ShowValue(SerializationInfo info, StreamingContext context) : base(info, context) { inConnector = (Connector)info.GetValue("inConnector", typeof(Connector)); inConnector.BelongsTo = this; Connectors.Add(inConnector); visualization = (VisualizationTypes)info.GetValue("visualization", typeof(VisualizationTypes)); //Trace.WriteLine("Visualization is " + visualization.ToString()); displayLength = info.GetInt32("displayLength"); //Trace.WriteLine("display length: " + DisplayLength); this.displayValues = new ArrayList(); //Trace.WriteLine("displayValues initialized: " + displayValues!=null? "ok" : "nok"); }
private void Init(bool resizable) { Rectangle = new RectangleF(0, 0, 70, 50); TopNode = new Connector(this, "Top", true); TopNode.ConnectorLocation = ConnectorLocations.North; Connectors.Add(TopNode); BottomNode = new Connector(this, "Bottom", true); BottomNode.ConnectorLocation = ConnectorLocations.South; Connectors.Add(BottomNode); Resizable = resizable; recalculateSize = true; }
public override ushort[] GetProgramBin() { var bindata = new ushort[this.BinSize]; bindata[0] = 11 + 0x0100; var output = Connectors.First(c => c.Orientation == ConnectorOrientation.RIGHT); bindata[1] = (ushort)output.ConnectionNumber; var inputs = Connectors.Where(c => c.Orientation == ConnectorOrientation.LEFT).ToList(); bindata[2] = (ushort)inputs[1].ConnectionNumber; bindata[3] = (ushort)inputs[0].ConnectionNumber; bindata[4] = 0; return(bindata); }
public Element CreateElement(Type type, int x, int y) { if (type.BaseType.Name == "Element") { if (type.Name == "ResistorX" && Connectors.Count(i => i is ResistorX) > 0) { throw new ResistorXPlacedException(); } var element = Activator.CreateInstance(type) as Element; //создание элемента Node pina = new Node(); //создание пинов Node pinb = new Node(); if (type.Name == "Reohord") //реохорд { Node pinc = new Node(); Reohord reohord = element as Reohord; reohord.ResistorAC = new NoDrawConnector() { Resistance = 100 }; //создание соединителей reohord.ResistorBC = new NoDrawConnector(); ConnectNodes(pina, pinc, reohord.ResistorAC); //соединение пинов при помощи коннекторов ConnectNodes(pinb, pinc, reohord.ResistorBC); reohord.LengthAC = 50; reohord.NodeA = pina; //привязка ножек к нодам reohord.NodeB = pinb; reohord.NodeC = pinc; Nodes.Add(reohord.NodeC); //отрисовка нода C ConnectorsToDraw.Add(element); //отрисовка реохорда } else { ConnectNodes(pina, pinb, element); //соединение пинов при помощи элемента } Nodes.Add(element.NodeA); //отрисовка нодов Nodes.Add(element.NodeB); element.X = x; //перемещение по координатам (учитывая обновление свойств X и Y у пинов) element.Y = y; return(element); } return(null); }
/// <summary> /// Deserialization constructor /// </summary> /// <param name="info"></param> /// <param name="context"></param> protected AffineTransformation(SerializationInfo info, StreamingContext context) : base(info, context) { outConnector = (Connector)info.GetValue("outConnector", typeof(Connector)); outConnector.BelongsTo = this; Connectors.Add(outConnector); inConnector = (Connector)info.GetValue("inConnector", typeof(Connector)); inConnector.BelongsTo = this; Connectors.Add(inConnector); outputType = (AutomataDataType)info.GetValue("outputType", typeof(AutomataDataType)); shiftValue = info.GetInt32("shiftValue"); scalingValue = info.GetInt32("scalingValue"); }
private void Init() { mClassName = "Class"; mSubtitle = ""; mBody = ""; Rectangle = new RectangleF(0, 0, 200, 100); mTopConnector = new Connector(this, "Top", true); mTopConnector.ConnectorLocation = ConnectorLocation.North; mBottomConnector = new Connector(this, "Bottom", true); mBottomConnector.ConnectorLocation = ConnectorLocation.South; Connectors.Add(mBottomConnector); Connectors.Add(mTopConnector); IsResizable = false; boldFont = new Font(Font, FontStyle.Bold); this.OnMouseUp += new MouseEventHandler(TaskEvent_OnMouseUp); }
private void Init() { m_leftConnector = new Connector(this, "Left", true); Connectors.Add(m_leftConnector); Connector t_connector = null; for (int i = 0; i < m_switchCount; i++) { t_connector = new Connector(this, i.ToString(), true); t_connector.AllowNewConnectionsTo = false; m_switchConnectors.Add(t_connector); } Connectors.AddRange(m_switchConnectors); }
protected SwitchShape(SerializationInfo info, StreamingContext context) : base(info, context) { m_switchCount = info.GetInt32("m_switchCount"); m_leftConnector = (Connector)info.GetValue("m_leftConnector", typeof(Connector)); m_leftConnector.BelongsTo = this; Connectors.Add(m_leftConnector); m_switchConnectors = (ConnectorCollection)info.GetValue("m_switchConnectors", typeof(ConnectorCollection)); foreach (Connector connector in m_switchConnectors) { connector.BelongsTo = this; Connectors.Add(connector); } }
/// <summary> /// Disables the triggers of all outgoing transitions. /// </summary> internal override void DisableConnectors() { if (DoBehavior is ISubmachineBehavior) { SubscribeToDoSubmachine(false); } else if (IsLive) { IsLive = false; base.DisableConnectors(); foreach (var connector in Connectors.OfType <UmlTransition>()) { connector.DisableTriggers(); } } }
protected BlockShape(SerializationInfo info, StreamingContext context) : base(info, context) { m_leftConnector = (Connector)info.GetValue("m_leftConnector", typeof(Connector)); m_leftConnector.BelongsTo = this; Connectors.Add(m_leftConnector); try { this.URL = string.Empty; this.URL = info.GetString("m_linkedLayer"); } catch (Exception) { } BindingEventHandler(); }
private Node.Node SetAtomRelationsFromRPN(string rulesRPN) { var stack = new Stack <Node.Node>(); foreach (var ruleRPN in rulesRPN) { if (!Operators.Contains(ruleRPN)) { stack.Push(Atoms[ruleRPN]); } else if (ruleRPN == '!') { stack.Push(new NegativeNode(stack.Pop())); } else { ConnectorNode newConnector; var atom1 = stack.Pop(); var atom2 = stack.Pop(); if (atom1.GetType() == typeof(ConnectorNode) && ((ConnectorNode)atom1).Type == ListOperations[ruleRPN]) { ((ConnectorNode)atom1).AddOperand(atom2); newConnector = (ConnectorNode)atom1; Connectors.Pop(); } else if (atom2.GetType() == typeof(ConnectorNode) && ((ConnectorNode)atom2).Type == ListOperations[ruleRPN]) { ((ConnectorNode)atom2).AddOperand(atom1); newConnector = (ConnectorNode)atom2; Connectors.Pop(); } else { newConnector = new ConnectorNode(ListOperations[ruleRPN]); newConnector.AddOperands(new[] { atom1, atom2 }); } Connectors.Push(newConnector); stack.Push(newConnector); } } return(stack.Pop()); }
private void Random_Click(object sender, RoutedEventArgs e) { Connectors.Clear(); var random = new Random(); Enumerable.Range(500, random.Next(600, 1000)) .Select(x => new DataItemConnector() { Start = Items1[random.Next(0, 999)], End = Items2[random.Next(0, 999)] }) .ToList() .ForEach(Connectors.Add); scrollviewer_ScrollChanged(null, null); }
public void SuggestAlternativeWordTests() { _smartTextBox = new SmartTextBoxImpl(); Connectors conn = new Connectors(); _text = "בנוסף"; List <string> AddingConnectors = new List <string> { "ו", "בנוסף", "ורק", "גם", "וכן" }; //מילות קישור הוספה וצירוף string suggestedWord = _smartTextBox.SuggestAlternativeWord(_text); //בודק גם שבחרנו מסוג מילת הקישור הנכונה, גם שלא הצענו אותה במקום עצמה Assert.IsTrue(conn.Contains(_text)); Assert.IsTrue(AddingConnectors.Contains(_text)); Assert.IsTrue(AddingConnectors.Contains(suggestedWord)); Assert.IsTrue(suggestedWord != _text); }
public static Task <HttpResponseMessage> UpdateConnectorAsync( [Property] Guid id, [Property(Name = EastFive.Api.Resources.Connector.SourcePropertyName)] Guid source, [PropertyOptional(Name = EastFive.Api.Resources.Connector.DestinationPropertyName)] Guid?destination, [Property(Name = EastFive.Api.Resources.Connector.FlowPropertyName)] Connector.SynchronizationMethod Flow, Security security, Context context, HttpRequestMessage request, UrlHelper url, NoContentResponse onUpdated, NotFoundResponse onNotFound, UnauthorizedResponse onUnauthorized, GeneralConflictResponse onFailure) { return(Connectors.UpdateConnectorAsync(id, Flow, security.performingAsActorId, security.claims, () => onUpdated(), () => onNotFound(), (why) => onFailure(why))); }
public SignalShape(IModel model, CommandReference reference, IFlyweightShape <SignalShape> fly) : base(model) { this.sysRef = reference; outConnector = new YttriumConnector(Model, ConnectorType.SignalOutputConnector); outConnector.Name = "Output"; outConnector.Parent = this; Connectors.Add(outConnector); inConnector = new YttriumConnector(Model, ConnectorType.SignalInputConnector); inConnector.Name = "Input"; inConnector.Parent = this; Connectors.Add(inConnector); AssignFly(fly); }
protected internal virtual void ensureConnectorInitialized() { if (connectorInstance == null) { lock (this) { if (connectorInstance == null) { connectorInstance = Connectors.getConnector(connectorId); if (connectorInstance == null) { throw new ConnectorException("No connector found for connector id '" + connectorId + "'"); } } } } }
void ModuleProgramInit() { wicoThrusters = new WicoThrusters(this, wicoBlockMaster); wicoGyros = new WicoGyros(this, wicoBlockMaster); wicoGasTanks = new GasTanks(this, wicoBlockMaster); wicoGasGens = new GasGens(this); wicoConnectors = new Connectors(this); wicoCameras = new Cameras(this); wicoAntennas = new Antennas(this); wicoSensors = new Sensors(this, wicoBlockMaster); wicoPower = new PowerProduction(this, wicoBlockMaster); wicoTimers = new Timers(this, wicoBlockMaster); // navRemote = new NavRemote(this); navCommon = new NavCommon(this); _sensors = new Sensors(this, wicoBlockMaster); _drills = new Drills(this, wicoBlockMaster); _displays = new Displays(this, wicoBlockMaster, wicoElapsedTime); Echo("_displays"); _cargoCheck = new CargoCheck(this, wicoBlockMaster, _displays); Echo("_cargoCheck"); _dock = new DockBase(this); Echo("_dock"); // _scanBase = new ScanBase(this, _wicoControl); _asteroids = new Asteroids(this, _wicoControl, wicoIGC, _displays); _scanMode = new ScansMode(this, _wicoControl, wicoBlockMaster, wicoIGC, wicoCameras, _asteroids); _ores = new Ores(this, wicoBlockMaster, _wicoControl, wicoIGC, _asteroids, _displays); Echo("_ores"); _miner = new Miner(this, _wicoControl, wicoBlockMaster, wicoElapsedTime, wicoIGC , _scanMode, _asteroids, wicoThrusters, wicoConnectors, wicoSensors , wicoCameras, _drills, wicoAntennas, wicoGasTanks, wicoGyros, wicoPower , wicoTimers, navCommon, _ores, _dock , _displays ); Echo("_miner"); // spaceDock = new SpaceDock(this, _wicoControl, wicoBlockMaster, wicoThrusters, wicoConnectors, // wicoAntennas, wicoGasTanks, wicoGyros, wicoPower, wicoTimers, wicoIGC, wicoBases, navCommon, _cargoCheck); //wicoOrbitalLaunch = new OrbitalModes(this); // wicoNavigation = new Navigation(this, wicoBlockMaster.GetMainController()); /// DEBUG // wicoIGC.SetDebug(true); // _wicoControl.SetDebug(true); // wicoElapsedTime.SetDebug(true); }
protected BYQ3Shape(SerializationInfo info, StreamingContext context) : base(info, context) { rightConnector = (Connector)info.GetValue("rightconnector", typeof(Connector)); topConnector = (Connector)info.GetValue("topconnector", typeof(Connector)); bottomConnector = (Connector)info.GetValue("bottomconnector", typeof(Connector)); leftConnector = (Connector)info.GetValue("leftconnector", typeof(Connector)); leftConnector.BelongsTo = this; rightConnector.BelongsTo = this; topConnector.BelongsTo = this; bottomConnector.BelongsTo = this; Connectors.Add(leftConnector); Connectors.Add(rightConnector); Connectors.Add(topConnector); Connectors.Add(bottomConnector); }
public void Setup() { _defaultTarget = new ModelsAndServices(); IConnectors connectors = new Connectors(); _nonDefaultTarget = new ModelsAndServices(connectors); }