示例#1
0
        public void UpdateFence(FenceInfo fenceInfo)
        {
            var path = GetFolderPath(fenceInfo);

            EnsureDirectoryExists(path);

            var metaFile   = Path.Combine(path, MetaFileName);
            var serializer = new XmlSerializer(typeof(FenceInfo));
            var writer     = new StreamWriter(metaFile);

            serializer.Serialize(writer, fenceInfo);
            writer.Close();
        }
示例#2
0
        public void CreateFence(string name)
        {
            var fenceInfo = new FenceInfo(Guid.NewGuid())
            {
                Name   = name,
                PosX   = 100,
                PosY   = 250,
                Height = 300,
                Width  = 300
            };

            UpdateFence(fenceInfo);
            new FenceWindow(fenceInfo).Show();
        }
示例#3
0
 private string GetFolderPath(FenceInfo fenceInfo)
 {
     return(Path.Combine(basePath, fenceInfo.Id.ToString()));
 }
示例#4
0
 public void RemoveFence(FenceInfo info)
 {
     Directory.Delete(GetFolderPath(info), true);
 }