Esempio n. 1
0
        public AssignDomToVar(KBObject obj)
        {
            InitializeComponent();

            objName.Text = obj.Name + " (" + obj.TypeDescriptor.Name + "): " + obj.Description;
            objSource    = ObjectsHelper.ObjectSource(obj);
            objRules     = obj.Parts.Get <RulesPart>().Source;

            model = obj.Model;


            VariablesPart vp = obj.Parts.Get <VariablesPart>();

            if (vp != null)
            {
                foreach (Variable v in vp.Variables)
                {
                    if ((!v.IsStandard) && (v.AttributeBasedOn == null) && (v.DomainBasedOn == null) && (v.Type != eDBType.GX_USRDEFTYP) &&
                        (v.Type != eDBType.GX_SDT) && (v.Type != eDBType.GX_EXTERNAL_OBJECT) && (v.Type != eDBType.Boolean) && v.Type != eDBType.GX_BUSCOMP && v.Type != eDBType.GX_BUSCOMP_LEVEL)
                    {
                        comboVar.Items.Add(new Item(v.Name + "  " + Utility.FormattedTypeVariable(v), v));
                    }
                    cantVariables.Text = comboVar.Items.Count.ToString() + " not based variables";
                }
            }
        }
Esempio n. 2
0
        private static void ListParmReferences(KBObject obj, string name, KBDoctorXMLWriter writer)
        {
            string source = ObjectsHelper.ObjectSource(obj);

            source = Functions.ExtractComments(source);
            string linesWithParmName = "";

            using (StringReader reader = new StringReader(source))
            {
                string line;
                while ((line = reader.ReadLine()) != null)
                {
                    if (line.ToUpper().Contains(name.ToUpper()))
                    {
                        linesWithParmName += line + Environment.NewLine + "<br>";
                    }
                }
            }
            writer.AddTableData(new string[] { Functions.linkObject(obj), name, linesWithParmName });
        }