Example #1
0
        void setUIValueByActivityData(ActivityComponent activityData)
        {
            sdPicture.AcitivtyName = activityData.ActivityName;
            CenterPoint            = new Point(activityData.PositionX, activityData.PositionY);
            ActivityType type = (ActivityType)Enum.Parse(typeof(ActivityType), activityData.ActivityType, true);
            MergePictureRepeatDirection repeatDirection = (MergePictureRepeatDirection)Enum.Parse(typeof(MergePictureRepeatDirection), activityData.RepeatDirection, true);

            Type               = type;
            SubFlow            = activityData.SubFlow;
            sdPicture.FontSize = activityData.FontSize;
        }
Example #2
0
        ActivityComponent getActivityComponentFromServer(string activityID)
        {
            ActivityComponent ac = new ActivityComponent();

            ac              = new ActivityComponent();
            ac.ActivityID   = this.ActivityID;
            ac.UniqueID     = this.UniqueID;
            ac.ActivityName = sdPicture.AcitivtyName;
            ac.ActivityType = Type.ToString();
            ac.FontSize     = sdPicture.FontSize;
            ac.PositionX    = CenterPoint.X;
            ac.PositionY    = CenterPoint.Y;
            ac.SubFlow      = this.SubFlow;
            return(ac);
        }
        ActivityComponent getActivityData()
        {
            ActivityComponent ac = new ActivityComponent();

            ac.ActivityName = txtActivityName.Text;
            //加判断
            ac.PositionX = Convert.ToDouble(txtPositionX.Text);
            ac.PositionY = Convert.ToDouble(txtPositionY.Text);
            if (cbActivityType.SelectedIndex >= 0)
            {
                ActivityTypeItem cbi = cbActivityType.SelectedItem as ActivityTypeItem;
                if (cbi != null)
                {
                    ac.ActivityType = cbi.Name;
                }
            }
            if (cbMergePictureRepeatDirection.SelectedIndex >= 0)
            {
                RepeatDirectionItem cbi = cbMergePictureRepeatDirection.SelectedItem as RepeatDirectionItem;
                if (cbi != null)
                {
                    ac.RepeatDirection = cbi.Name;
                }
            }
            //if (cbSubFlowList.SelectedIndex >= 0)
            //{
            //    WorkflowListItem cbi = cbSubFlowList.SelectedItem as WorkflowListItem;
            //    if (cbi != null)
            //    {
            //        ac.SubFlow = cbi.ID;
            //    }

            //}
            if (cbFontSize.SelectedIndex >= 0)
            {
                FontSizeItem cbi = cbFontSize.SelectedItem as FontSizeItem;
                if (cbi != null)
                {
                    ac.FontSize = cbi.Size;
                }
            }
            return(ac);
        }
Example #4
0
        public void SetActivityData(ActivityComponent activityData)
        {
            bool isChanged = false;


            if (ActivityData.ActivityName != activityData.ActivityName ||
                ActivityData.ActivityType != activityData.ActivityType ||
                ActivityData.RepeatDirection != activityData.RepeatDirection || ActivityData.FontSize != activityData.FontSize || ActivityData.PositionX != activityData.PositionX || ActivityData.PositionY != activityData.PositionY)
            {
                isChanged = true;
            }

            ActivityData = activityData;
            setUIValueByActivityData(activityData);
            if (isChanged)
            {
                if (ActivityChanged != null)
                {
                    ActivityChanged(this);
                }
            }
            IsSelectd = IsSelectd;
        }
        void initSetting(ActivityComponent ac)
        {
            txtActivityName.Text = ac.ActivityName;
            txtPositionX.Text    = ac.PositionX.ToString();
            txtPositionY.Text    = ac.PositionY.ToString();
            string name = "";
            double size = 0;

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

                if (name == ac.ActivityType)
                {
                    cbActivityType.SelectedIndex = i;
                    break;
                }
            }

            for (int i = 0; i < cbFontSize.Items.Count; i++)
            {
                size = ((FontSizeItem)cbFontSize.Items[i]).Size;

                if (size == ac.FontSize)
                {
                    cbFontSize.SelectedIndex = i;
                    break;
                }
            }

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

                if (name == ac.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), ac.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;
            //}
        }