Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Update] auto generated rowviewmodels and dialogviewmodel #670

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 44 additions & 25 deletions CDP4Composition/CommonView/AutoGenRows/ActionItemRowViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,52 +1,73 @@
// -------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ActionItemRowViewModel.cs" company="RHEA System S.A.">
// Copyright (c) 2015-2018 RHEA System S.A.
// Copyright (c) 2015-2021 RHEA System S.A.
//
// Author: Sam Gerené, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski, Ahmed Abulwafa Ahmed
//
// This file is part of CDP4-IME Community Edition.
// This is an auto-generated class. Any manual changes to this file will be overwritten!
//
// The CDP4-IME Community Edition is free software; you can redistribute it and/or
// modify it under the terms of the GNU Affero General Public
// License as published by the Free Software Foundation; either
// version 3 of the License, or (at your option) any later version.
//
// The CDP4-IME Community Edition is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// </copyright>
// <summary>
// This is an auto-generated class. Any manual changes on this file will be overwritten!
// </summary>
// -------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------

namespace CDP4CommonView
{
using System;
using System.Reactive.Linq;

using CDP4Common.CommonData;
using CDP4Common.DiagramData;
using CDP4Common.EngineeringModelData;
using CDP4Common.ReportingData;
using CDP4Common.SiteDirectoryData;

using CDP4Composition.Mvvm;

using CDP4Dal;
using CDP4Dal.Events;
using CDP4Dal.Permission;
using CDP4Dal.Permission;

using ReactiveUI;

/// <summary>
/// Row class representing a <see cref="ActionItem"/>
/// </summary>
public partial class ActionItemRowViewModel : ModellingAnnotationItemRowViewModel<ActionItem>
{

/// <summary>
/// Backing field for <see cref="DueDate"/>
/// Backing field for <see cref="Actionee"/> property
/// </summary>
private DateTime dueDate;
private Participant actionee;

/// <summary>
/// Backing field for <see cref="CloseOutDate"/>
/// Backing field for <see cref="CloseOutDate"/> property
/// </summary>
private DateTime closeOutDate;

/// <summary>
/// Backing field for <see cref="CloseOutStatement"/>
/// Backing field for <see cref="CloseOutStatement"/> property
/// </summary>
private string closeOutStatement;

/// <summary>
/// Backing field for <see cref="Actionee"/>
/// Backing field for <see cref="DueDate"/> property
/// </summary>
private Participant actionee;
private DateTime dueDate;

/// <summary>
/// Initializes a new instance of the <see cref="ActionItemRowViewModel"/> class
Expand All @@ -59,14 +80,13 @@ public ActionItemRowViewModel(ActionItem actionItem, ISession session, IViewMode
this.UpdateProperties();
}


/// <summary>
/// Gets or sets the DueDate
/// Gets or sets the Actionee
/// </summary>
public DateTime DueDate
public Participant Actionee
{
get { return this.dueDate; }
set { this.RaiseAndSetIfChanged(ref this.dueDate, value); }
get { return this.actionee; }
set { this.RaiseAndSetIfChanged(ref this.actionee, value); }
}

/// <summary>
Expand All @@ -88,15 +108,14 @@ public string CloseOutStatement
}

/// <summary>
/// Gets or sets the Actionee
/// Gets or sets the DueDate
/// </summary>
public Participant Actionee
public DateTime DueDate
{
get { return this.actionee; }
set { this.RaiseAndSetIfChanged(ref this.actionee, value); }
get { return this.dueDate; }
set { this.RaiseAndSetIfChanged(ref this.dueDate, value); }
}


/// <summary>
/// The event-handler that is invoked by the subscription that listens for updates
/// on the <see cref="Thing"/> that is being represented by the view-model
Expand All @@ -107,6 +126,7 @@ public Participant Actionee
protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange)
{
base.ObjectChangeEventHandler(objectChange);

this.UpdateProperties();
}

Expand All @@ -115,14 +135,13 @@ protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange
/// </summary>
private void UpdateProperties()
{
this.ModifiedOn = this.Thing.ModifiedOn;
this.DueDate = this.Thing.DueDate;
if(this.Thing.CloseOutDate.HasValue)
this.Actionee = this.Thing.Actionee;
if (this.Thing.CloseOutDate.HasValue)
{
this.CloseOutDate = this.Thing.CloseOutDate.Value;
}
this.CloseOutStatement = this.Thing.CloseOutStatement;
this.Actionee = this.Thing.Actionee;
this.DueDate = this.Thing.DueDate;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,57 +1,78 @@
// -------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ActualFiniteStateListRowViewModel.cs" company="RHEA System S.A.">
// Copyright (c) 2015-2018 RHEA System S.A.
// Copyright (c) 2015-2021 RHEA System S.A.
//
// Author: Sam Gerené, Alex Vorobiev, Naron Phou, Alexander van Delft, Nathanael Smiechowski, Ahmed Abulwafa Ahmed
//
// This file is part of CDP4-IME Community Edition.
// This is an auto-generated class. Any manual changes to this file will be overwritten!
//
// The CDP4-IME Community Edition is free software; you can redistribute it and/or
// modify it under the terms of the GNU Affero General Public
// License as published by the Free Software Foundation; either
// version 3 of the License, or (at your option) any later version.
//
// The CDP4-IME Community Edition is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// </copyright>
// <summary>
// This is an auto-generated class. Any manual changes on this file will be overwritten!
// </summary>
// -------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------

namespace CDP4CommonView
{
using System;
using System.Reactive.Linq;

using CDP4Common.CommonData;
using CDP4Common.DiagramData;
using CDP4Common.EngineeringModelData;
using CDP4Common.ReportingData;
using CDP4Common.SiteDirectoryData;

using CDP4Composition.Mvvm;

using CDP4Dal;
using CDP4Dal.Events;
using CDP4Dal.Permission;
using CDP4Dal.Permission;

using ReactiveUI;

/// <summary>
/// Row class representing a <see cref="ActualFiniteStateList"/>
/// </summary>
public partial class ActualFiniteStateListRowViewModel : RowViewModelBase<ActualFiniteStateList>
{

/// <summary>
/// Backing field for <see cref="Name"/>
/// Backing field for <see cref="Name"/> property
/// </summary>
private string name;

/// <summary>
/// Backing field for <see cref="ShortName"/>
/// Backing field for <see cref="Owner"/> property
/// </summary>
private string shortName;
private DomainOfExpertise owner;

/// <summary>
/// Backing field for <see cref="Owner"/>
/// Backing field for <see cref="OwnerName"/> property
/// </summary>
private DomainOfExpertise owner;
private string ownerName;

/// <summary>
/// Backing field for <see cref="OwnerShortName"/>
/// Backing field for <see cref="OwnerShortName"/> property
/// </summary>
private string ownerShortName;

/// <summary>
/// Backing field for <see cref="OwnerName"/>
/// Backing field for <see cref="ShortName"/> property
/// </summary>
private string ownerName;
private string shortName;

/// <summary>
/// Initializes a new instance of the <see cref="ActualFiniteStateListRowViewModel"/> class
Expand All @@ -64,7 +85,6 @@ public ActualFiniteStateListRowViewModel(ActualFiniteStateList actualFiniteState
this.UpdateProperties();
}


/// <summary>
/// Gets or sets the Name
/// </summary>
Expand All @@ -75,21 +95,21 @@ public string Name
}

/// <summary>
/// Gets or sets the ShortName
/// Gets or sets the Owner
/// </summary>
public string ShortName
public DomainOfExpertise Owner
{
get { return this.shortName; }
set { this.RaiseAndSetIfChanged(ref this.shortName, value); }
get { return this.owner; }
set { this.RaiseAndSetIfChanged(ref this.owner, value); }
}

/// <summary>
/// Gets or sets the Owner
/// Gets or set the Name of <see cref="Owner"/>
/// </summary>
public DomainOfExpertise Owner
public string OwnerName
{
get { return this.owner; }
set { this.RaiseAndSetIfChanged(ref this.owner, value); }
get { return this.ownerName; }
set { this.RaiseAndSetIfChanged(ref this.ownerName, value); }
}

/// <summary>
Expand All @@ -102,15 +122,14 @@ public string OwnerShortName
}

/// <summary>
/// Gets or set the Name of <see cref="Owner"/>
/// Gets or sets the ShortName
/// </summary>
public string OwnerName
public string ShortName
{
get { return this.ownerName; }
set { this.RaiseAndSetIfChanged(ref this.ownerName, value); }
get { return this.shortName; }
set { this.RaiseAndSetIfChanged(ref this.shortName, value); }
}


/// <summary>
/// The event-handler that is invoked by the subscription that listens for updates
/// on the <see cref="Thing"/> that is being represented by the view-model
Expand All @@ -121,6 +140,7 @@ public string OwnerName
protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange)
{
base.ObjectChangeEventHandler(objectChange);

this.UpdateProperties();
}

Expand All @@ -129,15 +149,19 @@ protected override void ObjectChangeEventHandler(ObjectChangedEvent objectChange
/// </summary>
private void UpdateProperties()
{
this.ModifiedOn = this.Thing.ModifiedOn;
this.Name = this.Thing.Name;
this.ShortName = this.Thing.ShortName;
if (this.Thing.Owner != null)
{
this.OwnerShortName = this.Thing.Owner.ShortName;
this.OwnerName = this.Thing.Owner.Name;
}
this.Owner = this.Thing.Owner;
if (this.Thing.Owner != null)
{
this.OwnerName = this.Thing.Owner.Name;
this.OwnerShortName = this.Thing.Owner.ShortName;
}
else
{
this.OwnerName = string.Empty;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not 100% backwards compatible

this.OwnerShortName = string.Empty;
}
this.ShortName = this.Thing.ShortName;
}
}
}
Loading