コード例 #1
0
        void setUIValueByBarCodeData(BarCodeComponent barCodeData)
        {
            BarCodeInfo   = barCodeData.BarCodeInfo;
            BarCodeWidth  = barCodeData.BarCodeWidth;
            BarCodeHeight = barCodeData.BarCodeHeight;
            BarCodeCore.EnCodeDraw drawer = new BarCodeCore.EnCodeDraw();
            barCodeGrid.Children.Clear();
            barCodeGrid.Children.Add(drawer.DrawImg39(BarCodeInfo, BarCodeWidth, BarCodeHeight));
            CenterPoint = new Point(barCodeData.PositionX, barCodeData.PositionY);
            BarCodeType type = (BarCodeType)Enum.Parse(typeof(BarCodeType), barCodeData.BarCodeType, true);
            MergePictureRepeatDirection repeatDirection = (MergePictureRepeatDirection)Enum.Parse(typeof(MergePictureRepeatDirection), barCodeData.RepeatDirection, true);

            Type            = type;
            RepeatDirection = repeatDirection;
        }
コード例 #2
0
        BarCodeComponent getBarCodeComponentFromServer(string barCodeID)
        {
            BarCodeComponent bc = new BarCodeComponent();

            bc                 = new BarCodeComponent();
            bc.BarCodeID       = this.BarCodeID;
            bc.UniqueID        = this.UniqueID;
            bc.BarCodeInfo     = this.BarCodeInfo;
            bc.BarCodeType     = Type.ToString();
            bc.BarCodeWidth    = this.BarCodeWidth;
            bc.BarCodeHeight   = this.BarCodeHeight;
            bc.PositionX       = CenterPoint.X;
            bc.PositionY       = CenterPoint.Y;
            bc.RepeatDirection = RepeatDirection.ToString();
            return(bc);
        }
コード例 #3
0
        public void SetBarCodeData(BarCodeComponent barCodeData)
        {
            bool isChanged = false;

            if (BarCodeData.BarCodeInfo != barCodeData.BarCodeInfo ||
                BarCodeData.BarCodeType != barCodeData.BarCodeType ||
                BarCodeData.BarCodeWidth != barCodeData.BarCodeWidth || BarCodeData.BarCodeHeight != barCodeData.BarCodeHeight || BarCodeData.PositionX != barCodeData.PositionX || BarCodeData.PositionY != barCodeData.PositionY || BarCodeData.RepeatDirection != barCodeData.RepeatDirection)
            {
                isChanged = true;
            }

            BarCodeData = barCodeData;
            setUIValueByBarCodeData(barCodeData);
            if (isChanged)
            {
                if (BarCodeChanged != null)
                {
                    BarCodeChanged(this);
                }
            }
            IsSelectd = IsSelectd;
        }
コード例 #4
0
        BarCodeComponent getBarCodeData()
        {
            BarCodeComponent bc = new BarCodeComponent();

            bc.BarCodeInfo = txtBarCodeInfo.Text;
            //加判断
            bc.PositionX     = Convert.ToDouble(txtPositionX.Text);
            bc.PositionY     = Convert.ToDouble(txtPositionY.Text);
            bc.BarCodeWidth  = Convert.ToInt32(txtWidth.Text);
            bc.BarCodeHeight = Convert.ToInt32(txtHeight.Text);
            if (cbBarCodeType.SelectedIndex >= 0)
            {
                BarCodeTypeItem cbi = cbBarCodeType.SelectedItem as BarCodeTypeItem;
                if (cbi != null)
                {
                    bc.BarCodeType = cbi.Name;
                }
            }
            if (cbMergePictureRepeatDirection.SelectedIndex >= 0)
            {
                RepeatDirectionItem cbi = cbMergePictureRepeatDirection.SelectedItem as RepeatDirectionItem;
                if (cbi != null)
                {
                    bc.RepeatDirection = cbi.Name;
                }
            }
            //if (cbSubFlowList.SelectedIndex >= 0)
            //{
            //    WorkflowListItem cbi = cbSubFlowList.SelectedItem as WorkflowListItem;
            //    if (cbi != null)
            //    {
            //        ac.SubFlow = cbi.ID;
            //    }

            //}
            return(bc);
        }
コード例 #5
0
        void initSetting(BarCodeComponent bc)
        {
            txtBarCodeInfo.Text = bc.BarCodeInfo;
            txtPositionX.Text   = bc.PositionX.ToString();
            txtPositionY.Text   = bc.PositionY.ToString();
            txtWidth.Text       = bc.BarCodeWidth.ToString();
            txtHeight.Text      = bc.BarCodeHeight.ToString();
            string name = "";
            double size = 0;

            for (int i = 0; i < cbBarCodeType.Items.Count; i++)
            {
                name = ((BarCodeTypeItem)cbBarCodeType.Items[i]).Name;

                if (name == bc.BarCodeType)
                {
                    cbBarCodeType.SelectedIndex = i;
                    break;
                }
            }


            for (int i = 0; i < cbMergePictureRepeatDirection.Items.Count; i++)
            {
                name = ((RepeatDirectionItem)cbMergePictureRepeatDirection.Items[i]).Name;

                if (name == bc.RepeatDirection)
                {
                    cbMergePictureRepeatDirection.SelectedIndex = i;
                    break;
                }
            }
            //for (int i = 0; i < cbSubFlowList.Items.Count; i++)
            //{
            //    name = ((WorkflowListItem)cbSubFlowList.Items[i]).ID;

            //    if (name == ac.SubFlow)
            //    {
            //        cbSubFlowList.SelectedIndex = i;
            //        break;
            //    }
            //}

            //ActivityType t = (ActivityType)Enum.Parse(typeof(ActivityType), bc.ActivityType, true);
            //if (t == ActivityType.OR_MERGE
            //    || t == ActivityType.AND_MERGE
            //    || t == ActivityType.VOTE_MERGE)
            //{
            //    tbMergePictureRepeatDirection.Visibility = Visibility.Visible;
            //    cbMergePictureRepeatDirection.Visibility = Visibility.Visible;
            //}
            //else
            //{
            //    tbMergePictureRepeatDirection.Visibility = Visibility.Collapsed;
            //    cbMergePictureRepeatDirection.Visibility = Visibility.Collapsed;
            //}


            //if (t == ActivityType.SUBPROCESS)
            //{
            //    btSubFlow.Visibility = Visibility.Visible;
            //    cbSubFlowList.Visibility = Visibility.Visible;
            //}
            //else
            //{
            //    btSubFlow.Visibility = Visibility.Collapsed;
            //    cbSubFlowList.Visibility = Visibility.Collapsed;
            //}
        }