Exemple #1
0
        public void InitialScreen(string strSearch)
        {
            try
            {
                gvDetail.SetOISStyle();
                gvDetail.MappingEnum(typeof(eCol));

                dataList = vmMas.GetToolPick();

                SortableBindingList <sp_MAS308_GetToolPick_Result> result = new SortableBindingList <sp_MAS308_GetToolPick_Result>();
                result.AddRange(dataList);

                gvDetail.DataSource = result;

                txtSearch.Text = strSearch;

                if (id > 0)
                {
                    SelectedData = result.Where(x => x.ID == id).FirstOrDefault();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemple #2
0
        public void InitialScreen(string strSearch)
        {
            try
            {
                gvDetail.SetOISStyle();
                gvDetail.MappingEnum(typeof(eCol));

                gvDetail.SetColumnNumeric((int)eCol.TOTAL);
                gvDetail.SetColumnNumeric((int)eCol.CUSTOMER_ID);

                gvDetail.Columns[(int)eCol.TOTAL].Visible       = false;
                gvDetail.Columns[(int)eCol.CUSTOMER_ID].Visible = false;

                clocList = vmMas.GetCustomerLocation(id);

                SortableBindingList <sp_MAS_DialogCustomerLocation_Result> result = new SortableBindingList <sp_MAS_DialogCustomerLocation_Result>();
                result.AddRange(clocList);

                gvDetail.DataSource = result;

                txtSearch.Text = strSearch;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        Task RefreshMapDeviceToList()
        {
            var list = new SortableBindingList <UserDevice>();

            // Exclude System/Virtual devices.
            UserDevice[] devices;
            lock (SettingsManager.UserDevices.SyncRoot)
            {
                devices = SettingsManager.UserDevices.Items
                          .Where(x => ShowSystemDevices || x.ConnectionClass != DEVCLASS.SYSTEM)
                          .ToArray();
            }
            list.AddRange(devices);
            list.SynchronizingObject = ControlsHelper.MainTaskScheduler;
            // If new list, item added or removed then...
            if (_currentData == null)
            {
                AttachDataSource(list);
            }
            else if (_currentData.Count != list.Count)
            {
                CollectionsHelper.Synchronize(list, _currentData);
            }
            return(null);
        }
        private void UpdateConnectorList(bool rebuild)
        {
            string prevSelectedID = ConnectorComboBox.ComboBox.SelectedValue as string;

            using (FlagManager.UseFlag("UpdateConnectorList"))
            {
                if (rebuild)
                {
                    Connections.Clear();
                }

                if (CurrentProject != null)
                {
                    var studConnectors = CurrentProject.GetAllElements <PartConnection>(x =>
                                                                                        x.ConnectorType == LDD.Primitives.Connectors.ConnectorType.Custom2DField);

                    if (rebuild)
                    {
                        Connections.AddRange(studConnectors);
                    }
                    else
                    {
                        Connections.SyncItems(studConnectors);
                    }
                }
            }

            string currentSelectedID = ConnectorComboBox.ComboBox.SelectedValue as string;

            if (prevSelectedID != currentSelectedID)
            {
                FillSelectedConnector(false);
            }
        }
Exemple #5
0
        private void UpdateElementList(bool rebuild)
        {
            string prevSelectedID = ElementsComboBox.ComboBox.SelectedValue as string;

            using (FlagManager.UseFlag(nameof(UpdateElementList)))
            {
                if (rebuild || CurrentProject == null)
                {
                    Connections.Clear();
                }

                if (CurrentProject != null)
                {
                    var studConnectors = CurrentProject.GetAllElements <PartConnection>();

                    if (rebuild)
                    {
                        Connections.AddRange(studConnectors);
                    }
                    else
                    {
                        Connections.SyncItems(studConnectors);
                    }
                }
            }

            string currentSelectedID = ElementsComboBox.ComboBox.SelectedValue as string;

            if (prevSelectedID != currentSelectedID)
            {
                SetCurrentObject(ElementsComboBox.SelectedItem as PartConnection, false);
            }
        }
Exemple #6
0
        public void InitialScreen(string strSearch)
        {
            try
            {
                gvDetail.SetOISStyle();
                gvDetail.MappingEnum(typeof(eCol));

                gvDetail.SetColumnNumeric((int)eCol.STANDARD);

                stdList = vmMas.GetSTDLight(new MAS302_STDLight_Criteria());

                SortableBindingList <sp_MAS302_GetSTDLight_Result> result = new SortableBindingList <sp_MAS302_GetSTDLight_Result>();
                result.AddRange(stdList);

                gvDetail.DataSource = result;

                txtSearch.Text = strSearch;

                if (id > 0)
                {
                    SelectedData = result.Where(x => x.ID == id).FirstOrDefault();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        /// <summary>
        /// Gibt eine Liste von Terminen zurück, mit denen das angegebene ILinkedItem
        /// verknüpft ist.
        /// </summary>
        /// <param name="linkedItem">Das verknüpfte <seealso cref="ILinkedItem"/></param>
        /// .
        /// <returns></returns>
        public SortableBindingList <Appointment> GetAppointmentList(ILinkedItem linkedItem)
        {
            var list = new SortableBindingList <Appointment>();

            foreach (var terminListe in this.myAppointmentDictionary)
            {
                list.AddRange(terminListe.Value.Where(a => a.GetLinkedItemsList().Contains(linkedItem)));
            }
            return(list);
        }
Exemple #8
0
        private async void refreshButton_Click(object sender, EventArgs e)
        {
            refreshButton.Enabled = false;
            refreshButton.Text    = "Refreshing...";
            var processList = await Task.Run(() => Utils.GetProcessList().Select(p => new ProcessInfoRow(p)).ToList());

            ProcessStore.Clear();
            ProcessStore.AddRange(processList);
            refreshButton.Text    = "Refresh";
            refreshButton.Enabled = true;
        }
Exemple #9
0
 private void ControllersUserControl_Load(object sender, EventArgs e)
 {
     if (MapDeviceToControllerMode)
     {
         var list    = new SortableBindingList <UserDevice>();
         var devices = SettingsManager.UserDevices.ItemsToArraySyncronized()
                       .Where(x => x.ConnectionClass != DEVCLASS.SYSTEM).ToList();
         list.AddRange(devices);
         AttachDataSource(list);
     }
     else
     {
         AttachDataSource(SettingsManager.UserDevices.Items);
     }
 }
Exemple #10
0
        public void SetContent(IEnumerable <ProjectFileEntry> entries)
        {
            entries = entries.ToList();
            var commentIndices =
                commentsDGV.SelectedRows.OfType <DataGridViewRow>()
                .Select(row => row.Index)
                .Where(i => i >= 0)
                .ToList();
            var fileIndices =
                filesDGV.SelectedRows.OfType <DataGridViewRow>().Select(row => row.Index).Where(i => i >= 0)
                .ToList();

            sourceRTB.Clear();
            targetRTB.Clear();
            _commentEntries.Clear();
            _fileEntries.Clear();

            _commentEntries.AddRange(entries.SelectMany(x => x.Comments));
            _fileEntries.AddRange(entries);

            if (commentIndices.Count > 0)
            {
                commentsDGV.ClearSelection();
                foreach (var index in commentIndices)
                {
                    if (commentsDGV.Rows.Count > index)
                    {
                        commentsDGV.CurrentCell          = commentsDGV.Rows[index].Cells[0];
                        commentsDGV.Rows[index].Selected = true;
                    }
                }
            }

            if (fileIndices.Count > 0)
            {
                filesDGV.ClearSelection();
            }

            foreach (var index in fileIndices)
            {
                if (filesDGV.Rows.Count > index)
                {
                    filesDGV.CurrentCell          = filesDGV.Rows[index].Cells[0];
                    filesDGV.Rows[index].Selected = true;
                }
            }
        }
Exemple #11
0
        public void InitialScreen(string strSearch)
        {
            try
            {
                gvDetail.SetOISStyle();
                gvDetail.MappingEnum(typeof(eCol));

                userList = vmMas.GetUser();

                SortableBindingList <sp_MAS101_GetUser_Result> result = new SortableBindingList <sp_MAS101_GetUser_Result>();
                result.AddRange(userList);

                gvDetail.DataSource = result;

                txtSearch.Text = strSearch;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
 public void SetContent(IEnumerable <TargetLanguageBasedProjectEntry> entries)
 {
     _projectEntries.Clear();
     _projectEntries.AddRange(entries);
 }
        public void DataBind()
        {
            if (Program.Active_battle != null)
            {
                //Build our list of visible monsters
                filteredMonsters.Clear();
                var filtered = Program.Active_battle.monsters.Where(x => x.Hidden == false).ToArray();
                filteredMonsters.AddRange(filtered);

                //If the battle has changed, reconfigure everything
                if (Program.Active_battle != currentbattle)
                {
                    this.Monsters.Columns.Clear();

                    this.Monsters.AutoGenerateColumns = false;

                    this.Monsters.DataSource = filteredMonsters;
                    this.Monsters.Columns.Add(new DataGridViewTextBoxColumn {
                        HeaderText = "ID", DataPropertyName = "Index", ReadOnly = true, AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
                    });
                    this.Monsters.Columns.Add(new DataGridViewTextBoxColumn {
                        HeaderText = "Name", DataPropertyName = "PC_Name", ReadOnly = true, AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
                    });
                    this.Monsters.Columns.Add(new DataGridViewTextBoxColumn {
                        HeaderText = "Type", DataPropertyName = "PC_Type", ReadOnly = true, AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
                    });
                    this.Monsters.Columns.Add(new DataGridViewTextBoxColumn {
                        HeaderText = "Appearance", DataPropertyName = "Appearance", ReadOnly = true, AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
                    });

                    this.Monsters.Refresh();

                    //This forces refiltering for hidden monsters
                    Program.Active_battle.monsters.ListChanged += (object sender, ListChangedEventArgs e) => { DataBind(); };

                    //this.Monsters.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells;

                    this.Monsters.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);

                    currentbattle = Program.Active_battle;
                }
                else
                {
                    this.Monsters.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
                    this.XP.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
                }

                pollingTimer.Stop();
            }
            else
            {
                pollingTimer.Start();
            }

            if (currentxp != Program.db.database.getCurrentXP())
            {
                this.XP.Columns.Clear();
                this.XP.AutoGenerateColumns = false;
                this.XP.DataSource          = Program.db.database.getCurrentXP();

                this.XP.Columns.Add(new DataGridViewTextBoxColumn {
                    HeaderText = "Timestamp", DataPropertyName = "Timestamp", ReadOnly = true, AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
                });
                this.XP.Columns.Add(new DataGridViewTextBoxColumn {
                    HeaderText = "Session", DataPropertyName = "Session", ReadOnly = true, AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
                });
                this.XP.Columns.Add(new DataGridViewTextBoxColumn {
                    HeaderText = "Battle", DataPropertyName = "Battle", ReadOnly = true, AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
                });
                this.XP.Columns.Add(new DataGridViewTextBoxColumn {
                    HeaderText = "Event", DataPropertyName = "Event", ReadOnly = true, AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells
                });
                //this.XP.Columns.Add(new DataGridViewTextBoxColumn { HeaderText = "XP", DataPropertyName = "XP", ReadOnly = true, AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells });

                this.XP.Refresh();
                try
                {
                    this.XP.Sort(this.XP.Columns[0], ListSortDirection.Descending);
                }
                catch (Exception e)
                { }

                this.XP.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);
                currentxp = Program.db.database.getCurrentXP();
            }
        }