Example #1
0
            private ListBox.ObjectCollection quicksort(ListBox.ObjectCollection list)
            {
                ListBox.ObjectCollection sorted = new ListBox.ObjectCollection(new ListBox());
                sorted.AddRange(list);

                if (sorted.Count <= 1)
                {
                    return(sorted);
                }

                int random = randomNumberGenerator.Next(0, sorted.Count - 1);

                string pivot = (string)list[random];

                sorted.RemoveAt(random);

                ListBox.ObjectCollection lessThan    = new ListBox.ObjectCollection(new ListBox());
                ListBox.ObjectCollection greaterThan = new ListBox.ObjectCollection(new ListBox());

                for (int i = 0; i < sorted.Count; ++i)
                {
                    sortItem(sorted[i], pivot, lessThan, greaterThan);
                }

                sorted = quicksort(lessThan);
                sorted.Add(pivot);
                sorted.AddRange(quicksort(greaterThan));

                return(sorted);
            }
Example #2
0
    private void _47uIeAt3CL9eFAtlSoyGwQU3wMs(string filter = "")
    {
        filter = filter.ToLower();
        _93gIKT2AuhpAu6Mg44FufhOwddm.Items.Clear();
        ListBox.ObjectCollection items = _93gIKT2AuhpAu6Mg44FufhOwddm.Items;
        object[] items2 = (from type in ResourceDownloader._VPArsrlUa0uEsW6OxAYV9WHJAMK._oQlNWqxOoe5LqobGdGJlgo4YIsh.Values
                           where type.Enemy
                           select type.Name).Where(delegate(string name)
        {
            if (!(filter == ""))
            {
                while (true)
                {
                    uint num;
                    switch ((num = 0x506972D3u ^ 0x4EC17E12u) % 3u)
                    {
                    case 0u:
                        continue;

                    case 1u:
                        return(name.ToLower().Contains(filter));
                    }
                    break;
                }
            }
            return(true);
        }).ToArray();
        items.AddRange(items2);
    }
Example #3
0
 public ControlPanelForm()
 {
     _LNN7j16YxFjRwCTXxBG3QnekdGe();
     ListBox.ObjectCollection items = _0tDYu1wkyKBkjLMcGP57spRp1Mb.Items;
     object[] items2 = Settings.Default.SavedAccounts.Cast <string>().ToArray();
     items.AddRange(items2);
 }
        // Token: 0x06000097 RID: 151 RVA: 0x00005158 File Offset: 0x00003358
        private void buttonParamList_Click(object sender, EventArgs e)
        {
            Autodesk.Revit.ApplicationServices.Application application = this.p_commandData.Application.Application;
            Document document = this.p_commandData.Application.ActiveUIDocument.Document;
            FilteredElementCollector filteredElementCollector = new FilteredElementCollector(document);
            ICollection <Element>    collection = filteredElementCollector.OfClass(typeof(FamilyInstance)).ToElements();
            List <string>            list       = new List <string>();
            int  num  = 1;
            bool flag = this.listBoxParameters != null;

            if (flag)
            {
                this.listBoxParameters.Items.Clear();
                num = 1;
            }
            foreach (Element element in collection)
            {
                FamilyInstance familyInstance = element as FamilyInstance;
                bool           flag2          = familyInstance != null;
                if (flag2)
                {
                    bool flag3 = string.Concat(new string[]
                    {
                        familyInstance.Symbol.Category.Name,
                        " : ",
                        familyInstance.Symbol.Family.Name,
                        " : ",
                        familyInstance.Symbol.Name
                    }) == this.FamilySymbolNames;
                    if (flag3)
                    {
                        bool flag4 = num < 2;
                        if (flag4)
                        {
                            foreach (object obj in familyInstance.Parameters)
                            {
                                Parameter parameter = (Parameter)obj;
                                bool      flag5     = parameter.Definition.ParameterType == ParameterType.Angle;
                                if (flag5)
                                {
                                    StringBuilder stringBuilder = new StringBuilder();
                                    stringBuilder.Append(parameter.Definition.Name);
                                    bool flag6 = !list.Contains(stringBuilder.ToString());
                                    if (flag6)
                                    {
                                        list.Add(stringBuilder.ToString());
                                    }
                                }
                            }
                            list.Sort();
                            ListBox.ObjectCollection items = this.listBoxParameters.Items;
                            object[] items2 = list.ToArray();
                            items.AddRange(items2);
                            this.listBoxParameters.SelectionMode = SelectionMode.One;
                            num++;
                        }
                    }
                }
            }
        }
 // Token: 0x0600058E RID: 1422 RVA: 0x00023518 File Offset: 0x00021718
 public _kzbOEABEghRPGNYW29gk2hy2kpe()
 {
     this._FIaDtqWJBkvPLGAHiTMH85gkm0f();
     ListBox.ObjectCollection items = this._cg0FfO3yAv7bEEBoZg3OK4RqNxg.Items;
     object[] items2 = Settings.Default.SavedAccounts.Cast <string>().ToArray <string>();
     items.AddRange(items2);
 }
 // Token: 0x06000561 RID: 1377 RVA: 0x00020260 File Offset: 0x0001E460
 public _3epUp89nX32qcURFompyGb29FFH()
 {
     this._FIaDtqWJBkvPLGAHiTMH85gkm0f();
     ListBox.ObjectCollection items = this._JJkvI0iec5HhxVHQ7okG89EgkOv.Items;
     object[] items2 = Settings.Default.FameIngoredEnemies.Select(new Func <int, ObjectStructure>(_3epUp89nX32qcURFompyGb29FFH._qdlkGmn0olvAHtUU1NApb4QOAAD.< > 9._EVTxd4FutMXcbddiAynenLmYFct)).Where(new Func <ObjectStructure, bool>(_3epUp89nX32qcURFompyGb29FFH._qdlkGmn0olvAHtUU1NApb4QOAAD.< > 9._iaMumB66yrjbxwC5cOmDetlbF79)).Select(new Func <ObjectStructure, string>(_3epUp89nX32qcURFompyGb29FFH._qdlkGmn0olvAHtUU1NApb4QOAAD.< > 9._0den32egAr0cKX0iVwV8NiASMtp)).ToArray <string>();
     items.AddRange(items2);
     this._8Y1BnHR7y3GUz2633Ga83YHkjuh("");
     this._NmKCZ9UNVe2ErB5WyHRh62MNt3l.SelectedIndex = 0;
     this._JJkvI0iec5HhxVHQ7okG89EgkOv.SelectedIndex = -1;
 }
 // Token: 0x06000564 RID: 1380 RVA: 0x00020364 File Offset: 0x0001E564
 private void _8Y1BnHR7y3GUz2633Ga83YHkjuh(string filter = "")
 {
     _3epUp89nX32qcURFompyGb29FFH._XZORrafniN0joJMdlgEofnqnt2k xzorrafniN0joJMdlgEofnqnt2k = new _3epUp89nX32qcURFompyGb29FFH._XZORrafniN0joJMdlgEofnqnt2k();
     xzorrafniN0joJMdlgEofnqnt2k._Wcsyk4fpkP7CcKtnbgGHtDKh3LbA = filter;
     xzorrafniN0joJMdlgEofnqnt2k._Wcsyk4fpkP7CcKtnbgGHtDKh3LbA = xzorrafniN0joJMdlgEofnqnt2k._Wcsyk4fpkP7CcKtnbgGHtDKh3LbA.ToLower();
     this._NmKCZ9UNVe2ErB5WyHRh62MNt3l.Items.Clear();
     ListBox.ObjectCollection items = this._NmKCZ9UNVe2ErB5WyHRh62MNt3l.Items;
     object[] items2 = _JzyrOApzC09RC3fmb10FDURmyCl.Objects.Map.Values.Where(new Func <ObjectStructure, bool>(_3epUp89nX32qcURFompyGb29FFH._qdlkGmn0olvAHtUU1NApb4QOAAD.< > 9._OXi9CcRvYwj6n7zNJuSufOBUSvH)).Select(new Func <ObjectStructure, string>(_3epUp89nX32qcURFompyGb29FFH._qdlkGmn0olvAHtUU1NApb4QOAAD.< > 9._tZeac4BCRa46WM4A0qQFX014MrY)).Where(new Func <string, bool>(xzorrafniN0joJMdlgEofnqnt2k._bKvB6It4vCTQjQ5I4sGikvOF7QP)).ToArray <string>();
     items.AddRange(items2);
 }
        private static void AddFeature(String feature
                                       , ListBox.ObjectCollection items)
        {
            List <String> features = new List <String>(items.Cast <String>());

            features.Add(feature);
            features.Sort();

            items.Clear();
            items.AddRange(features.ToArray());
        }
Example #9
0
 // Token: 0x0600009D RID: 157 RVA: 0x0000A2D8 File Offset: 0x000084D8
 public PluginManager()
 {
     this.InitializeComponent();
     BotManager.Instance.SizeChanged    += this.Root_SizeChanged;
     BotManager.Instance.VisibleChanged += this.Root_VisibleChanged;
     this.lstLoaded.DisplayMember        = "Name";
     if (Program.PluginsManager.LoadedPlugins.Count > 0)
     {
         ListBox.ObjectCollection items = this.lstLoaded.Items;
         object[] items2 = Program.PluginsManager.LoadedPlugins.ToArray();
         items.AddRange(items2);
         this.lstLoaded.SelectedIndex = 0;
     }
 }
Example #10
0
        // ----------------------------------
        //		Methods-subscribers below
        // ----------------------------------


        private void View_FigureList_IndexChanged(object sender, int index)
        {
            if (index >= 0)
            {
                var points = (_figuresBuffer[index] as FigureDrawer).Adapter.GetRawPoints();

                object[] pts = new object[points.Length];

                points.CopyTo(pts, 0);

                _pointsBuffer.Clear();
                _pointsBuffer.AddRange(pts);
            }
        }
Example #11
0
        private void View_OnReadFromFileButton_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog dialog = new OpenFileDialog())
            {
                dialog.Filter = "Text files(*.txt)|*.txt";

                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    var serializer = AppDependencies.CreateSerializer();

                    try
                    {
                        var figures = serializer.Deserialize(dialog.FileName);

                        _figuresBuffer.AddRange(figures.ToArray());
                        _outFigures.AddRange(figures.ToArray());
                    }
                    catch (Exception err)
                    {
                        _view.ShowError(err);
                    }
                }
            }
        }
Example #12
0
    public IgnoreEnemiesForm()
    {
        while (true)
        {
            int num = 744211026;
            while (true)
            {
                uint num2;
                switch ((num2 = (uint)num ^ 0x5F8A8505u) % 5u)
                {
                case 3u:
                    break;

                default:
                    return;

                case 2u:
                    _LNN7j16YxFjRwCTXxBG3QnekdGe();
                    num = (int)((num2 * 1945880750) ^ 0x6029621B);
                    continue;

                case 4u:
                {
                    ListBox.ObjectCollection items = _TQVy1n9sXJC4L2B1RVg2HB1vFwg.Items;
                    object[] items2 = (from id in Settings.Default.FameIngoredEnemies
                                       select ResourceDownloader._VPArsrlUa0uEsW6OxAYV9WHJAMK.ById((ushort)id) into type
                                       where type.Enemy
                                       select type.Name).ToArray();
                    items.AddRange(items2);
                    _47uIeAt3CL9eFAtlSoyGwQU3wMs();
                    _93gIKT2AuhpAu6Mg44FufhOwddm.SelectedIndex = 0;
                    num = 248912664;
                    continue;
                }

                case 0u:
                    _TQVy1n9sXJC4L2B1RVg2HB1vFwg.SelectedIndex = -1;
                    num = ((int)num2 * -871994711) ^ -183245817;
                    continue;

                case 1u:
                    return;
                }
                break;
            }
        }
    }
Example #13
0
        private void ReadRunningApps()
        {
            lock (iniObj)
            {
                runningApps = new List <ProcessModel>();
                var iniFile = new IniFile();
                var procs   = iniFile.Read("RunningProcesses");
                if (!string.IsNullOrWhiteSpace(procs))
                {
                    var savedProcs = procs.Split(',').ToArray();
                    foreach (var savedProc in savedProcs)
                    {
                        var split = savedProc.Split(';').ToArray();

                        var proc = new ProcessModel
                        {
                            ProcessName    = split.Length > 0 ? split[0] : savedProc,
                            ProcessTitle   = split.Length > 1 ? split[1] : savedProc,
                            CreatedFromExe = split.Length > 2 ? split[2] == "Y" : false
                        };

                        if (!savedSelectedApps.Any(x => x.ProcessName == proc.ProcessName || x.ProcessTitle == proc.ProcessTitle))
                        {
                            runningApps.Add(proc);
                        }
                    }
                }

                dispatch.BeginInvoke(
                    DispatcherPriority.Normal,
                    (Action)(() =>
                {
                    lock (lockObj)
                    {
                        var objCol = new ListBox.ObjectCollection(procBox);
                        objCol.AddRange(runningApps.ToArray());
                        procBox.Items.Clear();
                        procBox.Items.AddRange(objCol);
                    }
                }));
            }
        }
Example #14
0
        private void AddLabels()
        {
            var fileEditor = DockingService.ActiveDocument as AbstractFileEditor;

            if (fileEditor == null)
            {
                return;
            }

            FilePath fileName = fileEditor.FileName;

            if (fileName == null)
            {
                return;
            }

            ParserInformation info = _parserService.GetParserInfo(fileName);

            if (info == null)
            {
                ClearLabels();
                return;
            }

            bool showEquates = includeEquatesBox.Checked;

            ListBox.ObjectCollection labelsToAdd = new ListBox.ObjectCollection(labelsBox);

            var labels = info.Where(d => (d is Label && !((Label)d).IsReusable) ||
                                    ((d is Equate || d is Define || d is Macro) && showEquates))
                         .Cast <object>().ToArray();

            labelsToAdd.AddRange(labels);

            labelsBox.Items.Clear();
            labelsBox.Items.AddRange(labelsToAdd);
        }
Example #15
0
        // Token: 0x060000A1 RID: 161 RVA: 0x0000A420 File Offset: 0x00008620
        private void btnLoad_Click(object sender, EventArgs e)
        {
            string text;

            if (File.Exists(text = this.txtPlugin.Text))
            {
                if (this.chkAutoload.Enabled && this.chkAutoload.Checked)
                {
                    string text2 = Path.Combine(Program.PluginsPath, Path.GetFileName(text));
                    if (!File.Exists(text2))
                    {
                        try
                        {
                            File.Copy(text, text2);
                            text = text2;
                            this.txtPlugin.Text = text;
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show(string.Format("Unable to copy {0} to {1}\n{2}", text, text2, ex.Message));
                        }
                    }
                }
                if (Program.PluginsManager.Load(text))
                {
                    this.txtPlugin.Clear();
                    this.lstLoaded.Items.Clear();
                    ListBox.ObjectCollection items = this.lstLoaded.Items;
                    object[] items2 = Program.PluginsManager.LoadedPlugins.ToArray();
                    items.AddRange(items2);
                    this.lstLoaded.SelectedIndex = this.lstLoaded.Items.Count - 1;
                    return;
                }
                MessageBox.Show(Program.PluginsManager.LastError, "Grimoire", MessageBoxButtons.OK, MessageBoxIcon.Hand);
            }
        }
 public static void LoadFromFile(this ListBox.ObjectCollection sender, string FileName)
 {
     sender.AddRange(System.IO.File.ReadAllLines(FileName));
 }
 public static void ClearThenAddRange(this ListBox.ObjectCollection @this, string[] data)
 {
     @this.Clear();
     @this.AddRange(data);
 }
Example #18
0
        private void LoadProcesses(ProcessModel savedExe = null)
        {
            lock (cObj)
            {
                var       procs = Process.GetProcesses();
                RECT      appBounds;
                Rectangle screenBounds;
                var       shellWindow    = GetShellWindow();
                var       desktopWindow  = GetDesktopWindow();
                var       curProcessName = Process.GetCurrentProcess().ProcessName;

                var fullScreenProcs = new List <ProcessModel>();
                var normalProcs     = new List <ProcessModel>();
                var running         = new List <ProcessModel>();

                foreach (var proc in procs)
                {
                    var hWnd = proc.MainWindowHandle;

                    if (desktopWindow == hWnd)
                    {
                        continue;
                    }
                    if (shellWindow == hWnd)
                    {
                        continue;
                    }
                    if (!IsWindowVisible(hWnd))
                    {
                        continue;
                    }
                    if (GetWindowTextLength(hWnd) == 0)
                    {
                        continue;
                    }

                    GetWindowRect(hWnd, out appBounds);

                    if (!savedSelectedApps.Any(x => x.ProcessName == proc.ProcessName) &&
                        proc.ProcessName != curProcessName &&
                        appBounds.Size.Width > 0 && appBounds.Size.Height > 0)
                    {
                        screenBounds = Screen.FromHandle(hWnd).Bounds;
                        var model = new ProcessModel
                        {
                            ProcessName  = proc.ProcessName,
                            ProcessTitle = GetProcessFileName(proc)
                        };
                        //if ((appBounds.Bottom - appBounds.Top) == screenBounds.Height && (appBounds.Right - appBounds.Left) == screenBounds.Width)
                        //{

                        //}
                        if (!running.Any(x => x.ProcessName == model.ProcessName || x.ProcessTitle == model.ProcessTitle))
                        {
                            running.Add(model);
                        }
                    }
                }

                lock (lockObj)
                {
                    if (savedExe != null)
                    {
                        var runningExe2 = running.FirstOrDefault(x => x.ProcessName == savedExe.ProcessName || x.ProcessTitle == savedExe.ProcessTitle);
                        if (runningExe2 == null)
                        {
                            running.Add(savedExe);
                        }
                        else
                        {
                            runningExe2.CreatedFromExe = true;
                        }
                    }

                    foreach (var addedExe in this.runningApps.Where(x => x.CreatedFromExe))
                    {
                        var runningExe = running.FirstOrDefault(x => x.ProcessName == addedExe.ProcessName || x.ProcessTitle == addedExe.ProcessTitle);
                        if (runningExe == null)
                        {
                            running.Add(addedExe);
                        }
                        else
                        {
                            runningExe.CreatedFromExe = true;
                        }
                    }

                    if (running.Any(x => !this.runningApps.Any(y => (y.ProcessName == x.ProcessName || y.ProcessTitle == x.ProcessTitle) && x.CreatedFromExe == y.CreatedFromExe)) ||
                        this.runningApps.Any(x => !running.Any(y => (y.ProcessName == x.ProcessName || y.ProcessTitle == x.ProcessTitle) && x.CreatedFromExe == y.CreatedFromExe)))
                    {
                        this.runningApps = running;
                        SaveRunningApps();

                        dispatch.BeginInvoke(
                            DispatcherPriority.Normal,
                            (Action)(() =>
                        {
                            lock (lockObj)
                            {
                                var objCol = new ListBox.ObjectCollection(procBox);

                                objCol.AddRange(running.ToArray());

                                procBox.Items.Clear();
                                procBox.Items.AddRange(objCol);
                            }
                        }));
                    }
                }
            }
        }
Example #19
0
 // Token: 0x06000187 RID: 391 RVA: 0x00002B24 File Offset: 0x00000D24
 static void smethod_4(ListBox.ObjectCollection objectCollection_0, object[] object_0)
 {
     objectCollection_0.AddRange(object_0);
 }