// -----------------------------------------------------------------------// <copyright file="DepartureTimeEvaluatorEditor.cs" company="Studio A&T s.r.l.">// Copyright (c) Studio A&T s.r.l. All rights reserved.// </copyright>// <author>Nicogis</author>// -----------------------------------------------------------------------namespace Studioat.ArcGIS.DepartureTimeEvaluator
{
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using ESRI.ArcGIS.ADF.CATIDs;
using ESRI.ArcGIS.CatalogUI;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Geodatabase;
[ClassInterface(ClassInterfaceType.None)]
[Guid("7409A80D-13BB-46EB-8658-B1757CEB0CCA")]
publicclassDepartureTimeEvaluatorEditor : IEvaluatorEditor
{
#region Component Category Registration
[ComRegisterFunction()]
[ComVisible(false)]
staticvoid RegisterFunction(Type registerType)
{
string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);
NetworkEvaluatorEditor.Register(regKey);
}
[ComUnregisterFunction()]
[ComVisible(false)]
staticvoid UnregisterFunction(Type registerType)
{
string regKey = string.Format("HKEY_CLASSES_ROOT\\CLSID\\{{{0}}}", registerType.GUID);
NetworkEvaluatorEditor.Unregister(regKey);
}
#endregion #region IEvaluatorEditor Members
publicbool ContextSupportsEditDescriptors
{
// The descriptor text is the single line of text in the Evaluators dialog that appears under the Value column.// This property indicates whether the descriptor text can be directly edited in the dialog by the user.// Since this evaluator editor does not make use of descriptors, it returns falseget { returnfalse; }
}
publicvoid EditDescriptors(string value)
{
// This evaluator editor does not make use of descriptors.
}
publicbool ContextSupportsEditProperties
{
// This property indicates whether the ArcCatalog user is able to bring up a dialog by // clicking the Properties button (or pressing F12) in order to specify settings for the evaluator.get { returntrue; }
}
privateIEditEvaluators m_EditEvaluators;
publicIEditEvaluators EditEvaluators
{
// This property is used by ArcCatalog to set a reference to its EditEvaluators object // on each registered EvaluatorEditor. This allows each EvaluatorEditor to access the // current state of ArcCatalog's Evaluators dialog, such as how many evaluators are listed // and which evaluators are currently selected.get { return m_EditEvaluators; }
set { m_EditEvaluators = value; }
}
publicbool EditProperties(int parentWindow)
{
// Get an array of the currently selected evaluators to pass to the properties form.var evaluators = newList<INetworkEvaluator>();
for (int i = 0; i < m_EditEvaluators.Count; i++)
{
if (m_EditEvaluators.get_IsSelected(i))
evaluators.Add(m_EditEvaluators.get_EditEvaluator(i));
}
PropertiesDialog form = newPropertiesDialog(evaluators);
form.ShowDialog();
returnfalse;
}
publicUID EvaluatorCLSID
{
get
{
// This property returns the GUID of this EvaluatorEditor's associated INetworkEvaluator.UID uid = newUIDClass();
uid.Value = "{13C81137-7DE4-40B4-9A73-71271CEE44BE}";
return uid;
}
}
publicvoid SetDefaultProperties(int index)
{
// This method is called when the ArcCatalog user selects this evaluator // under the Type column of the Evaluators dialog. This method can be used to // initialize any dialogs that the evaluator editor uses.
}
publicint ValueChoice
{
// This evaluator editor does not support value choices.set { }
}
publicint ValueChoiceCount
{
// This evaluator editor has no value choices.get { return 0; }
}
publicstring get_Descriptor(int index)
{
// This evaluator editor does not make use of descriptors.returnstring.Empty;
}
publicstring get_FullDescription(int index)
{
// This property is the text representation of all of the settings made on this evaluator.// This evaluator editor does not make any settings changes, so it returns an empty string.returnstring.Empty;
}
publicstring get_ValueChoiceDescriptor(int choice)
{
// This evaluator editor does not make use of value choices.returnstring.Empty;
}
#endregion
}
}