private void _LoadList()
        {
            const int ConstDisplayName            = 0;
            const int ConstProfileStateProduction = 1;
            const int ConstProfileStateShadow     = 2;
            const int ConstChgNumber = 3;

            using (new UpdateHelper(m_TreeList))
            {
                m_Proxy.Clear();

                // Daten holen und prüfen
                ISingleDbObject dbobject = m_MainActivator.DbObject;

                if (dbobject == null)
                {
                    return;
                }

                var runner = Session.Resolve <IStatementRunner>();
                using (IDataReader reader = new CachedDataReader(runner.SqlExecute("SDL-FormAppServerDriverProfile", new List <QueryParameter>()
                {
                    new QueryParameter("UID_ApplicationServer", ValType.String, FormTool.GetValueSafe(dbobject, "UID_ApplicationServer", ""))
                })))
                {
                    while (reader.Read())
                    {
                        ITreeListNode node = m_Proxy.AddNode(reader.GetString(ConstDisplayName), (int)StockImage.DriverProfile);
                        m_Proxy.AddItem(node, reader.GetString(ConstProfileStateProduction));
                        m_Proxy.AddItem(node, reader.GetString(ConstProfileStateShadow));
                        m_Proxy.AddItem(node, reader.GetString(ConstChgNumber));
                    }
                }
            }
        }
Beispiel #2
0
        public IEnumerator <T> GetEnumerator()
        {
            if (this.root == null)
            {
                this.root = new TreeListLeafNode <T>(this.nodesize);
            }

            return(this.root.Elements.GetEnumerator());
        }
Beispiel #3
0
        public void Add(T element)
        {
            if (this.root == null)
            {
                this.root = new TreeListLeafNode <T>(this.nodesize);
            }

            this.root = this.root.Add(element);
            count++;
        }
        private void _Load(VI.Controls.Interfaces.ITreeListControl treeList, bool loadApps)
        {
            ITreeListProxy proxy = treeList.Proxy;

            using (new UpdateHelper(treeList))
            {
                proxy.Clear();

                // Daten holen und prüfen
                ISingleDbObject dbobject = m_MainActivator.DbObject;

                if (dbobject == null)
                {
                    return;
                }

                IColDbObject col = Connection.CreateCol("MachineAppsInfo");
                col.Prototype["displayname"].IsDisplayItem          = true;
                col.Prototype["CurrentlyActive"].IsDisplayItem      = true;
                col.Prototype["Installdate"].IsDisplayItem          = true;
                col.Prototype["deinstalldate"].IsDisplayItem        = true;
                col.Prototype["revision"].IsDisplayItem             = true;
                col.Prototype["UID_OS"].IsDisplayItem               = true;
                col.Prototype["UID_InstallationType"].IsDisplayItem = true;

                col.Prototype.WhereClause = SqlFormatter.AndRelation(!FormTool.CanSee(dbobject, "UID_HardWare") ? "1=2" :
                                                                     SqlFormatter.UidComparison("UID_Hardware", dbobject["UID_HardWare"].New.String),
                                                                     SqlFormatter.Comparison("AppsNotDriver", loadApps, ValType.Bool));
                col.Prototype.OrderBy = "Displayname, Installdate, DeInstallDate";
                col.Load(CollectionLoadType.ForeignDisplays);

                foreach (IColElem elem in col)
                {
                    ITreeListNode      node = proxy.AddNode(elem.GetDisplayValue("displayname"), (int)VI.ImageLibrary.StockImage.ApplicationProfile);
                    ITreeListItemSmall item = proxy.CreateCheckBoxItem(elem.GetValue("CurrentlyActive").Bool);
                    item.Enabled = false;
                    proxy.AddItem(node, item);

                    DateTime date = elem.GetValue("Installdate").Date;
                    item      = proxy.AddItem(node, DbVal.IsEmpty(date, ValType.Date) ? "" : date.ToString());
                    item.Data = date;

                    date      = elem.GetValue("deinstalldate").Date;
                    item      = proxy.AddItem(node, DbVal.IsEmpty(date, ValType.Date) ? "" : date.ToString());
                    item.Data = date;

                    item      = proxy.AddItem(node, elem["Revision"]);
                    item.Data = elem.GetValue("Revision").Int;

                    proxy.AddItem(node, elem.GetDisplayValue("UID_OS"));
                    proxy.AddItem(node, elem.GetDisplayValue("UID_InstallationType"));
                }
            }
        }
        private void _LoadProtocols()
        {
            ITreeListProxy proxy = m_TreeListProtocols.Proxy;

            using (new UpdateHelper(m_TreeListProtocols))
            {
                proxy.Clear();

                // Daten holen und prüfen
                ISingleDbObject dbobject = m_MainActivator.DbObject;

                if (dbobject == null)
                {
                    return;
                }

                IColDbObject col = Connection.CreateCol("ADSAccountAppsInfo");
                col.Prototype["displayname"].IsDisplayItem          = true;
                col.Prototype["CurrentlyActive"].IsDisplayItem      = true;
                col.Prototype["Installdate"].IsDisplayItem          = true;
                col.Prototype["deinstalldate"].IsDisplayItem        = true;
                col.Prototype["revision"].IsDisplayItem             = true;
                col.Prototype["UID_OS"].IsDisplayItem               = true;
                col.Prototype["UID_InstallationType"].IsDisplayItem = true;

                col.Prototype.WhereClause = !FormTool.CanSee(dbobject, "UID_ADSAccount") ? "1=2" :
                                            SqlFormatter.UidComparison("UID_ADSAccount", FormTool.GetValueSafe(dbobject, "UID_ADSAccount", ""));
                col.Prototype.OrderBy = "displayname";
                col.Load(CollectionLoadType.ForeignDisplays);

                foreach (IColElem elem in col)
                {
                    ITreeListNode      node = proxy.AddNode(elem.GetDisplayValue("displayname"), (int)VI.ImageLibrary.StockImage.ApplicationProfile);
                    ITreeListItemSmall item = proxy.CreateCheckBoxItem(elem.GetValue("CurrentlyActive").Bool);
                    item.Enabled = false;
                    proxy.AddItem(node, item);
                    proxy.AddItem(node, elem["Installdate"]);
                    proxy.AddItem(node, elem["deinstalldate"]);
                    proxy.AddItem(node, elem["Revision"]);
                    proxy.AddItem(node, elem.GetDisplayValue("UID_OS"));
                    proxy.AddItem(node, elem.GetDisplayValue("UID_InstallationType"));
                }
            }
        }
Beispiel #6
0
 public TreeListNode(ITreeListNode <T> firstchild)
     : this(firstchild.Size, (ushort)(firstchild.Level + 1))
 {
     this.subnodes[this.count++] = firstchild;
 }