Exemple #1
0
            public Construct(ConstructSymbol <T> .Simple symbol)
            {
                if (symbol == null)
                {
                    throw AutoInitAttribute.ArgumentNullException(typeof(ConstructSymbol <T> .Simple), nameof(symbol));
                }

                this.operationSymbol = symbol.Symbol;
            }
        public static void RegisterTransformer(WordTransformerSymbol transformerSymbol, Action <WordContext, OpenXmlPackage> transformer)
        {
            if (transformerSymbol == null)
            {
                throw AutoInitAttribute.ArgumentNullException(typeof(WordTransformerSymbol), nameof(transformerSymbol));
            }

            Transformers.Add(transformerSymbol, transformer);
        }
Exemple #3
0
            public ConstructFromMany(ConstructSymbol <T> .FromMany <F> symbol)
            {
                if (symbol == null)
                {
                    throw AutoInitAttribute.ArgumentNullException(typeof(ConstructSymbol <T> .FromMany <F>), nameof(symbol));
                }

                this.Symbol = symbol;
            }
Exemple #4
0
            public ConstructFrom(ConstructSymbol <T> .From <F> symbol)
            {
                if (symbol == null)
                {
                    throw AutoInitAttribute.ArgumentNullException(typeof(ConstructSymbol <T> .From <F>), nameof(symbol));
                }

                this.operationSymbol = symbol.Symbol;
                this.baseType        = symbol.BaseType;
            }
Exemple #5
0
            public Delete(DeleteSymbol <T> symbol)
            {
                if (symbol == null)
                {
                    throw AutoInitAttribute.ArgumentNullException(typeof(DeleteSymbol <T>), nameof(symbol));
                }

                this.Symbol = symbol;
                this.Lite   = true;
            }
Exemple #6
0
    public static void RegisterPermissions(params PermissionSymbol[] permissions)
    {
        foreach (var p in permissions)
        {
            if (p == null)
            {
                throw AutoInitAttribute.ArgumentNullException(typeof(PermissionSymbol), nameof(permissions));
            }

            PermissionAuthLogic.permissions.Add(p);
        }
    }
Exemple #7
0
        public static void Register(FileTypeSymbol fileTypeSymbol, IFileTypeAlgorithm algorithm)
        {
            if (fileTypeSymbol == null)
            {
                throw AutoInitAttribute.ArgumentNullException(typeof(FileTypeSymbol), nameof(fileTypeSymbol));
            }

            if (algorithm == null)
            {
                throw new ArgumentNullException(nameof(algorithm));
            }

            FileTypes.Add(fileTypeSymbol, algorithm);
        }
Exemple #8
0
        public static void Register(ProcessAlgorithmSymbol processAlgorithm, IProcessAlgorithm algorithm)
        {
            if (processAlgorithm == null)
            {
                throw AutoInitAttribute.ArgumentNullException(typeof(ProcessAlgorithmSymbol), nameof(processAlgorithm));
            }

            if (algorithm == null)
            {
                throw new ArgumentNullException(nameof(algorithm));
            }

            registeredProcesses.Add(processAlgorithm, algorithm);
        }
        public static void Register(SimpleTaskSymbol simpleTaskSymbol, Func <ScheduledTaskContext, Lite <IEntity> > action)
        {
            if (simpleTaskSymbol == null)
            {
                throw AutoInitAttribute.ArgumentNullException(typeof(SimpleTaskSymbol), nameof(simpleTaskSymbol));
            }

            if (action == null)
            {
                throw new ArgumentNullException(nameof(action));
            }

            tasks.Add(simpleTaskSymbol, action);
        }
Exemple #10
0
        public static void Register <T>(TypeConditionSymbol typeCondition, Expression <Func <T, bool> > condition, Func <T, bool>?inMemoryCondition)
            where T : Entity
        {
            if (typeCondition == null)
            {
                throw AutoInitAttribute.ArgumentNullException(typeof(TypeConditionSymbol), nameof(typeCondition));
            }

            if (condition == null)
            {
                throw new ArgumentNullException(nameof(condition));
            }

            infos.GetOrCreate(typeof(T))[typeCondition] = new TypeConditionPair(condition, inMemoryCondition);
        }
Exemple #11
0
    public static void RegisterTypes(params Type[] types)
    {
        foreach (var t in types)
        {
            if (!t.IsStaticClass())
            {
                throw new ArgumentException("{0} is not a static class".FormatWith(t.Name));
            }

            foreach (var p in t.GetFields(BindingFlags.Public | BindingFlags.Static).Select(fi => fi.GetValue(null)).Cast <PermissionSymbol>())
            {
                if (p == null)
                {
                    throw AutoInitAttribute.ArgumentNullException(typeof(PermissionSymbol), nameof(permissions));
                }

                PermissionAuthLogic.permissions.Add(p);
            }
        }
    }
    public static void Register <T>(TypeConditionSymbol typeCondition, Expression <Func <T, bool> > condition, Func <T, bool>?inMemoryCondition)
        where T : Entity
    {
        if (Schema.Current.IsCompleted)
        {
            throw new InvalidOperationException("Schema already completed");
        }

        if (typeCondition == null)
        {
            throw AutoInitAttribute.ArgumentNullException(typeof(TypeConditionSymbol), nameof(typeCondition));
        }

        if (condition == null)
        {
            throw new ArgumentNullException(nameof(condition));
        }

        infos.GetOrCreate(typeof(T))[typeCondition] = new TypeConditionPair(condition, inMemoryCondition);
    }
Exemple #13
0
 public Delete(DeleteSymbol <T> symbol)
 {
     this.Symbol = symbol ?? throw AutoInitAttribute.ArgumentNullException(typeof(DeleteSymbol <T>), nameof(symbol));
 }
Exemple #14
0
 public Execute(ExecuteSymbol <T> symbol)
 {
     this.Symbol = symbol ?? throw AutoInitAttribute.ArgumentNullException(typeof(ExecuteSymbol <T>), nameof(symbol));
     this.Lite   = true;
 }