Пример #1
0
        public MessagePage(Chat chat, DecryptedRecordData <MessageRecord> message) : base("MessagePage")
        {
            Subscribe <NewSecretKeyEvent>(NewSecretKey);

            _chat    = chat;
            _message = message;

            var transaction = message.Transaction;

            AddTitleRow("Title");

            AddHeaderRow("Message");

            var(text, detail) = ChatListView.GetMessageText(message);
            _text             = AddTextRow(null);
            _text.SetMultilineText(text, detail);

            AddFooterRow();

            AddHeaderRow("SecretKeyInfo");
            _keyView = new SecretKeyView(message.EncryptedRecord?.KeyInfo, true);
            AddViewRow(_keyView);
            AddButtonRow("Import", Import);
            AddFooterRow();

            AddHeaderRow("TransactionInfo");
            AddViewRow(new DataTransactionView(transaction));
            AddFooterRow();

            IsBusy = true;
            UIApp.Run(Update);
        }
Пример #2
0
        private void AddLabel(bool addLabelToPolir = true)
        {
            // Adds a new label to table.
            int      counter = LabelTable.Count;
            LabelRow row     = new LabelRow()
            {
                Name  = "m" + counter,
                Index = counter
            };

            LabelTable.Add(row);

            // Adds label mi to if in the stack.
            OutputRow outputRow = stack.Pop();

            if (outputRow.RelatedLabels == null)
            {
                outputRow.RelatedLabels = new List <string>();
            }
            outputRow.RelatedLabels.Add(row.Name);
            stack.Push(outputRow);

            // Adds label mi to POLIR if addLabelToPolir == true
            if (addLabelToPolir == true)
            {
                AddToPolir(row.Name);
            }
        }
		public int Add(double fromPosition, double toPosition, string text, LabelRow row, LabelMark mark, GridTicks gridTick)
		{
			CustomLabel customLabel = new CustomLabel(fromPosition, toPosition, text, row, mark, gridTick);
			customLabel.axis = axis;
			Invalidate();
			return array.Add(customLabel);
		}
        public int Add(double fromPosition, double toPosition, string text, LabelRow row, LabelMark mark)
        {
            CustomLabel customLabel = new CustomLabel(fromPosition, toPosition, text, row, mark);

            customLabel.axis = this.axis;
            this.Invalidate();
            return(this.array.Add(customLabel));
        }
Пример #5
0
 public CustomLabel(double fromPosition, double toPosition, string text, LabelRow row, LabelMark mark, GridTicks gridTick)
 {
     from          = fromPosition;
     to            = toPosition;
     this.text     = text;
     RowIndex      = ((row != 0) ? 1 : 0);
     labelMark     = mark;
     this.gridTick = gridTick;
 }
Пример #6
0
 public CustomLabel(double fromPosition, double toPosition, string text, LabelRow row, LabelMark mark)
 {
     this.from      = fromPosition;
     this.to        = toPosition;
     this.text      = text;
     this.RowIndex  = ((row != 0) ? 1 : 0);
     this.labelMark = mark;
     this.gridTick  = GridTicks.None;
 }
        public MainViewModel()
        {
            Row1  = new LabelRow();
            Row2  = new LabelRow();
            Row3  = new LabelRow();
            Row4  = new LabelRow();
            Row5  = new LabelRow();
            Row6  = new LabelRow();
            Row7  = new LabelRow();
            Row8  = new LabelRow();
            Row9  = new LabelRow();
            Row10 = new LabelRow();
            Row11 = new LabelRow();
            Row12 = new LabelRow();
            Row13 = new LabelRow();
            Row14 = new LabelRow();
            Row15 = new LabelRow();

            Row1.SelectedCharWidth  = Row1.CharWidths.FirstOrDefault();
            Row2.SelectedCharWidth  = Row2.CharWidths.FirstOrDefault();
            Row3.SelectedCharWidth  = Row3.CharWidths.FirstOrDefault();
            Row4.SelectedCharWidth  = Row4.CharWidths.FirstOrDefault();
            Row5.SelectedCharWidth  = Row5.CharWidths.FirstOrDefault();
            Row6.SelectedCharWidth  = Row6.CharWidths.FirstOrDefault();
            Row7.SelectedCharWidth  = Row7.CharWidths.FirstOrDefault();
            Row8.SelectedCharWidth  = Row8.CharWidths.FirstOrDefault();
            Row9.SelectedCharWidth  = Row9.CharWidths.FirstOrDefault();
            Row10.SelectedCharWidth = Row10.CharWidths.FirstOrDefault();
            Row11.SelectedCharWidth = Row11.CharWidths.FirstOrDefault();
            Row12.SelectedCharWidth = Row12.CharWidths.FirstOrDefault();
            Row13.SelectedCharWidth = Row13.CharWidths.FirstOrDefault();
            Row14.SelectedCharWidth = Row14.CharWidths.FirstOrDefault();
            Row15.SelectedCharWidth = Row15.CharWidths.FirstOrDefault();

            Barcode = new Barcode
            {
                CodeSize        = 2,
                HeightOfCode    = 5,
                SelectedBarCode = BarCodes.FirstOrDefault()
            };
            SelectedLabelName = "Text Files";

            SaveButtonCommand      = new RelayCommand(SaveCommand);
            NewButtonCommand       = new RelayCommand(NewCommand);
            SetUpButtonCommand     = new RelayCommand(SetUpCommand);
            PrintButtonCommand     = new RelayCommand(PrintCommand);
            PrintJobsButtonCommand = new RelayCommand(PrintJobsCommand);
            ExitButtonCommand      = new RelayCommand(ExitCommand);
            UpdateLabelCommand     = new RelayCommand(UpdateLabel);
        }
Пример #8
0
        void Draw(Graphics graphics, LabelRow row, float x, ref float y)
        {
            var placeholers = GetPlaceholders(row.Text);

            var rowHeight = 10;

            var strategySelector = new StrategySelector
            {
                Graphics = graphics,
                Barcode  = Barcode,
                LabelRow = row
            };

            //Draw all placeholders
            foreach (var placeholer in placeholers)
            {
                var drawingStrategy = strategySelector.GetStrategy(placeholer);

                drawingStrategy.Draw(ref rowHeight, ref x, y);
            }

            //Increase row width
            y = rowHeight + y;
        }
Пример #9
0
 public LabelRowChangeEvent(LabelRow row, System.Data.DataRowAction action) {
     this.eventRow = row;
     this.eventAction = action;
 }
Пример #10
0
 public void RemoveLabelRow(LabelRow row) {
     this.Rows.Remove(row);
 }
Пример #11
0
 public void AddLabelRow(LabelRow row) {
     this.Rows.Add(row);
 }
 public void Add(double labelsStep, DateTimeIntervalType intervalType, string format, LabelRow row, LabelMark mark)
 {
     this.Add(labelsStep, intervalType, 0.0, 0.0, format, row, mark);
     this.Invalidate();
 }
 public void Add(double labelsStep, DateTimeIntervalType intervalType, double min, double max, string format, LabelRow row, LabelMark mark)
 {
     this.Add(labelsStep, intervalType, min, max, format, (row != 0) ? 1 : 0, mark);
 }