Ejemplo n.º 1
0
        public static ProjectionStateCollection GetProjections(bool errorIfNotInitialized)
        {
            if (!IsInitialized && errorIfNotInitialized)
                    throw new InvalidOperationException("The projection state has not been initialized.");

                // If the projections aren't initialized then create an empty collection
                if (projections == null)
                    projections = new ProjectionStateCollection();

                return projections;
        }
        public void Test_thisProperty_NameParameter()
        {
            ProjectionInfo info = new ProjectionInfo();
            info.Name = "TestProjection";
            info.Format = ProjectionFormat.Html;

            ProjectionStateCollection collection = new ProjectionStateCollection();
            collection[info.Name, info.Format] = info;

            Assert.IsTrue(collection.Contains(info.Name), "Returned false when it have been true.");
        }
        public void Test_Contains_NameProperty_NameBased()
        {
            ProjectionInfo info = new ProjectionInfo();
            info.Name = "TestProjection";
            info.Format = ProjectionFormat.Html;

            ProjectionStateCollection collection = new ProjectionStateCollection();
            collection.Add(info);

            Assert.IsTrue(collection.Contains(info.Name), "Returned false when it have been true.");
        }
        public void Test_thisProperty_NameParameter()
        {
            ProjectionInfo info = new ProjectionInfo();

            info.Name   = "TestProjection";
            info.Format = ProjectionFormat.Html;

            ProjectionStateCollection collection = new ProjectionStateCollection();

            collection[info.Name, info.Format] = info;

            Assert.IsTrue(collection.Contains(info.Name), "Returned false when it have been true.");
        }
        public void Test_Contains_NameProperty_NameBased()
        {
            ProjectionInfo info = new ProjectionInfo();

            info.Name   = "TestProjection";
            info.Format = ProjectionFormat.Html;

            ProjectionStateCollection collection = new ProjectionStateCollection();

            collection.Add(info);

            Assert.IsTrue(collection.Contains(info.Name), "Returned false when it have been true.");
        }
 /// <summary>
 /// Disposes the provided projections.
 /// </summary>
 public void Dispose(ProjectionStateCollection projections)
 {
     using (LogGroup logGroup = LogGroup.StartDebug("Disposing the projections."))
     {
         if (ProjectionState.IsInitialized)
         {
             while (projections.Count > 0)
             {
                 projections.RemoveAt(0);
             }
         }
     }
 }