Пример #1
0
        public void SetUp()
        {
            AppContext = new TraceLabTestApplication(TestContext, false);

            //setPath
            this.TmpCachePath = System.IO.Path.Combine(AppContext.BaseTestDirectory, "Foo.cache");
            this.TmpDataPath  = System.IO.Path.Combine(AppContext.BaseTestDirectory, "DataFoo.xml");

            TestCacheSerializer = new CachingSerializer(AppContext.StreamManager, TmpDataPath, TmpCachePath, SupportedTypes, true, true);
        }
Пример #2
0
        /// <summary>
        /// Creates the workspace unit.
        /// </summary>
        /// <param name="unitName">Name of the unit.</param>
        /// <returns></returns>
        internal WorkspaceUnit CreateWorkspaceUnit(string unitName)
        {
            string dataPath  = GetDataPath(unitName);
            string cachePath = GetCachePath(unitName);

            // Create the WorkspaceUnit that we'll use for deserialization
            var serializer = new CachingSerializer(m_streamManager, dataPath, cachePath, m_supportedTypes.Values.ToArray(), m_writeUnitsToDisc, false);
            var dataUnit   = new WorkspaceUnit(unitName, serializer);

            return(dataUnit);
        }
        internal WorkspaceUnit(string realUnitName, CachingSerializer serializer)
        {
            if (serializer == null)
                throw new ArgumentNullException("serializer", "m_workspace serializer is not allowed to be null");

            //note currently the short name and friendly name are the same, but potentially friendly name can include scope name, etc, but we do not want to mix the two
            ShortUnitName = GetShortUnitName(realUnitName);
            FriendlyUnitName = ShortUnitName;

            RealUnitName = realUnitName;
            Serializer = serializer;
        }
Пример #4
0
        internal WorkspaceUnit(string realUnitName, CachingSerializer serializer)
        {
            if (serializer == null)
            {
                throw new ArgumentNullException("serializer", "m_workspace serializer is not allowed to be null");
            }

            //note currently the short name and friendly name are the same, but potentially friendly name can include scope name, etc, but we do not want to mix the two
            ShortUnitName    = GetShortUnitName(realUnitName);
            FriendlyUnitName = ShortUnitName;

            RealUnitName = realUnitName;
            Serializer   = serializer;
        }
        public static CachingSerializer Create(
            string path_s,
            string cachePath_s1,
            Type[] supportedTypes_types
        )
        {
            CachingSerializer cachingSerializer = new CachingSerializer
                                                      (StreamManager.CreateNewManager(), path_s, cachePath_s1, supportedTypes_types);
            return cachingSerializer;

            // TODO: Edit factory method of CachingSerializer
            // This method should be able to configure the object in all possible ways.
            // Add as many parameters as needed,
            // and assign their values to each field by using the API.
        }
Пример #6
0
        public static CachingSerializer Create(
            string path_s,
            string cachePath_s1,
            Type[] supportedTypes_types
            )
        {
            CachingSerializer cachingSerializer = new CachingSerializer
                                                      (StreamManager.CreateNewManager(), path_s, cachePath_s1, supportedTypes_types);

            return(cachingSerializer);

            // TODO: Edit factory method of CachingSerializer
            // This method should be able to configure the object in all possible ways.
            // Add as many parameters as needed,
            // and assign their values to each field by using the API.
        }
Пример #7
0
        /// <summary>
        /// Creates the workspace unit.
        /// </summary>
        /// <param name="unitName">Name of the unit.</param>
        /// <returns></returns>
        internal WorkspaceUnit CreateWorkspaceUnit(string unitName)
        {
            string dataPath = GetDataPath(unitName);
            string cachePath = GetCachePath(unitName);

            // Create the WorkspaceUnit that we'll use for deserialization
            var serializer = new CachingSerializer(m_streamManager, dataPath, cachePath, m_supportedTypes.Values.ToArray(), m_writeUnitsToDisc, false);
            var dataUnit = new WorkspaceUnit(unitName, serializer);
            
            return dataUnit;
        }
        public void SetUp()
        {
            AppContext = new TraceLabTestApplication(TestContext, false);

            //setPath
            this.TmpCachePath = System.IO.Path.Combine(AppContext.BaseTestDirectory, "Foo.cache");
            this.TmpDataPath = System.IO.Path.Combine(AppContext.BaseTestDirectory, "DataFoo.xml");

            TestCacheSerializer = new CachingSerializer(AppContext.StreamManager, TmpDataPath, TmpCachePath, SupportedTypes, true, true);
        }
 public void TestConstructorNotAbsoluteCachePath()
 {
     CachingSerializer cachingSerial = new CachingSerializer(AppContext.StreamManager, TmpDataPath, "Foo.cache", SupportedTypes, true, true);
 }
 public void TestConstructorNullStreamMgr()
 {
     CachingSerializer cachingSerial = new CachingSerializer(null, TmpDataPath, TmpCachePath, SupportedTypes, true, true);
 }
 public void TestConstructorNullCachePath()
 {
     CachingSerializer cachingSerial = new CachingSerializer(AppContext.StreamManager, TmpDataPath, null, SupportedTypes, true, true);
 }
Пример #12
0
 public void TestConstructorNotAbsoluteCachePath()
 {
     CachingSerializer cachingSerial = new CachingSerializer(AppContext.StreamManager, TmpDataPath, "Foo.cache", SupportedTypes, true, true);
 }
Пример #13
0
 public void TestConstructorNullStreamMgr()
 {
     CachingSerializer cachingSerial = new CachingSerializer(null, TmpDataPath, TmpCachePath, SupportedTypes, true, true);
 }
Пример #14
0
 public void TestConstructorNullCachePath()
 {
     CachingSerializer cachingSerial = new CachingSerializer(AppContext.StreamManager, TmpDataPath, null, SupportedTypes, true, true);
 }