Пример #1
0
        private void CreateHalvRegistersBox()
        {
            //register number
            int i = 0;

            foreach (string name in HalvRegistersName)
            {
                //data
                Label label = new Label();
                label.Location    = new Point(HalvRegisterPositionX, ElementPositionY(i));
                label.Name        = name;
                label.TextAlign   = ContentAlignment.MiddleCenter;
                label.Size        = new Size(RegisterWidth, ElementsHeight);
                label.BorderStyle = BorderStyle.FixedSingle;
                LabelsList.Add(name, label);
                Form.Controls.Add(label);

                //label
                label             = new Label();
                label.Location    = new Point(HalvRegistersLabelPositionX, ElementPositionY(i));
                label.Size        = new Size(LabelWidth, ElementsHeight);
                label.TextAlign   = ContentAlignment.MiddleCenter;
                label.BorderStyle = BorderStyle.FixedSingle;
                label.Text        = name;
                label.Name        = name + "Label";
                LabelsList.Add(name + "Label", label);
                Form.Controls.Add(label);
                //increase register number
                i++;
            }
        }
Пример #2
0
        private void CreateNumInfoBox()
        {
            //number
            int i = 1;

            foreach (string name in Inputs)
            {
                //data
                Label label = new Label();
                label.Location    = new Point(InputPositionX, ElementPositionY(i));
                label.Name        = name;
                label.TextAlign   = ContentAlignment.MiddleCenter;
                label.Size        = new Size(InputWidth, ElementsHeight);
                label.Text        = "0";
                label.BorderStyle = BorderStyle.FixedSingle;
                LabelsList.Add(name, label);
                Form.Controls.Add(label);

                //label
                label             = new Label();
                label.Location    = new Point(InputsLabelPositionX, ElementPositionY(i));
                label.Size        = new Size(LabelWidth, ElementsHeight);
                label.TextAlign   = ContentAlignment.MiddleCenter;
                label.BorderStyle = BorderStyle.FixedSingle;
                label.Text        = name;
                label.Name        = name + "Label";
                LabelsList.Add(name + "Label", label);
                Form.Controls.Add(label);
                //increase number
                i++;
            }
        }
Пример #3
0
        public void AddLabel(Label label, bool post)
        {
            var mailbox = VirtualMailBox.Current;

            using (mailbox.Labels.ReaderLock)
            {
                string key = label.Labelname.ToLower();

                if (!mailbox.Labels.ContainsKey(key))
                {
                    mailbox.Labels.Add(key, new List <Label>());

                    if (label.LabelType == LabelType.Custom)
                    {
                        EventBroker.Publish(AppEvents.LabelCreated, key);
                    }
                }

                if (LabelsList.Any(l => l.Equals(label)))
                {
                    return;
                }

                label.Messages.Add(this);

                mailbox.Labels[key].Add(label);

                LabelsList.Add(label);

                if (post)
                {
                    PostLabels.Add(label);

                    SendLabels = String.Join("|", PostLabels.Select(s => s.ToString()).ToArray());

                    EnqueueCloudNotification(ModifyAction.Label, String.Concat("%2B", label.Labelname));                     // + (url encoded)
                }
            }

            // Recreate and save labels list
            Labels = String.Join("|", LabelsList.Select(s => s.ToString()).ToArray());

            AsyncUpdateQueue.Enqueue(this);

            OnPropertyChanged("IsTodo");
            OnPropertyChanged("IsWaitingFor");
            OnPropertyChanged("IsSomeday");

            EventBroker.Publish(AppEvents.MessageUpdated);
            EventBroker.Publish(AppEvents.MessageLabelsUpdated, this);
        }
 protected void RecreateLabels()
 {
     if (ColumnsList != null && LabelsList.Count != ColumnsList.Count())
     {
         LabelsList.Clear();
         foreach (var column in ColumnsList)
         {
             LabelsList.Add(new SimpleLabel
             {
                 HorizontalAlignment = StringAlignment.Far
             });
         }
     }
 }
Пример #5
0
        private void CreateInputBox()
        {
            //data
            Input             = new TextBox();
            Input.Location    = new Point(InputPositionX, ElementPositionY(0));
            Input.Name        = "Request";
            Input.Text        = "Mov ax, bx";
            Input.TextAlign   = HorizontalAlignment.Center;
            Input.Size        = new Size(InputWidth, ElementsHeight);
            Input.BorderStyle = BorderStyle.FixedSingle;
            Form.Controls.Add(Input);

            //label
            Label label = new Label();

            label.Location    = new Point(InputsLabelPositionX, ElementPositionY(0));
            label.Size        = new Size(LabelWidth, ElementsHeight);
            label.TextAlign   = ContentAlignment.MiddleCenter;
            label.BorderStyle = BorderStyle.FixedSingle;
            label.Text        = "Req";
            label.Name        = "Request Label";
            LabelsList.Add("Request Label", label);
            Form.Controls.Add(label);
        }