Ejemplo n.º 1
0
        private void InitialAccessMode(AccessModel accessModel, int capacity, Func <T> func)
        {
            switch (accessModel)
            {
            case AccessModel.FIFO:
                _accessMode = new FIFOAccessMode <T>(capacity, func);
                break;

            case AccessModel.LIFO:
                _accessMode = new LIFOAccessMode <T>(capacity, func);
                break;

            default:
                throw new NotImplementedException();
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="GenericUnixPermissions"/> class.
 /// </summary>
 /// <param name="user">The user permissions</param>
 /// <param name="group">The group permissions</param>
 /// <param name="owner">The owner permissions</param>
 public GenericUnixPermissions([NotNull] IAccessMode user, [NotNull] IAccessMode group, [NotNull] IAccessMode owner)
 {
     User  = user;
     Group = group;
     Other = owner;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="GenericUnixPermissions"/> class.
 /// </summary>
 /// <param name="user">The user permissions.</param>
 /// <param name="group">The group permissions.</param>
 /// <param name="other">The other permissions.</param>
 public GenericUnixPermissions(IAccessMode user, IAccessMode group, IAccessMode other)
 {
     User  = user;
     Group = group;
     Other = other;
 }
Ejemplo n.º 4
0
 private static string BuildAccessMode(IAccessMode accessMode)
 {
     return($"{(accessMode.Read ? "r" : "-")}{(accessMode.Write ? "w" : "-")}{(accessMode.Execute ? "x" : "-")}");
 }
Ejemplo n.º 5
0
 private static string BuildAccessMode(IAccessMode accessMode)
 {
     return $"{(accessMode.Read ? "r" : "-")}{(accessMode.Write ? "w" : "-")}{(accessMode.Execute ? "x" : "-")}";
 }