private FileEntry(File f) { _name = f.FileName; _relativeFilePath = f.RelativePath; _content = null; _isFile = f.IsFile; }
private FileEntry(string path) { File f = new File(path); _name = f.FileName; _relativeFilePath = f.RelativePath; if (f.FileName.EndsWith(".txt")||f.FileName.EndsWith(".lua")) _content = f.ReadToEnd(); _isFile = f.IsFile; }
public static List<AudioFileEntry> LoadInPath(string path) { if (User.Current != null) return null; List<AudioFileEntry> ret = new List<AudioFileEntry>(); File f = new File((path == null ? "$AUDIOFILES%" : path)); foreach (File fi in f.Children) ret.Add(new AudioFileEntry(fi)); return ret; }
public static List<FileEntry> LoadInPath(string path) { if (!User.Current.HasRight(Constants.FILE_ACCESS_RIGHT)) return null; List<FileEntry> ret = new List<FileEntry>(); File f = new File(path); foreach (File fi in f.Children) ret.Add(new FileEntry(fi)); return ret; }
private AudioFileEntry(File f) { _name = f.FileName; _relativeFilePath = f.RelativePath; _isFile = f.IsFile; }
protected void UpdateVacationRoute(string context, string extension, DateTime originalStartDate, DateTime startDate, DateTime endDate, bool endWithVoicemail, File audioFile) { lock (_lock) { Hashtable ht = StoredConfiguration; ArrayList cont = new ArrayList(); if (ht.ContainsKey(context)) { cont = (ArrayList)ht[context]; ht.Remove(context); } Hashtable vcr; for (int x = 0; x < cont.Count; x++) { vcr = (Hashtable)cont[x]; if (((string)vcr[_OWNING_EXTENSION_FIELD_ID] == extension) && (((DateTime)vcr[_OWNING_EXTENSION_FIELD_ID]).Ticks == originalStartDate.Ticks)) { cont.RemoveAt(x); break; } } vcr = new Hashtable(); vcr.Add(_OWNING_EXTENSION_FIELD_ID, extension); vcr.Add(_START_DATE_FIELD_ID, startDate); vcr.Add(_END_DATE_FIELD_ID, endDate); vcr.Add(_END_WITH_VM_FIELD_ID, endWithVoicemail); vcr.Add(_TYPE_FIELD_ID, VacationRouteRedirectTypes.PlayFile); vcr.Add(_AUDIO_FILE_FIELD_ID, audioFile.ToString()); ht.Add(context, cont); StoredConfiguration = ht; } }
protected void AddVacationRoute(string context, string extension, DateTime startDate, DateTime endDate, bool endWithVoicemail, File audioFile) { lock (_lock) { Hashtable ht = StoredConfiguration; ArrayList cont = new ArrayList(); if (ht.ContainsKey(context)) { cont = (ArrayList)ht[context]; ht.Remove(context); } Hashtable vcr = new Hashtable(); vcr.Add(_OWNING_EXTENSION_FIELD_ID, extension); vcr.Add(_START_DATE_FIELD_ID, startDate); vcr.Add(_END_DATE_FIELD_ID, endDate); vcr.Add(_END_WITH_VM_FIELD_ID, endWithVoicemail); vcr.Add(_TYPE_FIELD_ID, VacationRouteRedirectTypes.PlayFile); vcr.Add(_AUDIO_FILE_FIELD_ID,audioFile.ToString()); ht.Add(context, cont); StoredConfiguration = ht; } }