mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-13 20:47:24 +00:00
feat: Adding methods to get the data directory for a given room
This commit is contained in:
parent
09e0a20443
commit
13a2493f4c
1 changed files with 21 additions and 1 deletions
|
|
@ -1,6 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using ICD.Common.Properties;
|
using ICD.Common.Properties;
|
||||||
using ICD.Common.Utils.Extensions;
|
using ICD.Common.Utils.Extensions;
|
||||||
|
|
@ -289,6 +288,27 @@ namespace ICD.Common.Utils
|
||||||
return Join(ProgramDataPath, local);
|
return Join(ProgramDataPath, local);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///Appends the local path to the room data path.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string GetRoomDataPath(int roomId, params string[] localPath)
|
||||||
|
{
|
||||||
|
string local = Join(localPath);
|
||||||
|
string roomDataDirectory = GetRoomDataDirectory(roomId);
|
||||||
|
return Join(ProgramDataPath, roomDataDirectory, local);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the directory name of the room data directory for the room with the given id.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="roomId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static string GetRoomDataDirectory(int roomId)
|
||||||
|
{
|
||||||
|
return string.Format("Room{0}Data", roomId);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns true if the given path exists.
|
/// Returns true if the given path exists.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue