/// <summary> /// Triggers the LoggedIn event. /// </summary> protected virtual void OnLoggedIn() { DebugFns.WriteLine(string.Format(StringResources.SuccessfullyLoggedIn, ConnectionOptions.Name, ConnectionOptions.IsFake)); NotifyPropertyChanged("IsLoggedIn"); LoggedIn(this, EventArgs.Empty); }
/// <summary> /// Resets the fake backing store to its initial state. /// </summary> /// <returns> Returns true if the EntityManagerProvider supports the fake backing store. </returns> public static bool ResetFakeBackingStore <T>(this IEntityManagerProvider <T> @this) where T : EntityManager { if ([email protected] || !(@this is EntityManagerProvider <T>)) { DebugFns.WriteLine(StringResources.NonSuitableEmpForFakeStoreOperation); return(false); } ((EntityManagerProvider <T>)@this).ResetFakeBackingStore(); return(true); }
/// <summary> /// Creates a new EntityManager instance. /// </summary> protected virtual T CreateEntityManager() { try { var connectionOptions = ConnectionOptions; var manager = (T)Activator.CreateInstance(typeof(T), connectionOptions.ToEntityManagerContext()); DebugFns.WriteLine(string.Format(StringResources.SuccessfullyCreatedEntityManager, manager.GetType().FullName, connectionOptions.Name, connectionOptions.IsFake)); return(manager); } catch (MissingMemberException inner) { throw new InvalidOperationException(string.Format(StringResources.MissingEntityManagerConstructor, typeof(T).Name), inner); } }
/// <summary> /// Initializes the fake backing store. /// </summary> /// <returns> Returns true if the EntityManagerProvider supports the fake backing store. </returns> public static bool InitializeFakeBackingStore <T>(this IEntityManagerProvider <T> @this) where T : EntityManager { if ([email protected]) { DebugFns.WriteLine(StringResources.NonSuitableEmpForFakeStoreOperation); return(false); } // Return if already initialized if (FakeBackingStore.Exists(@this.Manager.CompositionContext.Name)) { return(true); } FakeBackingStore.Create(@this.Manager.CompositionContext.Name); ResetFakeBackingStore(@this); return(true); }
public static void DebugWriteLine(object aObject) { DebugFns.WriteLine(FormatLogMessage(aObject)); }
/// <summary>Writes log messages to <see cref="System.Diagnostics.Debug"/>.</summary> private static void LogWriter(string message) { DebugFns.WriteLine(message); }