当前位置: 首页>>代码示例>>C#>>正文


C# IStorage.SetPath方法代码示例

本文整理汇总了C#中IStorage.SetPath方法的典型用法代码示例。如果您正苦于以下问题:C# IStorage.SetPath方法的具体用法?C# IStorage.SetPath怎么用?C# IStorage.SetPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IStorage的用法示例。


在下文中一共展示了IStorage.SetPath方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetUp

        public void SetUp()
        {
            var current_dir = Directory.GetCurrentDirectory ();
            serverStorageDir = Path.Combine (current_dir, "../../syncserver/");

            serverStorage = new DiskStorage ();
            serverStorage.SetPath (serverStorageDir);

            serverEngine = new Engine (serverStorage);

            manifest = new SyncManifest ();
            syncServer = new FilesystemSyncServer (serverEngine, manifest);

            CreateSomeSampleNotes ();
        }
开发者ID:j-4,项目名称:tomboy-library,代码行数:15,代码来源:FilesystemSyncServerTests.cs

示例2: DirectoryBasedNoteRepository

            public DirectoryBasedNoteRepository(string username, string notes_base_path)
            {
                this.Username = username;
                this.notesBasePath = notes_base_path;

                lock (userLocks) {
                    if (!userLocks.ContainsKey (Username))
                        userLocks [Username] = new Semaphore (1, 10);
                }
                // if another instance for this user exists, wait until it is freed
                userLocks [username].WaitOne ();

                storagePath = this.notesBasePath + "/" + Username;
                if (!Directory.Exists (storagePath)) {
                    Directory.CreateDirectory (storagePath);
                }

                storage = new DiskStorage ();
                storage.SetPath (storagePath);
                Engine = new Engine (storage);

                // read in data from "manifest" file
                manifestPath = Path.Combine (storagePath, "manifest.xml");
                if (File.Exists (manifestPath)) {
                    string manifest_xml = File.ReadAllText (manifestPath);
                    var textreader = new StringReader (manifest_xml);
                    var xmlreader = new XmlTextReader (textreader);
                    Manifest = SyncManifest.Read (xmlreader);
                } else {
                    Manifest = new SyncManifest ();
                    Manifest.ServerId = Guid.NewGuid ().ToString ();
                }
            }
开发者ID:BooTeK,项目名称:Rainy,代码行数:33,代码来源:NoteRepository.cs

示例3: InitClientTwo

 protected virtual void InitClientTwo()
 {
     clientManifestTwo = new SyncManifest ();
     clientStorageTwo = new DiskStorage ();
     clientStorageTwo.SetPath (clientStorageDirTwo);
     clientEngineTwo = new Engine (clientStorageTwo);
     syncClientTwo = new FilesystemSyncClient (clientEngineTwo, clientManifestTwo);
 }
开发者ID:j-4,项目名称:tomboy-library,代码行数:8,代码来源:AbstractSyncManagerTests.cs

示例4: InitClientOne

 protected virtual void InitClientOne()
 {
     clientStorageOne = new DiskStorage ();
     clientStorageOne.SetPath (clientStorageDirOne);
     clientEngineOne = new Engine (clientStorageOne);
     clientManifestOne = new SyncManifest ();
     syncClientOne = new FilesystemSyncClient (clientEngineOne, clientManifestOne);
 }
开发者ID:j-4,项目名称:tomboy-library,代码行数:8,代码来源:AbstractSyncManagerTests.cs

示例5: ClearClientTwo

 protected void ClearClientTwo(bool reset = false)
 {
     if (reset) {
         clientManifestTwo = new SyncManifest ();
         CleanupClientDirectoryTwo ();
     }
     clientStorageTwo = new DiskStorage ();
     clientStorageTwo.SetPath (clientStorageDirTwo);
     clientEngineTwo = new Engine (clientStorageTwo);
     syncClientTwo = new FilesystemSyncClient (clientEngineTwo, clientManifestTwo);
 }
开发者ID:j-4,项目名称:tomboy-library,代码行数:11,代码来源:AbstractSyncManagerTests.cs

示例6: ClearClientOne

        // forces re-readin from disk, and will make sure a client does not hold
        // Notes which are equal by reference as the server when using FilesystemSync
        protected void ClearClientOne(bool reset = false)
        {
            if (reset) {
                clientManifestOne = new SyncManifest ();
                CleanupClientDirectoryOne ();
            }

            clientStorageOne = new DiskStorage ();
            clientStorageOne.SetPath (clientStorageDirOne);
            clientEngineOne = new Engine (clientStorageOne);
            syncClientOne = new FilesystemSyncClient (clientEngineOne, clientManifestOne);
        }
开发者ID:j-4,项目名称:tomboy-library,代码行数:14,代码来源:AbstractSyncManagerTests.cs

示例7: InitServer

 private void InitServer()
 {
     serverStorage = new DiskStorage ();
     serverStorage.SetPath (serverStorageDir);
     serverEngine = new Engine (serverStorage);
     serverManifest = new SyncManifest ();
     syncServer = new FilesystemSyncServer (serverEngine, serverManifest);
 }
开发者ID:j-4,项目名称:tomboy-library,代码行数:8,代码来源:FilesystemSyncManagerTests.cs

示例8: ClearServer

 protected override void ClearServer(bool reset = false)
 {
     if (reset) {
         serverManifest = new SyncManifest ();
         CleanupServerDirectory ();
     }
     serverStorage = new DiskStorage ();
     serverStorage.SetPath (serverStorageDir);
     serverEngine = new Engine (serverStorage);
     syncServer = new FilesystemSyncServer (serverEngine, serverManifest);
 }
开发者ID:j-4,项目名称:tomboy-library,代码行数:11,代码来源:FilesystemSyncManagerTests.cs


注:本文中的IStorage.SetPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。