Example #1
0
        private void InitializeControls()
        {
            RequestTimeLabel.DataBindings.Clear();
            DataSendLabel.DataBindings.Clear();

            MessagesListView.Items.Clear();
            MessagesListView.Columns.Clear();

            MessagesListView.Columns.Add("Nachricht-ID");
            MessagesListView.Columns.Add("Text");

            if (_requestResult == null)
            {
                return;
            }

            RequestTimeLabel.SetTextDataBinding(_requestResult, nameof(_requestResult.CreationTimeAsDisplayString),
                                                DataSourceUpdateMode.Never);
            DataSendLabel.SetTextDataBinding(_requestResult,
                                             nameof(_requestResult.IsLocalResultAsDisplayString), DataSourceUpdateMode.Never);

            foreach (RequestResultMessage message in _requestResult.ResultMessages)
            {
                string[] subItems = new string[2];
                subItems[0] = message.MessageId;
                subItems[1] = message.Message;

                ObjectListViewItem item = new ObjectListViewItem(message, subItems);
                MessagesListView.Items.Add(item);
            }

            MessagesListView.Columns[0].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
            MessagesListView.Columns[1].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
        }
        private void AddBalanceInformationToListView(BalanceInformation balance)
        {
            string[] subItems = new string[1];
            subItems[0] = balance.XbrlFilePath;

            ObjectListViewItem item = new ObjectListViewItem(balance, subItems);

            BalancesListView.Items.Add(item);
        }
Example #3
0
        private void AddAttachment(Attachment attachment)
        {
            string[] subItems = new string[1];
            subItems[0] = attachment.Name;

            ObjectListViewItem item = new ObjectListViewItem(attachment, subItems);

            AttachmentsListView.Items.Add(item);
            _attachments.Add(attachment);
        }
Example #4
0
        private void AddSenderIdentity(SenderIdentity identity)
        {
            string[] subItems = new string[2];
            subItems[0] = SenderIdentity.IdentityTypeToElbaString(identity.IdentityType);
            subItems[1] = identity.Value;

            ObjectListViewItem item = new ObjectListViewItem(identity, subItems);

            SenderIdentityListView.Items.Add(item);
            _identities.Add(identity);
        }
        public void AddOrUpdateBalanceInformation(BalanceInformation balanceInformation)
        {
            ObjectListViewItem olvItem =
                BalancesListView.Items.OfType <ObjectListViewItem>()
                .FirstOrDefault(item => item.UnderlyingObject == balanceInformation);

            if (olvItem != null)
            {
                olvItem.SubItems[0].Text = balanceInformation.XbrlFilePath;
            }
            else
            {
                AddBalanceInformationToListView(balanceInformation);
            }
        }
Example #6
0
        public static List<ObjectListViewItem> ObjectListFromResult(ObjectSearchResult result)
        {
            if (result == null || result.Objects == null || result.Objects.Count == 0)
                return null;

            List<ObjectListViewItem> objects = new List<ObjectListViewItem>();

            foreach(CelestialObject celestialObject in result.Objects)
            {
                ObjectListViewItem objectItem = new ObjectListViewItem();
                objectItem.Name = celestialObject.ObjectData.Where(it => it.Name.Equals("ObjectName")).First().Values.First().Value.ToString();
                objectItem.Constellation = celestialObject.ObjectData.Where(it => it.Name.Equals("Constellation")).First().Values.First().Value.ToString();
                objectItem.Coordinates = string.Format("Declination : {0}, Right Ascension : {1}", celestialObject.ObjectData.Where(it => it.Name.Equals("Declination")).First().Values.First().Value.ToString(),
                                                                                                   celestialObject.ObjectData.Where(it => it.Name.Equals("RightAscension")).First().Values.First().Value.ToString());

                objects.Add(objectItem);
            }

            return objects;
        }
Example #7
0
        private void EditSelectedItem()
        {
            ListView.SelectedListViewItemCollection items = AttachmentsListView.SelectedItems;
            if (items.Count > 1)
            {
                MessageBox.Show("You can only edit one item at the same time.");
                return;
            }

            ObjectListViewItem lvi = items[0] as ObjectListViewItem;
            Attachment         underlyingObject = lvi?.UnderlyingObject as Attachment;

            if (underlyingObject != null)
            {
                Attachment         copy = underlyingObject.Copy();
                EditAttachmentForm form = new EditAttachmentForm(copy);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    copy.CopyTo(underlyingObject);
                    lvi.SubItems[0].Text = underlyingObject.Name;
                }
            }
        }
        private void EditSelectedItem()
        {
            ListView.SelectedListViewItemCollection items = BalancesListView.SelectedItems;
            if (items.Count > 1)
            {
                MessageBox.Show("You can only edit one item at the same time.");
                return;
            }

            ObjectListViewItem lvi = items[0] as ObjectListViewItem;
            BalanceInformation underlyingObject = lvi?.UnderlyingObject as BalanceInformation;

            if (underlyingObject != null)
            {
                BalanceInformation         copy = underlyingObject.Copy();
                EditBalanceInformationForm form = new EditBalanceInformationForm(copy);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    copy.CopyTo(underlyingObject);
                    lvi.SubItems[0].Text = underlyingObject.XbrlFilePath;
                }
            }
        }
Example #9
0
        private void EditSelectedItem()
        {
            ListView.SelectedListViewItemCollection items = SenderIdentityListView.SelectedItems;
            if (items.Count > 1)
            {
                MessageBox.Show("You can only edit one item at the same time.");
                return;
            }

            ObjectListViewItem lvi = items[0] as ObjectListViewItem;
            SenderIdentity     underlyingObject = lvi?.UnderlyingObject as SenderIdentity;

            if (underlyingObject != null)
            {
                SenderIdentity   copy = underlyingObject.Copy();
                EditIdentityForm form = new EditIdentityForm(copy);
                if (form.ShowDialog() == DialogResult.OK)
                {
                    copy.CopyTo(underlyingObject);
                    lvi.SubItems[0].Text = SenderIdentity.IdentityTypeToElbaString(underlyingObject.IdentityType);
                    lvi.SubItems[1].Text = underlyingObject.Value;
                }
            }
        }