示例#1
0
 /// <summary>
 /// Call this to enable DebugView calls. Usually wrapped in #ifdef DEBUG conditional statements.
 /// </summary>
 public static void EnableDebugViews()
 {
     if (debugStore == null)
     {
         lock (syncRoot)
         {
             if (debugStore == null)
             {
                 debugPipeline = Pipeline.Create(debugStoreName);
                 debugStore    = Store.Create(debugPipeline, debugStoreName, null);
                 debugPipeline.RunAsync();
             }
         }
     }
 }
示例#2
0
文件: Store.cs 项目: vdedyukhin/psi
        /// <summary>
        /// Crops a store between the extents of a specified interval, generating a new store.
        /// </summary>
        /// <param name="inputName">The name of the store to crop.</param>
        /// <param name="inputPath">The path of the store to crop.</param>
        /// <param name="outputName">The name of the cropped store.</param>
        /// <param name="outputPath">The path of the cropped store.</param>
        /// <param name="cropInterval">The time interval to which to crop the store.</param>
        /// <param name="createSubdirectory">
        /// Indicates whether to create a numbered subdirectory for each cropped store
        /// generated by multiple calls to this method.
        /// </param>
        public static void Crop(string inputName, string inputPath, string outputName, string outputPath, TimeInterval cropInterval, bool createSubdirectory = true)
        {
            using (var pipeline = Pipeline.Create("CropStore"))
            {
                Importer inputStore  = Store.Open(pipeline, inputName, inputPath);
                Exporter outputStore = Store.Create(pipeline, outputName, outputPath, createSubdirectory, inputStore.Serializers);

                // copy all streams from inputStore to outputStore
                foreach (var streamInfo in inputStore.AvailableStreams)
                {
                    inputStore.CopyStream(streamInfo.Name, outputStore);
                }

                // run the pipeline to copy over the specified cropInterval
                pipeline.Run(cropInterval, true, false);
            }
        }