Exemplo n.º 1
0
        private void ThreadUnsafeUpdatePartialTable(GlobalDS.Table NewTable)
        {
            // Search for this node
            bool     FoundNode = false;
            TreeNode tid       = null;
            TreeNode SearchID;

            for (int i = 0; i < tvwSchema.Nodes[0].Nodes[1].Nodes.Count; i++)
            {
                SearchID = tvwSchema.Nodes[0].Nodes[1].Nodes[i];

                if (SearchID.Nodes[0].Nodes[0].Text.Equals(NewTable.ObjectID.ToString()))
                {
                    tid       = SearchID;
                    FoundNode = true;
                    break;
                }
            }

            if (!FoundNode)
            {
                tid = tvwSchema.Nodes[0].Nodes[1].Nodes.Add(NewTable.Name);
            }

            tid.Nodes.Clear();
            tid.Nodes.Add("ID").Nodes.Add(NewTable.ObjectID.ToString());
            tid.Nodes.Add("Record Count").Nodes.Add(NewTable.RecordCount.ToString());
            tid.Nodes.Add("Fields").Nodes.Add("??? UNKNOWN ???");
        }
Exemplo n.º 2
0
        /// <summary>
        /// This is basically a "Make Things Thread Safe Mux"
        /// </summary>
        private void UnSafelyUpdateUI()
        {
            //TODO: There's lots of garbage to insert here
            lock (_ThreadGuiMutex)
            {
                switch ((LocalGuiAction)_LocalGuiQueue.Dequeue())
                {
                case LocalGuiAction.UsernameInfo:
                    tvwSchema.Nodes[0].Nodes[0].Nodes.Clear();
                    tvwSchema.Nodes[0].Nodes[0].Nodes.Add(_AbsintheState.Username);
                    break;

                case LocalGuiAction.ControlEnable:
                    ((Control)_LocalGuiQueue.Dequeue()).Enabled = (bool)_LocalGuiQueue.Dequeue();
                    break;

                case LocalGuiAction.RefreshTableInfo:
                    SafelyUpdateTableInfo();
                    break;

                case LocalGuiAction.PartialTableInfo:
                    GlobalDS.Table ModifiedTable = (GlobalDS.Table)_LocalGuiQueue.Dequeue();
                    ThreadUnsafeUpdatePartialTable(ModifiedTable);
                    break;

                case LocalGuiAction.FieldInfo:
                    SafelyUpdateTableInfo();
                    break;
                }
            }
        }
Exemplo n.º 3
0
        private void TargetAttackVector_TableChanged(GlobalDS.Table ChangedTable)
        {
            lock (_ThreadGuiMutex)
            {
                _LocalGuiQueue.Enqueue(LocalGuiAction.PartialTableInfo);
                _LocalGuiQueue.Enqueue(ChangedTable);
            }

            this.Invoke(new ThreadedSub(UnSafelyUpdateUI));
            _AbsintheState.PartialTable = ChangedTable;
        }