public static void ScheduleUpdate(IUpdatable updatable)
 {
     UpdateScheduler currentSet = _currentSet.Value;
     if (currentSet != null)
         currentSet._updatables.Add(updatable);
     else if (_runOnUIThread != null)
         _runOnUIThread(updatable.UpdateNow);
 }
示例#2
0
 internal void DisposeProvider()
 {
     if (this.updateProvider != null)
     {
         WebUtil.Dispose(this.updateProvider);
         this.updateProvider = null;
     }
 }
示例#3
0
    // Use this for initialization
    public static void Reg(IUpdatable i)
    {
        if (Singleton == null)
        {
            GameObject go = new GameObject("HotFileDBFRAM_Updater");
            Singleton = go.AddComponent<HotFileDBFRAM_Updater>();

            Singleton.Updatables = new List<IUpdatable>();
            Singleton.mMCU = INemoControlIOSinglton.Get();
            Singleton.mMCU.EvtOpened += Singleton.Handle_MCU_Connect;
        }

        Singleton.Updatables.Add(i);
    }
示例#4
0
 internal IUpdatable GetOrLoadUpdateProvider()
 {
     if (this.updateProvider == null)
     {
         this.updateProvider = this.service.Provider.GetService<IDataServiceUpdateProvider2>();
         if ((this.updateProvider == null) && this.service.Provider.IsV1Provider)
         {
             this.updateProvider = this.service.Provider.GetService<IUpdatable>();
         }
         if (this.updateProvider == null)
         {
             this.updateProvider = this.service.Provider.GetService<IDataServiceUpdateProvider>();
         }
     }
     return this.updateProvider;
 }
 public UserAuthenticationProvider(
     ITranslate<User, UserAccount> translateDataUserToUserAccount, 
     IRetrievable<ByUserEmail, User> retrieveUserByEmail, 
     IBulkRetrievable<ByEncodedUserId, UserAuthentication> retrieveAllUserAuthenticationByEncodedUserId, 
     IUpdatable<UserAuthentication> userAuthUpdater, 
     ICreatable<UserAuthentication> userAuthCreator, 
     IPasswords passwords, 
     IDeletable<UserAuthentication> userAuthDeleter)
 {
     _translateDataUserToUserAccount = translateDataUserToUserAccount;
     _retrieveUserByEmail = retrieveUserByEmail;
     _retrieveAllUserAuthenticationByEncodedUserId = retrieveAllUserAuthenticationByEncodedUserId;
     _userAuthUpdater = userAuthUpdater;
     _userAuthCreator = userAuthCreator;
     _passwords = passwords;
     _userAuthDeleter = userAuthDeleter;
 }
 public UserAccountProvider(
     IUserAuthenticationProvider userAuthProvider, 
     ICreatable<User> userCreator, 
     IRetrievable<ByUserId, User> userGetByUserId, 
     IRetrievable<ByUserEmail, User> retrieveUserByEmail, 
     IDeletable<User> userDeleter, 
     IUpdatable<User> userUpdater, 
     ITranslate<User, UserAccount> translateDataUserToUserAccount, 
     ISystemTime systemTime)
 {
     _userAuthProvider = userAuthProvider;
     _userCreator = userCreator;
     _userGetByUserId = userGetByUserId;
     _retrieveUserByEmail = retrieveUserByEmail;
     _userDeleter = userDeleter;
     _userUpdater = userUpdater;
     _translateDataUserToUserAccount = translateDataUserToUserAccount;
     _systemTime = systemTime;
 }
示例#7
0
        /// <summary>
        /// Tries to load the update provider implementation if it has not already been loaded, then return the loaded IUpdatable implementation.
        /// </summary>
        /// <returns>Returns an IUpdatable implementation.</returns>
        internal IUpdatable GetOrLoadUpdateProvider()
        {
            if (this.updateProvider == null)
            {
                // We always attempt to load IDataServiceUpdateProvider2 first. This makes call order predictable. 
                // And if the provider supports ServiceActions, we can be certain that the instance returned from 
                // GetService<IDSUP2> can be casted to IDSUP, but the reverse might not be true.
                this.updateProvider = this.service.Provider.GetService<IDataServiceUpdateProvider2>();
                
                if (this.updateProvider == null)
                {
                    this.updateProvider = this.service.Provider.GetService<IDataServiceUpdateProvider>();
                }

                // ObjectContextServiceProvider already must have given a non-null value.
                // Hence basically, this call is only for reflection service provider.
                if (this.updateProvider == null && this.service.Provider.HasReflectionOrEFProviderQueryBehavior)
                {
                    this.updateProvider = this.service.Provider.GetService<IUpdatable>();
                }
            }

            return this.updateProvider;
        }
示例#8
0
 protected GameObject(IVisible visible, IUpdatable updatable, ICollidable collidable)
 {
     _visible    = visible;
     _updatable  = updatable;
     _collidable = collidable;
 }
示例#9
0
 public static void AddToUpdateList( IUpdatable Updatable )
 {
     updateList.AddLast( Updatable );
 }
示例#10
0
 /// <summary>
 ///     Concatenates <paramref name="updatables"/> whenever <paramref name="crunchTrigger"/> is updated for n <paramref name="interval"/> times.
 /// </summary>
 /// <param name="name">Name of the cruncher for debugging purposes.</param>
 /// <param name="crunchTrigger">The <see cref="IUpdatable"/> to observe for fires of <see cref="IUpdatable.Updated"/>.</param>
 /// <param name="interval">The interval for how many fires must <paramref name="crunchTrigger"/> trigger <see cref="IUpdatable.Updated"/> in order to trigger IndicatorRow's update event.</param>
 /// <param name="properties">
 ///     How many properties all of the <paramref name="updatables"/> emit.
 ///     this can be less than their minimal properties.
 ///     e.g. if <paramref name="updatables"/> emit <see cref="BarValue"/> (4 properties), selecting 1 will take only <see cref="BarValue.Close"/>.
 /// </param>
 /// <param name="indices">The index to use to call <paramref name="factory"/>.</param>
 /// <param name="factory">A factory to initialize new indicators using <paramref name="indices"/>.</param>
 /// <param name="triggerMustBeReady">Does <paramref name="crunchTrigger"/> must be ready to trigger IndicatorRow's update event?</param>
 /// <returns>A new cruncher configured.</returns>
 public static Concat OnSpecificUpdate(IEnumerable <int> indices, IndicatorFactoryHandler factory, IUpdatable crunchTrigger, int interval = 1, int properties = 1, string name = null, bool triggerMustBeReady = true)
 {
     return(BindToConcatenatingList(Concat.OnSpecificUpdate(Factory(indices, factory), crunchTrigger, interval, properties, name, triggerMustBeReady)));
 }
示例#11
0
		/// <summary>
		/// Unregisters an updatable object from the server timer pool.
		/// </summary>
		/// <param name="updatable">the object to unregister</param>
		public void UnregisterUpdatable(IUpdatable updatable)
		{
			AddMessage(() => m_updatables.Remove(updatable));
		}
示例#12
0
 public void Add(IUpdatable updatable)
 {
     mBackQueue.Enqueue(updatable);
 }
 public void AddUpdatable(IUpdatable updatable)
 {
     if (updatables.IsNull())
     {
         updatables = new UpdatableList();
     }
     updatables.Add(updatable);
 }
 protected void RemoveUpdatable(IUpdatable updatable)
 {
     updatables.Remove(updatable);
 }
示例#15
0
 public UpdatableMetricCounter(IUpdatable updatable)
 {
     this.updatable = updatable;
 }
示例#16
0
 public static IDisposable EnterUpdateScope(this IUpdatable updatable, bool saveToDataSource = false)
 {
     return(new UpdateScope(updatable, saveToDataSource));
 }
 //////////////////////////////////////////////////////////////////////////////
 protected void AddUpdatable(IUpdatable updatable)
 {
     updatables.Add(updatable);
 }
 private void handleUpdatableDied(IUpdatable obj)
 {
     ToRemove.Add(obj);
 }
示例#19
0
 protected void RemoveUpdatable(IUpdatable updatable)
 {
     updatables.Remove(updatable);
 }
示例#20
0
 //////////////////////////////////////////////////////////////////////////////
 protected void AddUpdatable(IUpdatable updatable)
 {
     updatables.Add(updatable);
 }
示例#21
0
 /// <summary>
 /// Poistaa olion päivitettävien joukosta.
 /// </summary>
 /// <param name="obj"></param>
 public static void RemoveFromUpdate(IUpdatable obj)
 {
     updatedObjects.Remove(obj);
 }
 /// <summary>
 /// Invokes <see cref="TimeManager.RemoveUpdatable(IUpdatable)"/>
 /// </summary>
 /// <param name="updatable"></param>
 public static void DisableUpdates(this IUpdatable updatable)
 {
     TimeManager.RemoveUpdatable(updatable);
 }
示例#23
0
 /// <summary>
 /// Merkitsee olion päivitettäväksi.
 /// </summary>
 /// <param name="obj"></param>
 public static void AddToUpdate(IUpdatable obj)
 {
     updatedObjects.Add(obj);
 }
 /// <summary>
 /// Invokes <see cref="IUpdatable.OnUpdate"/>
 /// </summary>
 /// <param name="updatable"></param>
 public static void OnUpdate(this IUpdatable updatable)
 {
     updatable.OnUpdate();
 }
 public void RemoveUpdatable(IUpdatable updatable)
 {
     if (updatables.Count() > 0)
     {
         updatables.Remove(updatable);
     }
 }
示例#26
0
 public virtual void SkipUpdate(IUpdatable element)
 {
     if (!this._elementsToUpdate.Contains(element))
         return;
     this._elementsToUpdate.Remove(element);
 }
示例#27
0
 public override void Setup()
 {
     base.Setup();
     this.update = this.nwnd as IUpdatable;
     AddUser();
 }
示例#28
0
 public virtual void Update(IUpdatable element)
 {
     if (this.DisableUpdates)
         return;
     if (this._updateNestLevel == 0)
     {
         element.Update();
     }
     else
     {
         if (this._elementsToUpdate.Contains(element) || element.Parent != null && this._elementsToUpdate.Contains(element.Parent))
             return;
         this._elementsToUpdate.Add(element);
     }
 }
示例#29
0
		/// <summary>
		/// Registers an updatable object in the server timer pool.
		/// </summary>
		/// <param name="updatable">the object to register</param>
		public void RegisterUpdatable(IUpdatable updatable)
		{
			AddMessage(() => m_updatables.Add(updatable));
		}
示例#30
0
        internal void Push(ISoulBinder soulBinder, IUpdatable handler)
        {
            _RequesterHandlers.Add(handler);

            lock(_Binders)
            {
                _Binders.Enqueue(soulBinder);
            }
        }
示例#31
0
		/// <summary>
		/// Registers the given Updatable during the next Map Tick
		/// </summary>
		public void RegisterUpdatableLater(IUpdatable updatable)
		{
			m_messageQueue.Enqueue(new Message(() => RegisterUpdatable(updatable)));
		}
示例#32
0
 public static bool UpdateListContains(IUpdatable updatable)
 {
     return updateList.Contains(updatable);
 }
示例#33
0
 public static void RemoveFromUpdateList( IUpdatable Updatable )
 {
     updateRemoveList.AddLast( Updatable );
 }
 public void RemoveUpdatable(IUpdatable _updatable)
 {
     updatables.Remove(_updatable);
 }
示例#35
0
 public void Untick(IUpdatable obj)
 {
     updatables.Remove(obj);
 }
示例#36
0
 public Dat(IUpdatable another)
 {
     UpdateFrom(another);
 }
示例#37
0
 /// <summary>Constructs a updater for the given object</summary>
 /// <param name="obj">The object that will recieve updates</param>
 public Updater(IUpdatable obj)
 {
     Obj = obj;
     Interval = 1000;
 }
 public void SubscribeUpdate(IUpdatable _updatable)
 {
     updatables.Add(_updatable);
 }
示例#39
0
 public void Tick(IUpdatable obj)
 {
     updatables.Add(obj);
 }
示例#40
0
文件: View2.cs 项目: jamafyna/park
 /// <summary>
 /// Removes a detailed IUpdatable item (AmusementsDetailForm).
 /// </summary>
 /// <param name="form"></param>
 public void RemoveClickIUpdatable(IUpdatable form)
 {
     clickForms.Remove(form);
 }
 /// <summary>
 ///     Adds an updatable object to be automatically updated every frame and will ignore duplicate objects.
 /// </summary>
 public void AddUpdatable(IUpdatable updatable)
 {
     try
     {
         if (!this.UpdatableModules.Contains(updatable))
         {
             this.UpdatableModules.Add(updatable);
         }
     }
     catch (Exception ex)
     {
         MyLogger.Exception(ex);
     }
 }
示例#42
0
 public abstract IUpdatable <T> GetSet(IUpdatable <T> source, T entity);