コード例 #1
0
		public OCRSEarchResult(DeepZPoints owner)
		{
			Owner = owner;
			DataContext = Props = new VMMark{Type="document"};
			InitializeComponent();
			Props.OriginChanged += delegate { Props.PositionSetted = true; };
			Props.RectangleSize = new Size(0.1, 0.1);
			//   props.ReflectionId(typeof(string), new PropertyChangedCallback(delegate { }));

			//Props.Registr<HyperlinkButton, string>("ItemName", , nameLink);
			HorizontalAlignment = HorizontalAlignment.Left;
			VerticalAlignment = VerticalAlignment.Top;
			Props.IsCreatedEditMenu = false;
			//props.Registr("Url", typeof(Uri), new Binding("[Id]") { Converter = new IdUrlConverter(), Source = props });
            //foreach (var reflected in Props.Reflecteds)
            //{


            //    reflected.IdChanged = newValue =>
            //                       {
            //                           nameLink.NavigateUri = reflected.Url = new Uri(LinkCombo.SelectedItem + newValue);
            //                       };
         
			ViewedRadius = 15;

		}
コード例 #2
0
		public OCRSEarchResult(string id, DeepZPoints owner, Form f)
			: this(owner)
		{
			Props.IsPositionEdit = true;
			Props.ImageId = id;
			searchMarks.Add(this);
			
			//	linkList.ItemsSource = Props.Reflecteds;
			//  SetScaledPosition();    // CreateEditMenu();
		}                 
コード例 #3
0
	    public OCRSEarchResult(double x, double y, DeepZPoints owner):this(owner)
	    {
            InitializeComponent();
            SetPosition(x, y);
           
	    }
コード例 #4
0
ファイル: Mark.xaml.cs プロジェクト: Sergey303/MVC-DZI
		public Mark(string id, DeepZPoints owner, Form f)
			: this(owner)
		{
			Props.IsPositionEdit = true;
			Props.ImageId = id;
			marks.Add(this);
			FormView = f;
			//	linkList.ItemsSource = Props.Reflecteds;
			//  SetScaledPosition();    // CreateEditMenu();
		    ViewReflectedsList();
		}
コード例 #5
0
ファイル: Mark.xaml.cs プロジェクト: Sergey303/MVC-DZI
		public Mark(XElement xRef, string id, DeepZPoints owner)
			: this(owner)
		{
			Owner = owner;
			var about = xRef.Attribute("id");
            //MessageBox.Show(xRef.ToString());
			if (about != null)
			{
              //  MessageBox.Show(xRef.ToString());
				Props.ReflectionId = about.Value;
				if (marks.All(m => m.Props.ReflectionId != Props.ReflectionId))
					marks.Add(this);
			}

		    var xMainReflected = xRef.Element("reflected").Elements().FirstOrDefault();
            if (xMainReflected == null) return;
            // HtmlPage.Window.Alert(props.ReflectionId);
            var name = xMainReflected.Element("name");
            if (name != null)
            {
                Props.ItemName = name.Value;
               // MessageBox.Show(Props.ItemName);
            }
            var personId = xMainReflected.Attribute("id");
            if (personId != null)
                Props.Id = personId.Value;
           ;
           if ((Props.Type = xMainReflected.Name.ToString())=="document")
               foreach (var person in xMainReflected.Elements("reflection").Select(reflected => reflected.Elements().FirstOrDefault().Elements().FirstOrDefault()))
               {
                   if (person == null) continue;
                   var newReflected = new Reflected{Type = person.Name.ToString() };
                   name = person.Element("name");
                   // MessageBox.Show(person.ToString());
                   if (name != null)
                   {
                       newReflected.ItemName = name.Value;
                       //   MessageBox.Show(newReflected.ItemName);
                   }
                 var  SubPersonId = person.Attribute("id");
                   if (SubPersonId != null)
                       newReflected.Id = SubPersonId.Value;
                   Props.Reflecteds.Add(newReflected);
               }

		    var position = xRef.Element("position");
			if (position == null)
				xRef.Add(position = new XElement("position", new XAttribute("x", 0), new XAttribute("y", 0)));
			var xAttribute = position.Attribute("x");
			var yattribute = position.Attribute("y");
			if (xAttribute != null && yattribute != null)
			{
				var x = Convert.ToDouble(xAttribute.Value);
				var y = Convert.ToDouble(yattribute.Value);
				//Margin = new Thickness(x, y, 0, 0);
				//  Props.Origin = new Point(x / Owner.ImageScale, y / Owner.ImageScale);
				//                SetPosition(x, y);
				//props.Url = new Uri("http://sergey.iis.nsk.su/pa/?id=" + props.Id);
				Props.Origin = new Point(x, y);
			}
			var xRadius = position.Attribute("r");
			if (xRadius != null)
			{
				double r = !double.TryParse(xRadius.Value, out r) ? 0.01 : r;
			    Props.Radius = r;
				FormView = Form.Circle;
			}
			else
			{
				var xSize = position.Attribute("rect");
				if (xSize != null)
				{
					var rect = xSize.Value.Split('|');
					if (rect.Length != 2) MessageBox.Show("size of rectangle has strange value " + Props.ReflectionId);
					else
					{
						double width = double.TryParse(rect[0], out width) ? width : 0.01;
						double height = double.TryParse(rect[1], out height) ? height : 0.01;
						Props.RectangleSize = new Size(width, height);
						FormView = Form.Rect;
					}
				}
			}
			Props.ImageId = id;
			Props.IsPositionEdit = false;
			ViewReflectedsList();
		}
コード例 #6
0
ファイル: App.xaml.cs プロジェクト: Sergey303/MVC-DZI
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     var reflectionId = e.InitParams.ContainsKey("reflectionId") ? e.InitParams["reflectionId"] : null;
     RootVisual = new DeepZPoints { ReflectionId = reflectionId };
 }