예제 #1
0
        public void Init()
        {
            UId = Guid.NewGuid();
            Id  = UId.ToString("D");

            //Image = new BitmapImage(new Uri("pack://application:,,,/Shell;component/Resources/Userpic.png"));
            //Image = AppFile.Default.UserImage;
            //ImageBytes = AppFile.Default.ImageBytes;
        }
예제 #2
0
        public UIElement CreateLink()
        {
            if (_element == null)
            {
                DrawLinkArrow(StartPoint, EndPoint);
                _element     = Path;
                _element.Uid = UId.ToString("D");
            }

            return(_element);
        }
예제 #3
0
        private void AddDevice(UId id, IPAddress address)
        {
            if (!devices.ContainsKey(id))
            {
                RdmDeviceModel device = new RdmDeviceModel(new TreeNode(id.ToString()), acnSocket, id, address);
                devices[id] = device;
                rdmDevices.Nodes.Add(device.Node);

                device.PortsChanged += new EventHandler(device_PortsChanged);
                device.Identify();
            }
        }
예제 #4
0
파일: SnoopMain.cs 프로젝트: ming-hai/ACN
        private void AddDevice(UId id, RdmEndPoint address)
        {
            if (!devices.ContainsKey(id))
            {
                RdmDeviceModel device = new RdmDeviceModel(new TreeNode(id.ToString()), Transport.Socket, id, address);
                devices[id] = device;
                rdmDevices.Nodes.Add(device.Node);

                if (AutoInterogate)
                {
                    device.Interogate();
                }
            }
        }
예제 #5
0
        public override string GetExecutionData()
        {
            var    sb = new StringBuilder(512);
            string parameterConfigs = GenerateParameterConfigs(sb);
            string valueConfigs     = sb.ToString();

            sb.Length = 0;
            string pageSchemaConfig = GeneratePageSchemaConfigs(sb, valueConfigs);

            sb.Length = 0;
            bool   isNotFirstProperty = false;
            string uid               = UId.ToString();
            object title             = GetParameterValue("Title") ?? string.Empty;
            object recommendation    = GetParameterValue("Recommendation") ?? string.Empty;
            object informationOnStep = GetParameterValue("InformationOnStep") ?? string.Empty;

            sb.Append("{");
            AppendJSonProperty(sb, "procElUId", uid, 1, ref isNotFirstProperty);
            AppendJSonProperty(sb, "name", Name, 1, ref isNotFirstProperty);
            AppendJSonProperty(sb, "processId", ProcessUserTaskUtilities.GetParentProcessId(Owner), 1,
                               ref isNotFirstProperty);
            AppendJSonProperty(sb, "isProcessExecutedBySignal",
                               ProcessUserTaskUtilities.GetIsProcessExecutedBySignal(Owner), 2, ref isNotFirstProperty);
            AppendJSonProperty(sb, "processName", Owner.Name, 1, ref isNotFirstProperty);
            AppendJSonProperty(sb, "title", title, 1, ref isNotFirstProperty);
            AppendJSonProperty(sb, "recommendation", recommendation, 1, ref isNotFirstProperty);
            AppendJSonProperty(sb, "informationOnStep", informationOnStep, 1, ref isNotFirstProperty);
            AppendJSonProperty(sb, "nextProcElUId", "nextProcElUIdValue", 1, ref isNotFirstProperty);
            AppendJSonProperty(sb, "urlToken", "ProcessCardModuleV2/AutoGeneratedPageV2", 1, ref isNotFirstProperty);
            AppendJSonProperty(sb, "autoGeneratedPage", true, 1, ref isNotFirstProperty);
            if (EntityId != Guid.Empty)
            {
                AppendJSonProperty(sb, "recordId", EntityId, 1, ref isNotFirstProperty);
            }
            AppendJSonProperty(sb, "pageSchema", pageSchemaConfig, 3, ref isNotFirstProperty);
            AppendJSonProperty(sb, "parameters", parameterConfigs, 3, ref isNotFirstProperty);
            string userContextData = ProcessLane?.GetUserContextData();

            if (!string.IsNullOrEmpty(userContextData))
            {
                sb.Append(",");
                sb.Append(userContextData);
            }
            sb.Append("}");
            return(sb.ToString());
        }
예제 #6
0
        private void btSave_FormSubmit(object sender, EventArgs e)
        {
            Trace.Write("btSave-UserId", UId.ToString());
            Trace.Write("btSave-SelectedValue", ddAssignTo.SelectedValue);

            SqlParameter[] parameters =
            {
                new SqlParameter("@OrgId",         SqlDbType.Int,       4, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Default, OrgId),
                new SqlParameter("@UID",           SqlDbType.Int,       4, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Default, UId),
                new SqlParameter("@EquipId",       SqlDbType.Int,       4, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Default, EquipId),
                new SqlParameter("@intAssignedTo", SqlDbType.Int,       4, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Default, ddAssignTo.SelectedValue),
                new SqlParameter("@vchNote",       SqlDbType.VarChar, 250, ParameterDirection.Input, false, 0, 0, null, DataRowVersion.Default, tbNote.Text)
            };
            DbObject dbobj1 = new DbObject();

            dbobj1.intRunProcedure("sp_UpdateEquipAssignedTo", parameters);

            Response.Redirect(ParentPageURL);
        }
        public void GenerateLine()
        {
            Point cluster1Pos = MainData.GetGalaxyMap().Clusters.First(c => c.Id == ConnectionId1).Polygon.TransformToAncestor(MainData.Canvas).Transform(new Point(0, 0));
            Point cluster2Pos = MainData.GetGalaxyMap().Clusters.First(c => c.Id == ConnectionId2).Polygon.TransformToAncestor(MainData.Canvas).Transform(new Point(0, 0));

            Console.WriteLine("1: " + cluster1Pos.ToString());

            cluster1Pos = GetPoint(cluster1Pos, 55, Connection1Type);
            cluster2Pos = GetPoint(cluster2Pos, 55, Connection2Type);

            Line    = new Line();
            Line.X1 = cluster1Pos.X;
            Line.Y1 = cluster1Pos.Y;
            Line.X2 = cluster2Pos.X;
            Line.Y2 = cluster2Pos.Y;


            Line.Stroke          = Brushes.Orange;
            Line.StrokeThickness = 5;
            Line.Tag             = UId;

            MainData.AddChildToCanvas(CanvasElementType.CONNECTION, Line, UId.ToString());
        }
예제 #8
0
 /// <summary>
 /// Describes a relation between couple of nodes
 /// </summary>
 public Link()
 {
     UId = Guid.NewGuid();
     Id  = UId.ToString("D");
 }
예제 #9
0
        public UIElement CreateElement()
        {
            if (_element == null)
            {
                Canvas                 = new Canvas();
                Canvas.Background      = new SolidColorBrush(Colors.Transparent);
                border                 = new Border();
                border.BorderBrush     = new SolidColorBrush(Colors.Transparent);
                border.BorderThickness = new Thickness(1);
                Canvas.Children.Add(border);



                switch (ShapeType)
                {
                case ShapeType.Ellipse:
                {
                    shape = new Ellipse();
                    shape.StrokeThickness = StrokeThickness;
                    shape.Stroke          = new SolidColorBrush(BorderColor);
                    shape.Fill            = new SolidColorBrush(ShapeColor);
                    break;
                }

                case ShapeType.Rectangle:
                {
                    shape = new Rectangle();
                    shape.StrokeThickness = StrokeThickness;
                    shape.Stroke          = new SolidColorBrush(BorderColor);
                    shape.Fill            = new SolidColorBrush(ShapeColor);
                    break;
                }

                case ShapeType.Image:
                {
                    shape     = new Rectangle();
                    ImagePath = OpenDialog();
                    break;
                }

                case ShapeType.Video:
                {
                    shape = new Rectangle();
                    break;
                }

                case ShapeType.Document:
                {
                    shape = new Rectangle();
                    break;
                }

                case ShapeType.Text:
                {
                    shape = new Rectangle();

                    break;
                }
                }

                Canvas.Children.Add(shape);
                textBlock = new TextBlock();
                //textBlock.Foreground = new SolidColorBrush(Colors.Black);
                //Size textSize = MeasureText(VirtualCanvas, Label);
                //double textPositionX = (Width - textSize.Width) / 2;
                //double textPositionY = (Height - textSize.Height) / 2;
                //textBlock.Text = Label;
                Canvas.Children.Add(textBlock);
                //Canvas.SetLeft(textBlock, textPositionX);
                //Canvas.SetTop(textBlock, textPositionY);

                PositionElements();

                Canvas.MouseDown  += VirtualCanvas.Shape_OnMouseDown;
                Canvas.MouseMove  += VirtualCanvas.Shape_MouseMove;
                Canvas.MouseUp    += VirtualCanvas.Shape_MouseUp;
                Canvas.MouseEnter += VirtualCanvas.Shape_MouseEnter;
                Canvas.MouseLeave += VirtualCanvas.Shape_MouseLeave;
                Canvas.ContextMenu = CreateContextMenu();

                if (ShapeType == ShapeType.Video)
                {
                    VideoPath = OpenDialog();
                }

                _element     = Canvas;
                _element.Uid = UId.ToString("D");
            }
            return(_element);
        }