Skip to content

Commit

Permalink
[Ticket #10764] Fixed typo, and updated copyright year to 2013
Browse files Browse the repository at this point in the history
  • Loading branch information
clinton@clearcanvas.ca committed Jan 15, 2013
0 parents commit 64f32e9
Show file tree
Hide file tree
Showing 11,464 changed files with 1,492,198 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
59 changes: 59 additions & 0 deletions .hgignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
syntax: glob
*.obj
*.pdb
*.user
*.aps
*.pch
*.vspscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.cache
*.ilk
*.log
*.lib
*.sbr
*.scc
*.gen.cs
*.gen.xml
*.orig
[Bb]in
[Dd]ebug*/
obj/
[Rr]elease*/
_ReSharper*/
[Tt]est[Rr]esult*
[Bb]uild[Ll]og.*
*.[Pp]ublish.xml
BuildProcessTemplates/*
Published/*
[Tt]humbs.db
[Uu]pgradeLog*.[Xx][Mm][Ll]
_[Uu]pgradeReport_Files*/
*.build.csdef
[Pp]ackage/*
ASPNETDB.MDF
aspnetdb_log.ldf
*.SR.resources
ClearCanvas.Common.xml
ClearCanvas.Desktop.xml
ImageViewer/ClearCanvas.ImageViewer.xml

# Viewer local datastore files
dicom_datastore/*.sdf
dicom_datastore/filestore/*.*
*.dcm
*studyXml.xml

# ImageServer files generated and copied by build scripts
ImageServer/Web/Application/App_Themes/Default/images/LoginSplash.png
ImageServer/Web/Application/ClientBin/Silverlight.xap
ImageServer/Web/Application/ClientBin/Silverlight.*.xap
ImageServer/Web/Application/Logging.config
ImageServer/Web/Application/Web.config
ImageServer/Web/Application/critical.config
ImageServer/Web/Application/Pages/Help/UsersGuide/*
Empty file added .hgtags
Empty file.
21 changes: 21 additions & 0 deletions COPYING.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright (c) 2012, ClearCanvas Inc.
All rights reserved.
http://www.clearcanvas.ca

This program is free software: you can redistribute it
and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.

This program 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 General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.

Portions of this program incorporates software licensed from
third parties. Those licenses and the software they apply to are
hereby acknowledged, the details of which are located at
<http://www.clearcanvas.ca/eula-scheduleA>.
78 changes: 78 additions & 0 deletions Common/Actions/ActionSet.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#region License

// Copyright (c) 2013, ClearCanvas Inc.
// All rights reserved.
// http://www.clearcanvas.ca
//
// This file is part of the ClearCanvas RIS/PACS open source project.
//
// The ClearCanvas RIS/PACS open source project is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// The ClearCanvas RIS/PACS open source project 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 General
// Public License for more details.
//
// You should have received a copy of the GNU General Public License along with
// the ClearCanvas RIS/PACS open source project. If not, see
// <http://www.gnu.org/licenses/>.

#endregion

using System;
using System.Collections.Generic;
using ClearCanvas.Common.Specifications;

namespace ClearCanvas.Common.Actions
{
/// <summary>
/// A class used to manage and execute a set of <see cref="Action{T}"/> instances.
/// </summary>
/// <typeparam name="T">A context used by the <see cref="Action{T}"/> instances.</typeparam>
public class ActionSet<T> : IActionSet<T>
{
private readonly IList<IActionItem<T>> _actionList;

/// <summary>
/// Constructor.
/// </summary>
/// <param name="list">The list of actions in the set.</param>
public ActionSet(IList<IActionItem<T>> list)
{
_actionList = list;
}

/// <summary>
/// Execute the actions associated with the set.
/// </summary>
/// <param name="context">The context used by the <see cref="Action{T}"/> instances in the set.</param>
/// <returns>A <see cref="TestResult"/> instance telling the result of executing the actions.</returns>
public TestResult Execute(T context)
{
List<TestResultReason> resultList = new List<TestResultReason>();

foreach (IActionItem<T> item in _actionList)
{
try
{
bool tempResult = item.Execute(context);

if (!tempResult)
resultList.Add(new TestResultReason(item.FailureReason));
}
catch (Exception e)
{
resultList.Add(new TestResultReason(e.Message));
}
}

if (resultList.Count == 0)
return new TestResult(true);

return new TestResult(false, resultList.ToArray());
}
}
}
44 changes: 44 additions & 0 deletions Common/Actions/IActionItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#region License

// Copyright (c) 2013, ClearCanvas Inc.
// All rights reserved.
// http://www.clearcanvas.ca
//
// This file is part of the ClearCanvas RIS/PACS open source project.
//
// The ClearCanvas RIS/PACS open source project is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// The ClearCanvas RIS/PACS open source project 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 General
// Public License for more details.
//
// You should have received a copy of the GNU General Public License along with
// the ClearCanvas RIS/PACS open source project. If not, see
// <http://www.gnu.org/licenses/>.

#endregion

namespace ClearCanvas.Common.Actions
{
/// <summary>
/// Performs an action using an implementation specific context.
/// </summary>
public interface IActionItem<T>
{
/// <summary>
/// Executes the action.
/// </summary>
/// <param name="context">An implementation specific context for the action.</param>
/// <returns>true on success, false on failure.</returns>
bool Execute(T context);

/// <summary>
/// A descriptive reason for a failure of the action. This property is populated when <see cref="IActionItem{T}.Execute"/> returns false.
/// </summary>
string FailureReason { get; }
}
}
41 changes: 41 additions & 0 deletions Common/Actions/IActionSet.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#region License

// Copyright (c) 2013, ClearCanvas Inc.
// All rights reserved.
// http://www.clearcanvas.ca
//
// This file is part of the ClearCanvas RIS/PACS open source project.
//
// The ClearCanvas RIS/PACS open source project is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// The ClearCanvas RIS/PACS open source project 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 General
// Public License for more details.
//
// You should have received a copy of the GNU General Public License along with
// the ClearCanvas RIS/PACS open source project. If not, see
// <http://www.gnu.org/licenses/>.

#endregion

using ClearCanvas.Common.Specifications;

namespace ClearCanvas.Common.Actions
{
/// <summary>
/// Interface representing a compiled set of actions returned by <see cref="XmlActionCompiler{TActionContext, TSchemaContext}"/>.
/// </summary>
public interface IActionSet<T>
{
/// <summary>
/// Execute a set of actions.
/// </summary>
/// <param name="context">An implementation specific context for the actions.</param>
/// <returns>A <see cref="TestResult"/> object describing the results.</returns>
TestResult Execute(T context);
}
}
54 changes: 54 additions & 0 deletions Common/Actions/IXmlActionCompilerOperator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#region License

// Copyright (c) 2013, ClearCanvas Inc.
// All rights reserved.
// http://www.clearcanvas.ca
//
// This file is part of the ClearCanvas RIS/PACS open source project.
//
// The ClearCanvas RIS/PACS open source project is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// The ClearCanvas RIS/PACS open source project 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 General
// Public License for more details.
//
// You should have received a copy of the GNU General Public License along with
// the ClearCanvas RIS/PACS open source project. If not, see
// <http://www.gnu.org/licenses/>.

#endregion

using System.Xml;
using System.Xml.Schema;

namespace ClearCanvas.Common.Actions
{
/// <summary>
/// Interface for extensions implementing <see cref="XmlActionCompilerOperatorExtensionPoint{TActionContext,TSchemaContext}"/>.
/// </summary>
public interface IXmlActionCompilerOperator<TActionContext, TSchemaContext>
{
/// <summary>
/// The name of the action implemented. This is typically the name of the <see cref="XmlElement"/> describing the action.
/// </summary>
string OperatorTag { get; }

/// <summary>
/// Method used to compile the action.
/// </summary>
/// <param name="xmlNode">Input <see cref="XmlElement"/> describing the action to perform.</param>
/// <returns>A class implementing the <see cref="IActionItem{T}"/> interface which can perform the action.</returns>
IActionItem<TActionContext> Compile(XmlElement xmlNode);

/// <summary>
/// Get an <see cref="XmlSchemaElement"/> describing the ActionItem for validation purposes.
/// </summary>
/// <param name="context">A context in which the schema is being generated.</param>
/// <returns></returns>
XmlSchemaElement GetSchema(TSchemaContext context);
}
}
Loading

0 comments on commit 64f32e9

Please sign in to comment.