Beispiel #1
0
        public void Evaluate(int SpreadMax)
        {
            if (FUpdate[0] || (fcr == 0))
            {
                SpreadMax = FName.SliceCount;

                FormularDictionary.Change(ThisNode);

                for (int i = 0; i < SpreadMax; i++)
                {
                    var dict = FormularDictionary.Instance;

                    if (dict.ContainsKey(FName[i]))
                    {
                        dict[FName[i]] = FDefinition[i];
                    }
                    else
                    {
                        dict.Add(FName[i], FDefinition[i]);
                    }
                }
                FormularDictionary.Change(ThisNode);
            }
            fcr++;
        }
Beispiel #2
0
        protected void FormularUpdate()
        {
            FormularDictionary dict = FormularDictionary.Instance;

            if (FFormular.IsChanged)
            {
                List <string> fields      = new List <string>();
                List <string> fieldslower = new List <string>();
                for (int i = 0; i < FFormular.SliceCount; i++)
                {
                    if (FFormular[i].Name != "None")
                    {
                        string   currform     = dict[FFormular[i].Name];
                        string[] splittedform = currform.Trim().Split(',');
                        foreach (string f in splittedform)
                        {
                            string   ft   = f.Trim();
                            string   ftl  = ft.ToLower();
                            string[] sftl = ftl.Split(' ');
                            if (sftl.Length == 2)
                            {
                                if (!fieldslower.Contains(sftl[1].Trim()))
                                {
                                    fields.Add(ft);
                                    fieldslower.Add(sftl[1].Trim());
                                }
                            }
                        }
                    }
                }
                string definition = "";
                for (int i = 0; i < fields.Count; i++)
                {
                    if (i == 0)
                    {
                        definition = fields[0];
                    }
                    else
                    {
                        definition += ", " + fields[i];
                    }
                }
                if (definition != "")
                {
                    FDefinition[0] = definition;
                }
                ChangePins();
            }
        }
Beispiel #3
0
        void OnFormularChanged(object sender, EventArgs e)
        {
            FormularDictionary dict = FormularDictionary.Instance;

            if (dict.Count == 0)
            {
                EnumManager.UpdateEnum("PrimitiveObjectFormularSelector", "None", new string[1] {
                    "None"
                });
            }

            List <string> formulars = new List <string>()
            {
                "None"
            };

            foreach (string k in dict.Keys)
            {
                formulars.Add(k);
            }
            EnumManager.UpdateEnum("PrimitiveObjectFormularSelector", "None", formulars.ToArray());
        }