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(); }
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(); }
private string GetFolderPath(FenceInfo fenceInfo) { return(Path.Combine(basePath, fenceInfo.Id.ToString())); }
public void RemoveFence(FenceInfo info) { Directory.Delete(GetFolderPath(info), true); }