public override ErrorList Validate() { var result = new ErrorList(); result.AddRange(base.Validate()); if (Type != null) { result.AddRange(Type.Validate()); } if (Outcome != null) { result.AddRange(Outcome.Validate()); } if (Onset != null) { result.AddRange(Onset.Validate()); } if (NoteElement != null) { result.AddRange(NoteElement.Validate()); } return(result); }
public override ErrorList Validate() { var result = new ErrorList(); result.AddRange(base.Validate()); if (NameElement != null) { result.AddRange(NameElement.Validate()); } if (Relationship != null) { result.AddRange(Relationship.Validate()); } if (Deceased != null) { result.AddRange(Deceased.Validate()); } if (NoteElement != null) { result.AddRange(NoteElement.Validate()); } if (Condition != null) { Condition.ForEach(elem => result.AddRange(elem.Validate())); } return(result); }
public override ErrorList Validate() { var result = new ErrorList(); result.AddRange(base.Validate()); if (Category != null) { result.AddRange(Category.Validate()); } if (StatusElement != null) { result.AddRange(StatusElement.Validate()); } if (Subject != null) { result.AddRange(Subject.Validate()); } if (Author != null) { result.AddRange(Author.Validate()); } if (NoteElement != null) { result.AddRange(NoteElement.Validate()); } return(result); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as FamilyMemberHistoryConditionComponent; if (dest != null) { base.CopyTo(dest); if (Type != null) { dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); } if (Outcome != null) { dest.Outcome = (Hl7.Fhir.Model.CodeableConcept)Outcome.DeepCopy(); } if (Onset != null) { dest.Onset = (Hl7.Fhir.Model.Element)Onset.DeepCopy(); } if (NoteElement != null) { dest.NoteElement = (Hl7.Fhir.Model.FhirString)NoteElement.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as FamilyHistory; if (dest != null) { base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (Subject != null) { dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); } if (NoteElement != null) { dest.NoteElement = (Hl7.Fhir.Model.FhirString)NoteElement.DeepCopy(); } if (Relation != null) { dest.Relation = new List <Hl7.Fhir.Model.FamilyHistory.FamilyHistoryRelationComponent>(Relation.DeepCopy()); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
public static void Run() { // ExStart:CreateStructureElements // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdf_WorkingDocuments(); // Create Pdf Document Document document = new Document(); // Get Content for work with TaggedPdf ITaggedContent taggedContent = document.TaggedContent; // Set Title and Language for Documnet taggedContent.SetTitle("Tagged Pdf Document"); taggedContent.SetLanguage("en-US"); // Create Grouping Elements PartElement partElement = taggedContent.CreatePartElement(); ArtElement artElement = taggedContent.CreateArtElement(); SectElement sectElement = taggedContent.CreateSectElement(); DivElement divElement = taggedContent.CreateDivElement(); BlockQuoteElement blockQuoteElement = taggedContent.CreateBlockQuoteElement(); CaptionElement captionElement = taggedContent.CreateCaptionElement(); TOCElement tocElement = taggedContent.CreateTOCElement(); TOCIElement tociElement = taggedContent.CreateTOCIElement(); IndexElement indexElement = taggedContent.CreateIndexElement(); NonStructElement nonStructElement = taggedContent.CreateNonStructElement(); PrivateElement privateElement = taggedContent.CreatePrivateElement(); // Create Text Block-Level Structure Elements ParagraphElement paragraphElement = taggedContent.CreateParagraphElement(); HeaderElement headerElement = taggedContent.CreateHeaderElement(); HeaderElement h1Element = taggedContent.CreateHeaderElement(1); // Create Text Inline-Level Structure Elements SpanElement spanElement = taggedContent.CreateSpanElement(); QuoteElement quoteElement = taggedContent.CreateQuoteElement(); NoteElement noteElement = taggedContent.CreateNoteElement(); // Create Illustration Structure Elements FigureElement figureElement = taggedContent.CreateFigureElement(); FormulaElement formulaElement = taggedContent.CreateFormulaElement(); // Methods are under development ListElement listElement = taggedContent.CreateListElement(); TableElement tableElement = taggedContent.CreateTableElement(); ReferenceElement referenceElement = taggedContent.CreateReferenceElement(); BibEntryElement bibEntryElement = taggedContent.CreateBibEntryElement(); CodeElement codeElement = taggedContent.CreateCodeElement(); LinkElement linkElement = taggedContent.CreateLinkElement(); AnnotElement annotElement = taggedContent.CreateAnnotElement(); RubyElement rubyElement = taggedContent.CreateRubyElement(); WarichuElement warichuElement = taggedContent.CreateWarichuElement(); FormElement formElement = taggedContent.CreateFormElement(); // Save Tagged Pdf Document document.Save(dataDir + "StructureElements.pdf"); // ExEnd:CreateStructureElements }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as FamilyMemberHistory; if (dest != null) { base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (Patient != null) { dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); } if (DateElement != null) { dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); } if (NameElement != null) { dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); } if (Relationship != null) { dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); } if (GenderElement != null) { dest.GenderElement = (Code <Hl7.Fhir.Model.AdministrativeGender>)GenderElement.DeepCopy(); } if (Born != null) { dest.Born = (Hl7.Fhir.Model.Element)Born.DeepCopy(); } if (Age != null) { dest.Age = (Hl7.Fhir.Model.Element)Age.DeepCopy(); } if (Deceased != null) { dest.Deceased = (Hl7.Fhir.Model.Element)Deceased.DeepCopy(); } if (NoteElement != null) { dest.NoteElement = (Hl7.Fhir.Model.FhirString)NoteElement.DeepCopy(); } if (Condition != null) { dest.Condition = new List <Hl7.Fhir.Model.FamilyMemberHistory.FamilyMemberHistoryConditionComponent>(Condition.DeepCopy()); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
public static void Run() { // ExStart:CreateNoteStructureElement // The path to the documents directory. string dataDir = RunExamples.GetDataDir_AsposePdf_WorkingDocuments(); string outFile = dataDir + "45929_doc.pdf"; string logFile = dataDir + "45929_log.xml"; // Create Pdf Document Document document = new Document(); ITaggedContent taggedContent = document.TaggedContent; taggedContent.SetTitle("Sample of Note Elements"); taggedContent.SetLanguage("en-US"); // Add Paragraph Element ParagraphElement paragraph = taggedContent.CreateParagraphElement(); taggedContent.RootElement.AppendChild(paragraph); // Add NoteElement NoteElement note1 = taggedContent.CreateNoteElement(); paragraph.AppendChild(note1); note1.SetText("Note with auto generate ID. "); // Add NoteElement NoteElement note2 = taggedContent.CreateNoteElement(); paragraph.AppendChild(note2); note2.SetText("Note with ID = 'note_002'. "); note2.SetId("note_002"); // Add NoteElement NoteElement note3 = taggedContent.CreateNoteElement(); paragraph.AppendChild(note3); note3.SetText("Note with ID = 'note_003'. "); note3.SetId("note_003"); // Must throw exception - Aspose.Pdf.Tagged.TaggedException : Structure element with ID='note_002' already exists //note3.SetId("note_002"); // Resultant document does not compliance to PDF/UA If ClearId() used for Note Structure Element //note3.ClearId(); // Save Tagged Pdf Document document.Save(outFile); // Checking PDF/UA compliance document = new Document(outFile); bool isPdfUaCompliance = document.Validate(logFile, PdfFormat.PDF_UA_1); Console.WriteLine(String.Format("PDF/UA compliance: {0}", isPdfUaCompliance)); // ExEnd:CreateNoteStructureElement }
public async Task <IActionResult> OnGet() { noteElement = new NoteElement(); Elements = await db.Elements.Where(m => m.userId == User.Identity.Name).ToListAsync(); Module = await db.Modules.Where(m => m.IdModule == Elements.FirstOrDefault().IdModule).FirstAsync(); Etudiants = await db.ApplicationUsers.Where(m => m.IdFil == Module.IdFil).ToListAsync(); return(Page()); }
public override ErrorList Validate() { var result = new ErrorList(); result.AddRange(base.Validate()); if (Subject != null) { result.AddRange(Subject.Validate()); } if (NoteElement != null) { result.AddRange(NoteElement.Validate()); } if (Relation != null) { Relation.ForEach(elem => result.AddRange(elem.Validate())); } return(result); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as FamilyHistoryRelationComponent; if (dest != null) { base.CopyTo(dest); if (NameElement != null) { dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy(); } if (Relationship != null) { dest.Relationship = (Hl7.Fhir.Model.CodeableConcept)Relationship.DeepCopy(); } if (Born != null) { dest.Born = (Hl7.Fhir.Model.Element)Born.DeepCopy(); } if (Deceased != null) { dest.Deceased = (Hl7.Fhir.Model.Element)Deceased.DeepCopy(); } if (NoteElement != null) { dest.NoteElement = (Hl7.Fhir.Model.FhirString)NoteElement.DeepCopy(); } if (Condition != null) { dest.Condition = new List <Hl7.Fhir.Model.FamilyHistory.FamilyHistoryRelationConditionComponent>(Condition.DeepCopy()); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as Alert; if (dest != null) { base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (Category != null) { dest.Category = (Hl7.Fhir.Model.CodeableConcept)Category.DeepCopy(); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.Alert.AlertStatus>)StatusElement.DeepCopy(); } if (Subject != null) { dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); } if (Author != null) { dest.Author = (Hl7.Fhir.Model.ResourceReference)Author.DeepCopy(); } if (NoteElement != null) { dest.NoteElement = (Hl7.Fhir.Model.FhirString)NoteElement.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as MedicationStatement; if (dest != null) { base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (Patient != null) { dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); } if (InformationSource != null) { dest.InformationSource = (Hl7.Fhir.Model.ResourceReference)InformationSource.DeepCopy(); } if (DateAssertedElement != null) { dest.DateAssertedElement = (Hl7.Fhir.Model.FhirDateTime)DateAssertedElement.DeepCopy(); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.MedicationStatement.MedicationStatementStatus>)StatusElement.DeepCopy(); } if (WasNotTakenElement != null) { dest.WasNotTakenElement = (Hl7.Fhir.Model.FhirBoolean)WasNotTakenElement.DeepCopy(); } if (ReasonNotTaken != null) { dest.ReasonNotTaken = new List <Hl7.Fhir.Model.CodeableConcept>(ReasonNotTaken.DeepCopy()); } if (ReasonForUse != null) { dest.ReasonForUse = (Hl7.Fhir.Model.Element)ReasonForUse.DeepCopy(); } if (Effective != null) { dest.Effective = (Hl7.Fhir.Model.Element)Effective.DeepCopy(); } if (NoteElement != null) { dest.NoteElement = (Hl7.Fhir.Model.FhirString)NoteElement.DeepCopy(); } if (SupportingInformation != null) { dest.SupportingInformation = new List <Hl7.Fhir.Model.ResourceReference>(SupportingInformation.DeepCopy()); } if (Medication != null) { dest.Medication = (Hl7.Fhir.Model.Element)Medication.DeepCopy(); } if (Dosage != null) { dest.Dosage = new List <Hl7.Fhir.Model.MedicationStatement.DosageComponent>(Dosage.DeepCopy()); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
void seatLayout() { this.canvas_Thumbnail.Children.Clear(); this.canvas_Seat.Children.Clear();//座位图中移除所有子元素 viewModel.AllSeatCount = viewModel.Layout.Seats.Count; int SeatWidth = 24 * viewModel.Layout.SeatCol; int SeatHeight = 24 * viewModel.Layout.SeatRow; this.canvas_Seat.Width = SeatWidth; this.canvas_Seat.Height = SeatHeight; double areaScaleX = SeatWidth / SeatWindow.Width; double areaScaleY = SeatHeight / SeatWindow.Height; if (SeatWidth >= SeatHeight) { scaleX = SeatWidth / canvas_Thumbnail.Width; scaleY = SeatWidth / canvas_Thumbnail.Height; moveY = (SeatWidth - SeatHeight) / 2 / scaleY; } else { scaleX = SeatHeight / canvas_Thumbnail.Width; scaleY = SeatHeight / canvas_Thumbnail.Height; moveX = (SeatHeight - SeatWidth) / 2 / scaleX; } //scaleX = SeatWidth / canvas_Thumbnail.Width; //scaleY = SeatHeight / canvas_Thumbnail.Height; try { Canvas.SetLeft(canvas_Seat, 0); Canvas.SetTop(canvas_Seat, 0); } catch { } #region 布局座位 Code.GetSeatNoteImage getImage = new GetSeatNoteImage(); ReadingRoomInfo roomInfo = viewModel.clientObject.EnterOutLogData.Student.AtReadingRoom; DateTime startTime = DateTime.Now; foreach (Seat seat in viewModel.Layout.Seats.Values) { seat.ShortSeatNo = SeatComm.SeatNoToShortSeatNo(roomInfo.Setting.SeatNumAmount, seat.SeatNo); #region 布局实际图, double canLeft = 24 * (double)seat.PositionX; double canTop = 24 * (double)seat.PositionY; SeatButton seatBtn = new SeatButton(); seatBtn.Width = 48; seatBtn.Height = 48; seatBtn.ShortSeatNo = seat.ShortSeatNo; seatBtn.SeatNo = seat.SeatNo; seatBtn.Background = SeatFormImageBrush.GetInstance(viewModel.clientObject.ClientSetting.DeviceSetting.BackImgage).ImgSeat; if (seat.HavePower) { seatBtn.PowerImg = SeatFormImageBrush.GetInstance(viewModel.clientObject.ClientSetting.DeviceSetting.BackImgage).ImgPower; } switch (seat.SeatUsedState) { case SeatManage.EnumType.EnterOutLogType.Leave: if (seat.IsSuspended) { seatBtn.ReaderBackground = SeatFormImageBrush.GetInstance(viewModel.clientObject.ClientSetting.DeviceSetting.BackImgage).ImgStopUse; viewModel.AllSeatCount -= 1; } else { seatBtn.MouseLeftButtonUp += new MouseButtonEventHandler(seatBtn_MouseLeftButtonUp); viewModel.LastSeatCount += 1; seatBtn.lblSeatNo.Visibility = System.Windows.Visibility.Visible; } //frmResolution.ViewModel.SeatAmcountFree += 1;//遇到空闲座位,ViewModel空闲座位数+1 //seatBtn.MouseLeftButtonUp += new MouseButtonEventHandler(seatBtn_MouseLeftButtonUp); break; case SeatManage.EnumType.EnterOutLogType.SelectSeat: case SeatManage.EnumType.EnterOutLogType.ReselectSeat: case SeatManage.EnumType.EnterOutLogType.ComeBack: case SeatManage.EnumType.EnterOutLogType.ContinuedTime: case SeatManage.EnumType.EnterOutLogType.BookingConfirmation: case SeatManage.EnumType.EnterOutLogType.WaitingSuccess: seatBtn.ReaderBackground = SeatFormImageBrush.GetInstance(viewModel.clientObject.ClientSetting.DeviceSetting.BackImgage).ImgReader; if (roomInfo.Setting.NoManagement.Used) { seatBtn.MouseLeftButtonUp += new MouseButtonEventHandler(seatBtn_WaitSeat); } break; case SeatManage.EnumType.EnterOutLogType.ShortLeave: seatBtn.ReaderBackground = SeatFormImageBrush.GetInstance(viewModel.clientObject.ClientSetting.DeviceSetting.BackImgage).ImgReader; seatBtn.ShowleaveImg = SeatFormImageBrush.GetInstance(viewModel.clientObject.ClientSetting.DeviceSetting.BackImgage).ImgShortLeave; break; case SeatManage.EnumType.EnterOutLogType.BespeakWaiting: seatBtn.ReaderBackground = SeatFormImageBrush.GetInstance(viewModel.clientObject.ClientSetting.DeviceSetting.BackImgage).ImgBook; if (roomInfo.Setting.SeatBespeak.SelectBespeakSeat) { seatBtn.MouseLeftButtonUp += new MouseButtonEventHandler(seatBtn_SelectBookingSeat); } break; } seatBtn.lblSeatNo.RenderTransform = new RotateTransform(-seat.RotationAngle); seatBtn.lblSeatNo.RenderTransformOrigin = new Point(0.5, 0.5); seatBtn.RenderTransform = new RotateTransform(seat.RotationAngle); seatBtn.RenderTransformOrigin = new Point(0.5, 0.5); this.canvas_Seat.Children.Add(seatBtn); Canvas.SetLeft(seatBtn, canLeft); Canvas.SetTop(seatBtn, canTop); #endregion #region 布局缩略图 Rectangle rec = new Rectangle(); rec.Width = 36 / scaleX; rec.Height = 36 / scaleY; double thumbLeft = (double)(seat.PositionX * (double)24 + 6) / scaleX; double thumbTop = (double)(seat.PositionY * (double)24 + 6) / scaleY; switch (seat.SeatUsedState) { case SeatManage.EnumType.EnterOutLogType.Leave: rec.Fill = new SolidColorBrush(Color.FromRgb(220, 220, 220)); if (seat.IsSuspended) { rec.Fill = new SolidColorBrush(Color.FromRgb(234, 38, 52)); } break; case SeatManage.EnumType.EnterOutLogType.SelectSeat: case SeatManage.EnumType.EnterOutLogType.ReselectSeat: case SeatManage.EnumType.EnterOutLogType.ComeBack: case SeatManage.EnumType.EnterOutLogType.ContinuedTime: case SeatManage.EnumType.EnterOutLogType.ShortLeave: case SeatManage.EnumType.EnterOutLogType.BespeakWaiting: case SeatManage.EnumType.EnterOutLogType.BookingConfirmation: case SeatManage.EnumType.EnterOutLogType.WaitingSuccess: rec.Fill = new SolidColorBrush(Color.FromRgb(234, 38, 52)); break; } rec.RenderTransformOrigin = new Point(0.5, 0.5); rec.RenderTransform = new RotateTransform(seat.RotationAngle); this.canvas_Thumbnail.Children.Add(rec); Canvas.SetZIndex(rec, 0); Canvas.SetLeft(rec, thumbLeft + moveX); Canvas.SetTop(rec, thumbTop + moveY); #endregion } TimeSpan ts = DateTime.Now - startTime; Console.WriteLine("执行时间:" + ts.TotalSeconds); //frmResolution.ViewModel.SeatAmcountUsed = frmResolution.ViewModel.SeatAmcountAll - frmResolution.ViewModel.SeatAmcountFree; #endregion #region 布局备注 foreach (Note note in viewModel.Layout.Notes) { #region 实际图 NoteElement element = new NoteElement(); if (note.Type == SeatManage.EnumType.OrnamentType.Table) { element.BorderThickness = new Thickness(1); element.BorderBrush = new SolidColorBrush(Colors.Black); } //element.BorderThickness = new Thickness(1); //element.BorderBrush = new SolidColorBrush(Colors.Yellow); element.Width = note.BaseWidth * 24; element.Height = note.BaseHeight * 24; element.Notes = note.Remark; element.RenderTransformOrigin = new Point(0.5, 0.5); element.RenderTransform = new RotateTransform(note.RotationAngle); element.NoteType = note.Type; Canvas.SetLeft(element.lbRemark, element.Width / 2 - element.lbRemark.Width / 2); this.canvas_Seat.Children.Add(element); double canLeft = 24 * (double)note.PositionX; double canTop = 24 * (double)note.PositionY; Canvas.SetLeft(element, canLeft); Canvas.SetTop(element, canTop); #endregion #region 缩略图 switch (note.Type) { case SeatManage.EnumType.OrnamentType.Door: case SeatManage.EnumType.OrnamentType.Steps: break; case SeatManage.EnumType.OrnamentType.Roundtable: case SeatManage.EnumType.OrnamentType.Plant: { Border br = new Border(); br.CornerRadius = new CornerRadius(note.BaseWidth * (double)12 / scaleX); br.BorderThickness = new Thickness(note.BaseWidth * (double)12 / scaleX); br.BorderBrush = new SolidColorBrush(Color.FromRgb(231, 186, 100)); double thumbLeft = (double)(24 / scaleX) * (double)note.PositionX; double thumbTop = (double)(24 / scaleY) * (double)note.PositionY; this.canvas_Thumbnail.Children.Add(br); Canvas.SetLeft(br, thumbLeft + moveX); Canvas.SetTop(br, thumbTop + moveY); } break; default: { Rectangle rec = new Rectangle(); rec.Width = (double)24 * note.BaseWidth / scaleX; rec.Height = (double)24 * note.BaseHeight / scaleY; double thumbLeft = (double)(24 / scaleX) * (double)note.PositionX; double thumbTop = (double)(24 / scaleY) * (double)note.PositionY; rec.RenderTransformOrigin = new Point(0.5, 0.5); rec.RenderTransform = new RotateTransform(note.RotationAngle); rec.Fill = new SolidColorBrush(Color.FromRgb(231, 186, 100)); this.canvas_Thumbnail.Children.Add(rec); Canvas.SetLeft(rec, thumbLeft + moveX); Canvas.SetTop(rec, thumbTop + moveY); } break; } #endregion } #endregion areaSimle = new System.Windows.Shapes.Rectangle(); areaSimle.Name = "areaSimle"; if (areaScaleX != 0) { areaSimle.Width = (canvas_Thumbnail.Width - moveX * 2) / areaScaleX;//按比例缩小层的宽度 } else { areaSimle.Width = canvas_Thumbnail.Width; } if (areaScaleY != 0) { areaSimle.Height = (canvas_Thumbnail.Height - moveY * 2) / areaScaleY; //按比例缩小层的高度 } else { areaSimle.Height = canvas_Thumbnail.Height; } areaSimle.Fill = new SolidColorBrush(Colors.White); areaSimle.Opacity = 0.5; this.canvas_Thumbnail.Children.Add(areaSimle); Canvas.SetZIndex(areaSimle, 1000); Canvas.SetTop(areaSimle, moveY); Canvas.SetLeft(areaSimle, moveX); //小的范围层。最后创建,防止被遮盖 }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as List; if (dest == null) { throw new ArgumentException("Can only copy to an object of the same type", "other"); } base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (TitleElement != null) { dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy(); } if (Code != null) { dest.Code = (Hl7.Fhir.Model.CodeableConcept)Code.DeepCopy(); } if (Subject != null) { dest.Subject = (Hl7.Fhir.Model.ResourceReference)Subject.DeepCopy(); } if (Source != null) { dest.Source = (Hl7.Fhir.Model.ResourceReference)Source.DeepCopy(); } if (Encounter != null) { dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.List.ListStatus>)StatusElement.DeepCopy(); } if (DateElement != null) { dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy(); } if (OrderedBy != null) { dest.OrderedBy = (Hl7.Fhir.Model.CodeableConcept)OrderedBy.DeepCopy(); } if (ModeElement != null) { dest.ModeElement = (Code <Hl7.Fhir.Model.ListMode>)ModeElement.DeepCopy(); } if (NoteElement != null) { dest.NoteElement = (Hl7.Fhir.Model.FhirString)NoteElement.DeepCopy(); } if (Entry != null) { dest.Entry = new List <Hl7.Fhir.Model.List.EntryComponent>(Entry.DeepCopy()); } if (EmptyReason != null) { dest.EmptyReason = (Hl7.Fhir.Model.CodeableConcept)EmptyReason.DeepCopy(); } return(dest); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as MedicationDispense; if (dest != null) { base.CopyTo(dest); if (Identifier != null) { dest.Identifier = (Hl7.Fhir.Model.Identifier)Identifier.DeepCopy(); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.MedicationDispense.MedicationDispenseStatus>)StatusElement.DeepCopy(); } if (Patient != null) { dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); } if (Dispenser != null) { dest.Dispenser = (Hl7.Fhir.Model.ResourceReference)Dispenser.DeepCopy(); } if (AuthorizingPrescription != null) { dest.AuthorizingPrescription = new List <Hl7.Fhir.Model.ResourceReference>(AuthorizingPrescription.DeepCopy()); } if (Type != null) { dest.Type = (Hl7.Fhir.Model.CodeableConcept)Type.DeepCopy(); } if (Quantity != null) { dest.Quantity = (Hl7.Fhir.Model.Quantity)Quantity.DeepCopy(); } if (DaysSupply != null) { dest.DaysSupply = (Hl7.Fhir.Model.Quantity)DaysSupply.DeepCopy(); } if (Medication != null) { dest.Medication = (Hl7.Fhir.Model.ResourceReference)Medication.DeepCopy(); } if (WhenPreparedElement != null) { dest.WhenPreparedElement = (Hl7.Fhir.Model.FhirDateTime)WhenPreparedElement.DeepCopy(); } if (WhenHandedOverElement != null) { dest.WhenHandedOverElement = (Hl7.Fhir.Model.FhirDateTime)WhenHandedOverElement.DeepCopy(); } if (Destination != null) { dest.Destination = (Hl7.Fhir.Model.ResourceReference)Destination.DeepCopy(); } if (Receiver != null) { dest.Receiver = new List <Hl7.Fhir.Model.ResourceReference>(Receiver.DeepCopy()); } if (NoteElement != null) { dest.NoteElement = (Hl7.Fhir.Model.FhirString)NoteElement.DeepCopy(); } if (DosageInstruction != null) { dest.DosageInstruction = new List <Hl7.Fhir.Model.MedicationDispense.MedicationDispenseDosageInstructionComponent>(DosageInstruction.DeepCopy()); } if (Substitution != null) { dest.Substitution = (Hl7.Fhir.Model.MedicationDispense.MedicationDispenseSubstitutionComponent)Substitution.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as MedicationAdministration; if (dest != null) { base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.MedicationAdministrationStatus>)StatusElement.DeepCopy(); } if (Patient != null) { dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); } if (Practitioner != null) { dest.Practitioner = (Hl7.Fhir.Model.ResourceReference)Practitioner.DeepCopy(); } if (Encounter != null) { dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); } if (Prescription != null) { dest.Prescription = (Hl7.Fhir.Model.ResourceReference)Prescription.DeepCopy(); } if (WasNotGivenElement != null) { dest.WasNotGivenElement = (Hl7.Fhir.Model.FhirBoolean)WasNotGivenElement.DeepCopy(); } if (ReasonNotGiven != null) { dest.ReasonNotGiven = new List <Hl7.Fhir.Model.CodeableConcept>(ReasonNotGiven.DeepCopy()); } if (ReasonGiven != null) { dest.ReasonGiven = new List <Hl7.Fhir.Model.CodeableConcept>(ReasonGiven.DeepCopy()); } if (EffectiveTime != null) { dest.EffectiveTime = (Hl7.Fhir.Model.Element)EffectiveTime.DeepCopy(); } if (Medication != null) { dest.Medication = (Hl7.Fhir.Model.Element)Medication.DeepCopy(); } if (Device != null) { dest.Device = new List <Hl7.Fhir.Model.ResourceReference>(Device.DeepCopy()); } if (NoteElement != null) { dest.NoteElement = (Hl7.Fhir.Model.FhirString)NoteElement.DeepCopy(); } if (Dosage != null) { dest.Dosage = (Hl7.Fhir.Model.MedicationAdministration.DosageComponent)Dosage.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
private void ParseVariableNote(string line, Variable variable) { var noteElement = new NoteElement(); if (line[currentIndex] == '~') { noteElement.Note = ParseRelativeVariable(line, variable); } else { StringBuilder note = new StringBuilder(line.Substring(currentIndex, 2), 3); if (line[currentIndex] < 'A' || line[currentIndex] > 'G') { throw new CompilationException($"Expected a value between 'A' and 'G' not '{line[currentIndex]}' at {currentLine}:{currentIndex}"); } if (line[currentIndex + 1] < '1' || line[currentIndex + 1] > '6') { throw new CompilationException($"Expected a value between '1' and '6' not '{line[currentIndex + 1]}' at {currentLine}:{currentIndex}"); } currentIndex += 2; if (line[currentIndex] == '#' || line[currentIndex] == 'b') { if (line[currentIndex] == '#') { HigherNote(note); } if (!HasBemolle(note)) { throw new CompilationException($"'{note}' note hasn't a bemolle! (at {currentLine}:{currentIndex})"); } note.Append(note[1]);//move a number to the 3rd position note[1] = 'b'; ++currentIndex; } noteElement.Note = note.ToString(); } if (line[currentIndex] != '!') { throw new CompilationException($"Expected '!' at {currentLine}:{currentIndex}"); } ++currentIndex; if (!char.IsDigit(line[currentIndex])) { throw new CompilationException($"Expected digit at {currentLine}:{currentIndex}"); } noteElement.PressLevel = line[currentIndex] - '0'; if (noteElement.PressLevel > 3 || noteElement.PressLevel < 1) { throw new CompilationException($"Invalid press value '{noteElement.PressLevel}' at {currentLine}:{currentIndex}"); } ++currentIndex; if (line[currentIndex] == '_') { ++currentIndex; if (!char.IsDigit(line[currentIndex])) { throw new CompilationException($"Expected a digit at {currentLine}:{currentIndex}"); } string numberStr; currentIndex = ParserHelper.ReadNumber(line, currentIndex, true, out numberStr); if (string.IsNullOrEmpty(numberStr)) { throw new CompilationException($"Expected a number at {currentLine}:{currentIndex}"); } noteElement.Duration = PianoSettings.Instance().GetNoteDuration(GetDuration(numberStr)); } else if (line[currentIndex] == '=') { ++currentIndex; string numberStr; currentIndex = ParserHelper.ReadNumber(line, currentIndex, false, out numberStr); if (string.IsNullOrEmpty(numberStr)) { throw new CompilationException($"Expected a number at {currentLine}:{currentIndex}"); } double duration; bool ok = double.TryParse(numberStr, out duration); if (!ok) { throw new CompilationException($"Expected a number at {currentLine}:{currentIndex}"); } noteElement.Duration = duration; } else { throw new CompilationException($"Expected '_' or '=' at {currentLine}:{currentIndex}"); } variable.Elements.Add(noteElement); }
public override IDeepCopyable CopyTo(IDeepCopyable other) { var dest = other as MedicationOrder; if (dest != null) { base.CopyTo(dest); if (Identifier != null) { dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy()); } if (DateWrittenElement != null) { dest.DateWrittenElement = (Hl7.Fhir.Model.FhirDateTime)DateWrittenElement.DeepCopy(); } if (StatusElement != null) { dest.StatusElement = (Code <Hl7.Fhir.Model.MedicationOrder.MedicationOrderStatus>)StatusElement.DeepCopy(); } if (DateEndedElement != null) { dest.DateEndedElement = (Hl7.Fhir.Model.FhirDateTime)DateEndedElement.DeepCopy(); } if (ReasonEnded != null) { dest.ReasonEnded = (Hl7.Fhir.Model.CodeableConcept)ReasonEnded.DeepCopy(); } if (Patient != null) { dest.Patient = (Hl7.Fhir.Model.ResourceReference)Patient.DeepCopy(); } if (Prescriber != null) { dest.Prescriber = (Hl7.Fhir.Model.ResourceReference)Prescriber.DeepCopy(); } if (Encounter != null) { dest.Encounter = (Hl7.Fhir.Model.ResourceReference)Encounter.DeepCopy(); } if (Reason != null) { dest.Reason = (Hl7.Fhir.Model.Element)Reason.DeepCopy(); } if (NoteElement != null) { dest.NoteElement = (Hl7.Fhir.Model.FhirString)NoteElement.DeepCopy(); } if (Medication != null) { dest.Medication = (Hl7.Fhir.Model.Element)Medication.DeepCopy(); } if (DosageInstruction != null) { dest.DosageInstruction = new List <Hl7.Fhir.Model.MedicationOrder.MedicationOrderDosageInstructionComponent>(DosageInstruction.DeepCopy()); } if (DispenseRequest != null) { dest.DispenseRequest = (Hl7.Fhir.Model.MedicationOrder.MedicationOrderDispenseRequestComponent)DispenseRequest.DeepCopy(); } if (Substitution != null) { dest.Substitution = (Hl7.Fhir.Model.MedicationOrder.MedicationOrderSubstitutionComponent)Substitution.DeepCopy(); } if (PriorPrescription != null) { dest.PriorPrescription = (Hl7.Fhir.Model.ResourceReference)PriorPrescription.DeepCopy(); } return(dest); } else { throw new ArgumentException("Can only copy to an object of the same type", "other"); } }
private void seatLayout_note() { if (SeatCache.NoteList == null) { SeatCache.NoteList = new List <NoteElement>(); } var list = SeatCache.NoteList.Where(p => p.ReadingRoomNum == this.RoomNoStr).ToList(); if (list.Count > 0) { foreach (NoteElement noteElement in list) { this.canvas_Seat.Children.Add(noteElement.noteUC); Canvas.SetLeft(noteElement.noteUC, noteElement.noteLeft); Canvas.SetTop(noteElement.noteUC, noteElement.noteTop); switch (noteElement.noteType) { case SeatManage.EnumType.OrnamentType.Door: case SeatManage.EnumType.OrnamentType.Steps: break; case SeatManage.EnumType.OrnamentType.Roundtable: case SeatManage.EnumType.OrnamentType.Plant: { this.canvas_Thumbnail.Children.Add(noteElement.br); Canvas.SetLeft(noteElement.br, noteElement.recLeft); Canvas.SetTop(noteElement.br, noteElement.recTop); } break; default: { this.canvas_Thumbnail.Children.Add(noteElement.rec); Panel.SetZIndex(noteElement.rec, 0); Canvas.SetLeft(noteElement.rec, noteElement.recLeft); Canvas.SetTop(noteElement.rec, noteElement.recTop); } break; } } } else { #region 布局备注 foreach (Note note in viewModel.Layout.Notes) { #region 实际图 ViewModel.NoteUC_ViewModel noteVM = new ViewModel.NoteUC_ViewModel(); noteVM.Notes = note.Remark; noteVM.NoteType = note.Type; UC_Note element = new UC_Note(noteVM); if (note.Type == SeatManage.EnumType.OrnamentType.Table) { element.BorderThickness = new Thickness(1); element.BorderBrush = new SolidColorBrush(Colors.Black); } element.Width = note.BaseWidth * 24; element.Height = note.BaseHeight * 24; element.RenderTransformOrigin = new Point(0.5, 0.5); element.RenderTransform = new RotateTransform(note.RotationAngle); canvas_Seat.Children.Add(element); double canLeft = 24 * note.PositionX; double canTop = 24 * note.PositionY; Canvas.SetLeft(element, canLeft); Canvas.SetTop(element, canTop); #endregion var noteElement = new NoteElement(); #region 缩略图 switch (note.Type) { case SeatManage.EnumType.OrnamentType.Door: case SeatManage.EnumType.OrnamentType.Steps: break; case SeatManage.EnumType.OrnamentType.Roundtable: case SeatManage.EnumType.OrnamentType.Plant: { Border br = new Border(); br.CornerRadius = new CornerRadius(note.BaseWidth * 12 / scaleX); br.BorderThickness = new Thickness(note.BaseWidth * 12 / scaleX); br.BorderBrush = new SolidColorBrush(Color.FromRgb(231, 186, 100)); double thumbLeft = 24 / scaleX * note.PositionX; double thumbTop = 24 / scaleY * note.PositionY; canvas_Thumbnail.Children.Add(br); Canvas.SetLeft(br, thumbLeft + moveX); Canvas.SetTop(br, thumbTop + moveY); noteElement.br = br; noteElement.recLeft = (float)(thumbLeft + moveX); noteElement.recTop = (float)(thumbTop + moveY); } break; default: { Rectangle rec = new Rectangle(); rec.Width = 24 * note.BaseWidth / scaleX; rec.Height = 24 * note.BaseHeight / scaleY; double thumbLeft = 24 / scaleX * note.PositionX; double thumbTop = 24 / scaleY * note.PositionY; rec.RenderTransformOrigin = new Point(0.5, 0.5); rec.RenderTransform = new RotateTransform(note.RotationAngle); rec.Fill = new SolidColorBrush(Color.FromRgb(231, 186, 100)); canvas_Thumbnail.Children.Add(rec); Canvas.SetLeft(rec, thumbLeft + moveX); Canvas.SetTop(rec, thumbTop + moveY); noteElement.rec = rec; noteElement.recLeft = (float)(thumbLeft + moveX); noteElement.recTop = (float)(thumbTop + moveY); } break; } noteElement.noteLeft = (float)canLeft; noteElement.noteTop = (float)canTop; noteElement.noteUC = element; noteElement.ReadingRoomNum = RoomNoStr; SeatCache.NoteList.Add(noteElement); #endregion } #endregion } }