本文整理汇总了C#中Package.DeepClone方法的典型用法代码示例。如果您正苦于以下问题:C# Package.DeepClone方法的具体用法?C# Package.DeepClone怎么用?C# Package.DeepClone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Package
的用法示例。
在下文中一共展示了Package.DeepClone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EditPackageDialog
public EditPackageDialog(Package package, bool bCreateNew)
: base()
{
InitializeComponent();
InitializeDialogPanel(true/*bModal*/, x_Name);
base.Closed += OnDialogClosed;
m_Title = x_Title;
m_ParentSearch = null;
m_DataGrid = x_DataGrid;
m_ListControl = x_ListControl;
m_Prev = x_Prev;
m_Next = x_Next;
m_RootPackageOrig = package;
m_RootPackage = m_RootPackageOrig.DeepClone();
m_bCreateNew = bCreateNew;
if (m_bCreateNew)
{
ProfileDate startProfileDate = ProfileCode.StartOfPlan.ToProfileDate();// or App.Model.ProfileHolder.Profile.StartProfileDate, or DateTime.Now.ToJulian()
ProfileDate endProfileDate = ProfileCode.EndOfPlan.ToProfileDate();// or App.Model.ProfileHolder.Profile.EndProfileDate;
m_RootPackage.SetDates(startProfileDate, endProfileDate);
m_RootPackage.MustHaveATransaction();
}
m_TitleFormat = (m_bCreateNew ? "Add" : "Edit") + " the '{0}' spending source";
}
示例2: DatabasePackageDialog
public DatabasePackageDialog(Package package)
: base()
{
InitializeComponent();
InitializeDialogPanel(true/*bModal*/, x_Name);
base.Closed += OnDialogClosed;
m_Title = x_Title;
m_ParentSearch = x_ParentSearch;
m_DataGrid = x_DataGrid;
m_ListControl = x_ListControl;
m_Prev = x_Prev;
m_Next = x_Next;
if (package == null)
{
m_bCreateNew = true;
m_RootPackageOrig = null;
m_RootPackage = Package.CreateDefault();
m_RootPackage.MustHaveATransaction();
}
else
{
m_bCreateNew = false;
m_RootPackageOrig = package;
m_RootPackage = package.DeepClone();
}
m_TitleFormat = (m_bCreateNew ? "Add a new database package" : "Edit the '{0}' database package");
}