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

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

            Transformers.Add(transformerSymbol, transformer);
        }
示例#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;
            }
示例#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;
            }
示例#5
0
            public Delete(DeleteSymbol <T> symbol)
            {
                if (symbol == null)
                {
                    throw AutoInitAttribute.ArgumentNullException(typeof(DeleteSymbol <T>), nameof(symbol));
                }

                this.Symbol = symbol;
                this.Lite   = true;
            }
示例#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);
        }
    }
示例#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);
        }
示例#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);
        }
示例#9
0
        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);
        }
示例#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);
        }
示例#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);
            }
        }
    }
示例#12
0
    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);
    }
示例#13
0
 public Delete(DeleteSymbol <T> symbol)
 {
     this.Symbol = symbol ?? throw AutoInitAttribute.ArgumentNullException(typeof(DeleteSymbol <T>), nameof(symbol));
 }
示例#14
0
 public Execute(ExecuteSymbol <T> symbol)
 {
     this.Symbol = symbol ?? throw AutoInitAttribute.ArgumentNullException(typeof(ExecuteSymbol <T>), nameof(symbol));
     this.Lite   = true;
 }