CarotDav_decompile/Rei.Fs/ResourceInfo.cs

166 lines
4.5 KiB
C#
Raw Normal View History

// Decompiled with JetBrains decompiler
// Type: Rei.Fs.ResourceInfo
// Assembly: Rei.Fs, Version=1.13.2.8796, Culture=neutral, PublicKeyToken=null
// MVID: D8B08A8B-697C-4439-9CFF-1BE4EE46F7B0
// Assembly location: F:\Eigene Dateien\Dropbox\portable Collection\Progs\CarotDAV\Rei.Fs.dll
using Microsoft.VisualBasic.CompilerServices;
using System;
using System.Collections.Generic;
using System.Diagnostics;
namespace Rei.Fs
{
[DebuggerDisplay("{DebuggerString}")]
[Serializable]
public class ResourceInfo : ReturnedInfo, ICloneable
{
public ResourceId Id;
public long Size;
public DateTime LastModifiedTime;
public bool IsCollection;
public DateTime CreationTime;
public DateTime LastAccessTime;
public string StatusDescription;
public bool HasError;
public bool CanRename;
public bool CanMove;
public bool CanCopy;
public bool CanDelete;
public bool CanSetInfo;
public bool IsEncrypted;
public bool IsSplitted;
public bool IsMinor;
private List<string> pTypes;
private ResourceInfo.PropertyCollection pProperties;
public ResourceInfo()
: this((ResourceId) null, false, 0L, DateTime.MinValue, DateTime.MinValue, DateTime.MinValue)
{
}
public ResourceInfo(ResourceId id, bool iscollection, long size, DateTime lastmodified)
: this(id, iscollection, size, lastmodified, DateTime.MinValue, DateTime.MinValue)
{
}
public ResourceInfo(ResourceId id, bool iscollection, long size, DateTime lastmodified, DateTime creation, DateTime lastaccess)
{
this.Id = id;
this.IsCollection = iscollection;
this.Size = size;
this.LastModifiedTime = lastmodified;
this.CreationTime = creation;
this.LastAccessTime = lastaccess;
this.pProperties = new ResourceInfo.PropertyCollection();
this.pTypes = new List<string>();
this.HasError = false;
}
public ResourceInfo.PropertyCollection Properties
{
get
{
return this.pProperties;
}
}
public List<string> Types
{
get
{
return this.pTypes;
}
}
public object Clone()
{
ResourceInfo resourceInfo = (ResourceInfo) this.MemberwiseClone();
resourceInfo.pProperties = new ResourceInfo.PropertyCollection();
resourceInfo.pProperties.AddRange((IEnumerable<ResourceInfo.ResourceProperty>) this.pProperties);
resourceInfo.pTypes = new List<string>();
resourceInfo.pTypes.AddRange((IEnumerable<string>) this.pTypes);
return (object) resourceInfo;
}
public string DebuggerString
{
get
{
return this.ToString();
}
}
public override string ToString()
{
string str1 = "";
string str2 = (object) this.Id != null ? str1 + this.Id.ToString() : str1 + "NoId";
return (!this.IsCollection ? str2 + " <FILE> " : str2 + " <COLL> ") + this.Size.ToString();
}
[Serializable]
public class PropertyCollection : List<ResourceInfo.ResourceProperty>
{
public ResourceInfo.ResourceProperty this[string name]
{
get
{
int index = this.IndexOf(name);
if (index >= 0)
return this[index];
throw new ArgumentOutOfRangeException();
}
}
public int IndexOf(string name)
{
int num1 = 0;
int num2 = checked (this.Count - 1);
int index = num1;
while (index <= num2)
{
if (Operators.CompareString(this[index].Name, name, false) == 0)
return index;
checked { ++index; }
}
return -1;
}
public void Add(string name, string value, string statedescription, bool haserror)
{
this.Add(new ResourceInfo.ResourceProperty(name, value, statedescription, haserror));
}
public void Remove(string name)
{
int index = this.IndexOf(name);
if (index < 0)
throw new ArgumentException();
this.RemoveAt(index);
}
public bool Contains(string name)
{
return this.IndexOf(name) >= 0;
}
}
[Serializable]
public class ResourceProperty
{
public string Name;
public string Value;
public string StateDescription;
public bool HasError;
public ResourceProperty(string name, string value, string statedescription, bool haserror)
{
this.Name = name;
this.Value = value;
this.StateDescription = statedescription;
this.HasError = haserror;
}
}
}
}