partial void PexConstructor(IVortexObject parent, string readableTail, string symbolTail) { _context = parent.GetParent <TcoContext>(); // TODO: This is temporary should be made in in VortexBase library Task.Run(() => { while (true) { System.Threading.Thread.Sleep(2000); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(IsActive))); } }); }
/// <summary> /// Searches recursively the parents of this <see cref="IVortexObject"/> until encounters object of given /// type. When the root object <see cref="Vortex.Connector.IConnector"/> is hit climbing up the hierarchy the method returns pre-existing parent. /// </summary> /// <remarks> /// Take into consideration possible performance degradation due to use of reflections in this method. /// </remarks> /// <typeparam name="T"></typeparam> /// <param name="obj">Searched object</param> /// <param name="parent">[optional] Pre-existing parent. </param> /// <returns>Parent object of given type.</returns> public static T GetParent <T>(this IVortexObject obj, T parent = null) where T : class { if (obj is Vortex.Connector.RootVortexerObject || obj is Vortex.Connector.IConnector || obj == null) { return(parent); } if (obj is T) { parent = (T)obj; return(parent); } return(GetParent <T>(obj.GetParent())); }
partial void PexConstructor(IVortexObject parent, string readableTail, string symbolTail) { this.Connector.IdentityProvider.AddIdentity(this); this._context = parent.GetParent <TcoContext>(); this.MessageHandler = new TcoObjectMessageHandler(this._context, this); }
public IVortexObject GetParent() { return(_obj.GetParent()); }
partial void PexConstructor(IVortexObject parent, string readableTail, string symbolTail) { _context = parent.GetParent <IsTcoContext>(); _context?.AddMessage(this); _parentObject = parent.GetParent <IsTcoObject>(); }
private void Init(IVortexObject parent) { this.Connector?.IdentityProvider.AddIdentity(this); this._context = parent?.GetParent <TcoContext>(); this.MessageHandler = new TcoObjectMessageHandler(this._context, this); }