Ejemplo n.º 1
0
            static public KeyValuePair <IBookIndex, IBookTarget> ComposeTarget(IBookParty party,
                                                                               SymbolName articleName, IBookIndex element, ITargetValues values, IProcessConfig config)
            {
                IBookTarget target = BuildTargetFromElement(element, values, config);

                return(new KeyValuePair <IBookIndex, IBookTarget>(element, target));
            }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the Character class with the specified SymbolName.
 /// </summary>
 Character(SymbolName name)
     : this()
 {
     //DaSt: uint wird nicht akzeptiert, muss auf int casten
     //SetValue("SymbolName", (int)(uint)name);
     this.symbolName.Value = (int)name;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the Character class with the specified SymbolName.
 /// </summary>
 Character(SymbolName name)
   : this()
 {
   //DaSt: uint wird nicht akzeptiert, muss auf int casten
   //SetValue("SymbolName", (int)(uint)name);
   this.symbolName.Value = (int)name;
 }
        protected GeneralPayrollArticle(uint articleCode, string articleName,
                                        uint conceptCode, string conceptName, ProcessCategory category,
                                        SymbolName[] pendingNames, SymbolName[] summaryNames,
                                        bool taxingIncome, bool healthIncome, bool socialIncome,
                                        bool grossSummary, bool nettoSummary, bool nettoDeducts) : base(articleCode, articleName)
        {
            __conceptSymbol = new SymbolName(conceptCode, conceptName);

            __category = category;

            __pendingArticleNames = (SymbolName[])pendingNames.Clone();

            __summaryArticleNames = (SymbolName[])summaryNames.Clone();

            __healthIncome = healthIncome;

            __socialIncome = socialIncome;

            __taxingIncome = taxingIncome;

            __summaryGross = grossSummary;

            __summaryNetto = nettoSummary;

            __deductsNetto = nettoDeducts;
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the Character class with the specified SymbolName.
 /// </summary>
 Character(SymbolName name)
     : this()
 {
     // uint does not work, need cast to int.
     //SetValue("SymbolName", (int)(uint)name);
     _symbolName.Value = (int)name;
 }
Ejemplo n.º 6
0
        public async void TestSymbolDeduplication(string feedName)
        {
            var symbolName = new SymbolName("imageName", "symbolHash");
            var feed       = Storage.GetFeed(feedName);

            await TestDeduplication(packageName => feed.GetSymbol(packageName, symbolName));
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the Character class with the specified SymbolName.
 /// </summary>
 Character(SymbolName name)
     : this()
 {
     // uint does not work, need cast to int.
     //SetValue("SymbolName", (int)(uint)name);
     _symbolName.Value = (int)name;
 }
Ejemplo n.º 8
0
        public void Should_Compare_Different_Symbols_AsEqual()
        {
            SymbolName testSymbolOne = new SymbolName(testSymbolCode1001, "Begining Symbol");

            SymbolName testSymbolTwo = new SymbolName(testSymbolCode1001, "Terminal Symbol");

            Assert.AreEqual(testSymbolOne, testSymbolTwo);
        }
Ejemplo n.º 9
0
        public void Should_Return_ContractTaskTermArticle_As_ClassName()
        {
            SymbolName testSpecName = ArticleSymbolName.REF_INCOME_GROSS;

            string testClassName = PayrollArticleFactory.ClassNameFor(testSpecName.Name);

            Assert.AreEqual(testClassName, "IncomeGrossArticle");
        }
        public void Should_Return_ContractTaskTermConcept_As_ClassName()
        {
            SymbolName testSpecName = ConceptSymbolName.REF_INCOME_GROSS;

            string testClassName = PayrollConceptFactory.ClassNameFor(testSpecName.Name);

            Assert.AreEqual(testClassName, "IncomeGrossConcept");
        }
Ejemplo n.º 11
0
        public T EmptyInstanceForCode(Assembly configAssembly, uint configCode)
        {
            SymbolName configSymbol = GetSymbol(configCode);

            T emptyInstance = InstanceFor(configAssembly, configSymbol);

            return(emptyInstance);
        }
Ejemplo n.º 12
0
        public static IPayrollConcept CreateConcept(SymbolName concept,
                                                    bool nodeContract, bool nodePosition, bool qualContract, bool qualPosition,
                                                    string targetValues, string resultValues, GeneralModule.EvaluateDelegate evaluate)
        {
            IPayrollConcept conceptInstance = new GeneralPayrollConcept(concept,
                                                                        nodeContract, nodePosition, qualContract, qualPosition, targetValues, resultValues, evaluate);

            return(conceptInstance);
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Adds one or more Character objects.
        /// </summary>
        public Character AddCharacter(SymbolName symbolType, int count)
        {
            Character character = new Character();

            Add(character);
            character.SymbolName = symbolType;
            character.Count      = count;
            return(character);
        }
Ejemplo n.º 14
0
 public void EnemyClick()
 {
     if (value == SymbolName.N)
     {
         value = GameController.instance.enemySymbol;
         UpdateGraphics();
         GameController.instance.CalculateRound();
     }
 }
Ejemplo n.º 15
0
 public IPayrollConcept ConfigureConcept(SymbolName concept,
                                         bool nodeContract, bool nodePosition, bool qualContract, bool qualPosition,
                                         string targetValues, string resultValues,
                                         GeneralModule.EvaluateDelegate evaluate)
 {
     return(ConceptsCollection.ConfigureConcept(
                concept, nodeContract, nodePosition, qualContract, qualPosition,
                targetValues, resultValues, evaluate));
 }
Ejemplo n.º 16
0
        public async void TestSymbol(string feedName)
        {
            var packageName = new PackageName("packageId", "1.0");
            var symbolName  = new SymbolName("imageName", "imageHash");
            var feed        = Storage.GetFeed(feedName);

            var symbol = feed.GetSymbol(packageName, symbolName);

            await TestItemRoundtrip(symbol);
        }
Ejemplo n.º 17
0
        public void Should_Compare_Different_Symbols_AsGreater()
        {
            SymbolName testSymbolOne = new SymbolName(testSymbolCode1001, "Begining Symbol");

            SymbolName testSymbolTwo = new SymbolName(testSymbolCode5001, "Terminal Symbol");

            Assert.AreNotEqual(testSymbolTwo, testSymbolOne);

            Assert.Greater(testSymbolTwo, testSymbolOne);
        }
Ejemplo n.º 18
0
 public void UserClick()
 {
     if (value == SymbolName.N)
     {
         value = GameController.instance.playerSymbol;
         UpdateGraphics();
         GameController.instance.CalculateRound();
         GameController.instance.EnemySelectRandom();
     }
 }
Ejemplo n.º 19
0
        public void Combine_should_qualify_member_with_type(SymbolType symbolType)
        {
            var actual = MetadataName.Combine(
                TypeName.Parse("String"),
                SymbolName.Parse("Length").ConvertTo(symbolType)
                );

            Assert.Equal(symbolType, actual.SymbolType);
            Assert.Equal("String.Length", actual.FullName);
        }
Ejemplo n.º 20
0
 public IPayrollArticle ConfigureArticle(SymbolName article,
                                         SymbolName concept, ProcessCategory category,
                                         SymbolName[] pendingNames, SymbolName[] summaryNames,
                                         bool taxingIncome, bool healthIncome, bool socialIncome,
                                         bool grossSummary, bool nettoSummary, bool nettoDeducts)
 {
     return(ArticlesCollection.ConfigureArticle(
                article, concept, category, pendingNames, summaryNames,
                taxingIncome, healthIncome, socialIncome, grossSummary, nettoSummary, nettoDeducts));
 }
 public static IPayrollArticle CreateArticle(SymbolName article,
                                             SymbolName concept, ProcessCategory category,
                                             SymbolName[] pendingNames, SymbolName[] summaryNames,
                                             bool taxingIncome, bool healthIncome, bool socialIncome,
                                             bool grossSummary, bool nettoSummary, bool nettoDeducts)
 {
     return(new GeneralPayrollArticle(article, concept, category,
                                      pendingNames, summaryNames,
                                      taxingIncome, healthIncome, socialIncome, grossSummary, nettoSummary, nettoDeducts));
 }
        public IPayrollArticle ConfigureArticle(SymbolName article, SymbolName concept, ProcessCategory category,
                                                SymbolName[] pendingNames, SymbolName[] summaryNames,
                                                bool taxingIncome, bool healthIncome, bool socialIncome, bool grossSummary, bool nettoSummary, bool nettoDeducts)
        {
            IPayrollArticle articleInstance = GeneralPayrollArticle.CreateArticle(
                article, concept, category, pendingNames, summaryNames,
                taxingIncome, healthIncome, socialIncome, grossSummary, nettoSummary, nettoDeducts);

            return(ConfigureModel(articleInstance, article.Code));
        }
Ejemplo n.º 23
0
        public async void TestSymbolWithoutPackageName(string feedName)
        {
            var packageName = new PackageName("packageId", "1.0");
            var symbolName  = new SymbolName("imageName", "imageHash");
            var feed        = Storage.GetFeed(feedName);

            var symbol = feed.GetSymbol(packageName, symbolName);
            var symbolWithoutPackageName = feed.GetSymbol(null, symbolName);

            await TestPackageRelatedItemRoundtrip(packageName, symbol, symbolWithoutPackageName, "symbolContent");
        }
Ejemplo n.º 24
0
        private static SymbolName[] ToSymbolTable(this ICollection <KeyValuePair <SymbolId, string> > @this)
        {
            var symbols = new SymbolName[@this.Count];

            foreach (var kv in @this)
            {
                var idx = (int)kv.Key;
                symbols[idx] = new SymbolName(idx, kv.Value);
            }
            return(symbols);
        }
Ejemplo n.º 25
0
        public void Should_Return_UnknownArticle_From_Models()
        {
            SymbolName testSpecName = ArticleSymbolName.REF_UNKNOWN;

            IPayrollArticle testArticle = testConfig.FindArticle(testSpecName.Code);

            Type testTypeOfArticle = testArticle.GetType();

            Assert.AreSame(typeof(UnknownArticle), testTypeOfArticle);

            Assert.AreEqual(testArticle.ArticleCode(), testSpecName.Code);
        }
Ejemplo n.º 26
0
        public void Should_Return_UnknownConcept_From_Models()
        {
            SymbolName testSpecName = ConceptSymbolName.REF_UNKNOWN;

            IPayrollConcept testConcept = testConfig.FindConcept(testSpecName.Code);

            Type testTypeOfConcept = testConcept.GetType();

            Assert.AreSame(typeof(UnknownConcept), testTypeOfConcept);

            Assert.AreEqual(testConcept.ConceptCode(), testSpecName.Code);
        }
        public void Should_Return_UnknownConcept_As_TypeOf()
        {
            SymbolName testSpecName = ConceptSymbolName.REF_UNKNOWN;

            Assembly configAssembly = typeof(ProcessConfigSetCzModule).Assembly;

            IPayrollConcept testConcept = PayrollConceptFactory.ConceptFor(configAssembly, testSpecName.Name);

            Type testTypeOfConcept = testConcept.GetType();

            Assert.AreSame(typeof(UnknownConcept), testTypeOfConcept);
        }
Ejemplo n.º 28
0
        public void Should_Return_UnknownArticle_As_TypeOf()
        {
            SymbolName testSpecName = ConfigSetCzArticleName.REF_UNKNOWN;

            Assembly configAssembly = typeof(ProcessConfigSetCzModule).Assembly;

            IPayrollArticle testArticle = PayrollArticleFactory.ArticleFor(configAssembly, testSpecName.Name);

            Type testTypeOfArticle = testArticle.GetType();

            Assert.AreSame(typeof(UnknownArticle), testTypeOfArticle);
        }
Ejemplo n.º 29
0
        private static IPayrollArticle[] CollectRelatedArticles(IDictionary <uint, IPayrollArticle[]> initialDict,
                                                                uint articleCode, IPayrollArticle[] pendingArticles, IDictionary <uint, IPayrollArticle[]> pendingDict,
                                                                IProcessConfigLogger logger)
        {
            var callingArticles = new SymbolName[0];

            var relatedList = pendingArticles.Aggregate(new IPayrollArticle[0],
                                                        (agr, article) => agr.Concat(ResolveArticleDependency(initialDict, article, callingArticles, pendingDict, logger)).ToArray());

            var articleList = relatedList.Distinct().OrderBy(x => x.ArticleSymbol()).ToArray();

            return(articleList);
        }
Ejemplo n.º 30
0
    private bool FindMatch(out SymbolName winner, ItemBehaviour[,] items)
    {
        int rayCount = 2;

        for (int i = 0; i < items.GetLength(0); i++)
        {
            for (int j = 0; j < items.GetLength(1); j++)
            {
                //horizontal
                if ((items.GetLength(1) - j) > rayCount && items[j, i].value != SymbolName.N)
                {
                    if (items[j, i].value == items[j + 1, i].value && items[j, i].value == items[j + 2, i].value)
                    {
                        winner = items [j, i].value;
                        return(true);
                    }
                }
                //vertical
                if ((items.GetLength(0) - i) > rayCount && items[j, i].value != SymbolName.N)
                {
                    if (items[j, i].value == items[j, i + 1].value && items[j, i].value == items[j, i + 2].value)
                    {
                        winner = items [j, i].value;
                        return(true);
                    }
                }
                //diagonal direito
                if (((items.GetLength(1) - j) > rayCount && (items.GetLength(0) - i) > rayCount) && items[j, i].value != SymbolName.N)
                {
                    if (items[j, i].value == items[j + 1, i + 1].value && items[j, i].value == items[j + 2, i + 2].value)
                    {
                        winner = items [j, i].value;
                        return(true);
                    }
                }

                bool isTopRight = j == items.GetLength(0) - 1 && i == 0;
                //diagonal esquerdo
                if (((j - rayCount) > rayCount && (i - rayCount) > rayCount || isTopRight) && items[j, i].value != SymbolName.N)
                {
                    if (items[j, i].value == items[j - 1, i + 1].value && items[j, i].value == items[j - 2, i + 2].value)
                    {
                        winner = items [j, i].value;
                        return(true);
                    }
                }
            }
        }
        winner = SymbolName.N;
        return(false);
    }
Ejemplo n.º 31
0
        public XElement ToKml()
        {
            var placeMark = new XElement("Placemark");

            placeMark.Add(new XElement("name", Name));
            placeMark.Add(new XElement("description", Description));
            if (!string.IsNullOrEmpty(SymbolName))
            {
                var url = string.Format("#{0}", SymbolName.ToLowerInvariant());
                placeMark.Add(new XElement("styleUrl", url));
            }
            placeMark.Add(Geometry.ToKml());
            return(placeMark);
        }
Ejemplo n.º 32
0
        internal NamedVariable CreateVariable(Sort sort, string name = null)
        {
            Contract.Requires(sort != null);

            var symbolName = new SymbolName(name, this.lastVariableNumber++);

            this.lastVariableNumber++;

            var variable = ExpressionFactory.NamedVariable(sort, symbolName);

            this.customVariables.Add(variable);

            return(variable);
        }
Ejemplo n.º 33
0
 /// <summary>
 /// Adds one or more Character objects.
 /// </summary>
 public Character AddCharacter(SymbolName symbolType, int count)
 {
   Character character = new Character();
   this.Add(character);
   character.SymbolName = symbolType;
   character.Count = count;
   return character;
 }
Ejemplo n.º 34
0
 /// <summary>
 /// Adds one or more Symbol objects.
 /// </summary>
 public Character AddCharacter(SymbolName symbolType, int count)
 {
   return this.Elements.AddCharacter(symbolType, count);
 }
Ejemplo n.º 35
0
 /// <summary>
 /// Adds a Character object.
 /// </summary>
 public Character AddCharacter(SymbolName symbolType)
 {
   return AddCharacter(symbolType, 1);
 }
Ejemplo n.º 36
0
 /// <summary>
 /// Adds a Symbol object.
 /// </summary>
 public Character AddCharacter(SymbolName symbolType)
 {
   return this.Elements.AddCharacter(symbolType);
 }