public override string ToPresentation(JobMode jobMode, Characteristic characteristic)
 {
     // TODO: DO NOT hardcode Characteristic suffix
     var id = characteristic.Id;
     var type = characteristic.DeclaringType.FullName;
     var value = SourceCodeHelper.ToSourceCode(characteristic[jobMode]);
     return $"{type}.{id}Characteristic[job] = {value}";
 }
            public override string ToPresentation(JobMode jobMode, Characteristic characteristic)
            {
                if (!jobMode.HasValue(characteristic))
                    return "Default";

                var value = characteristic[jobMode];
                return (value as IFormattable)?.ToString(null, HostEnvironmentInfo.MainCultureInfo)
                    ?? value?.ToString() 
                    ?? "";
            }
Ejemplo n.º 3
0
        private void CopyAs_Click(object sender, EventArgs e)
        {
            if (m_listBoxLayerSettings.SelectedIndex < 0)
            {
                return;
            }

            try
            {
                JobMode Mode = (JobMode)m_listBoxLayerSettings.SelectedItem;
                if (Mode != null)
                {
                    List <string> ExistModes = new List <string>();
                    foreach (JobMode item in m_LayerSettings.Items)
                    {
                        ExistModes.Add(item.Name);
                    }

                    NameEdit Form = new NameEdit(ExistModes);
                    Form.Text = ResString.GetResString("Add_Mode");
                    if (DialogResult.OK == Form.ShowDialog())
                    {
                        JobMode newMode = new JobMode();
                        newMode.Name            = Form.Input;
                        newMode.Item            = Mode.Item.Clone();
                        newMode.LayerNum        = Mode.LayerNum;
                        newMode.LayerColorArray = Mode.LayerColorArray;
                        newMode.SpotColor1Mask  = Mode.SpotColor1Mask;
                        m_LayerSettings.Items.Add(newMode);

                        Bind();

                        m_listBoxLayerSettings.SelectedIndex = m_listBoxLayerSettings.Items.Count - 1;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Failed to save the config:" + ex.Message);
            }
        }
Ejemplo n.º 4
0
 private static void AssertProperties(JobMode obj, string properties) =>
     Equal(JobMode.IdCharacteristic.ResolveValueCore(obj, null), properties);
Ejemplo n.º 5
0
 public void addEntry(JobMode mode, string fullFileName)
 {
     FileTransferEntry entry = new FileTransferEntry(mode, fullFileName);
     int top = 0;
     this.mPanel.Parent.Visible = true;
     entry.addToPanel(this.mPanel, mNextTop, out top);
     mNextTop = top;
     Debug.WriteLine("nextTop=" + mNextTop);
     mBox.AppendText("add: nextTop=" + mNextTop + " pos=" + entry.getPanelPosition().Y
          + " height=" + mPanel.Height + " \n");
     alFileList.Add(entry);
     mPanel.Refresh();
     mPanel.ResumeLayout();
 }
Ejemplo n.º 6
0
 public FileTransferPanel(JobMode mode, Panel parent, RichTextBox box)
 {
     mMode = mode;
     mPanel = parent;
     mBox = box;
 }
Ejemplo n.º 7
0
            //EventHandler handler
            public FileTransferEntry(JobMode mode, string fullFileName)
            {
                _mode = mode;

                setFileInfo(fullFileName);

                _pnlFileEntry = new Panel();
                _pnlFileEntry.BackColor = System.Drawing.SystemColors.ActiveCaption;
                _lblFileStatus = new Label();
                _lblFileStatus.Text = _fileName + "\n" + MSG_FILE_WAITING;
                _pgbFileStatus = new ProgressBar();

                if (mode == JobMode.Receive)
                {
                    _btnOk = new Button();
                    _btnCancel = new Button();
                }
                else
                {
                }
                _status = FileStatus.Wait;
            }
 public override string ToPresentation(JobMode jobMode, Characteristic characteristic)
 {
     return jobMode.HasValue(characteristic)
         ? FolderNameHelper.ToFolderName(characteristic[jobMode])
         : "Default";
 }
 public abstract string ToPresentation(JobMode jobMode, Characteristic characteristic);