本文整理汇总了C#中BoxModuleI类的典型用法代码示例。如果您正苦于以下问题:C# BoxModuleI类的具体用法?C# BoxModuleI怎么用?C# BoxModuleI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BoxModuleI类属于命名空间,在下文中一共展示了BoxModuleI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetModulesAskingForCreation
/// <summary>
/// Gets the box modules asking for creation.
/// </summary>
/// <param name="localePrefs">The localization preferences.</param>
/// <param name="boxModule">The box module.</param>
/// <returns>
/// Array of <see cref="T:Ferda.Modules.ModuleAskingForCreation">
/// Modules Asking For Creation</see>.
/// </returns>
public override ModulesAskingForCreation[] GetModulesAskingForCreation(string[] localePrefs, BoxModuleI boxModule)
{
Dictionary<string, ModulesAskingForCreation> modulesAFC = this.getModulesAskingForCreationNonDynamic(localePrefs);
List<ModulesAskingForCreation> result = new List<ModulesAskingForCreation>();
ModulesAskingForCreation moduleAFC;
ModulesConnection moduleConnection;
ModuleAskingForCreation singleModuleAFC;
//PropertySetting propertySetting;
//Ferda.ModulesManager.BoxModuleProjectInformationPrx projectInfoPrx = boxModule.Manager.getProjectInformation();
//string label = projectInfoPrx.getUserLabel(boxModule.StringIceIdentity);
foreach (string moduleAFCName in modulesAFC.Keys)
{
moduleAFC = modulesAFC[moduleAFCName];
moduleConnection = new ModulesConnection();
singleModuleAFC = new ModuleAskingForCreation();
switch (moduleAFCName)
{
case "BooleanPartialCedentSetting":
moduleConnection.socketName = "EquivalenceClass";
singleModuleAFC.newBoxModuleIdentifier =
Ferda.Modules.Boxes.DataMiningCommon.BooleanPartialCedentSetting.BooleanPartialCedentSettingBoxInfo.typeIdentifier;
break;
default:
throw Ferda.Modules.Exceptions.SwitchCaseNotImplementedError(moduleAFCName);
}
moduleConnection.boxModuleParam = boxModule.MyProxy;
singleModuleAFC.modulesConnection = new ModulesConnection[] { moduleConnection };
moduleAFC.newModules = new ModuleAskingForCreation[] { singleModuleAFC };
result.Add(moduleAFC);
}
return result.ToArray();
}
示例2: GetDefaultUserLabel
/// <summary>
/// Gets default value for box module user label.
/// </summary>
public override string GetDefaultUserLabel(BoxModuleI boxModule)
{
//get atom`s userLabel
string atomsUserLabel = "???";
BoxModulePrx atomBoxModulePrx;
if (Ferda.Modules.Boxes.SocketConnections.TryGetBoxModulePrx(boxModule, "AtomSetting", out atomBoxModulePrx))
{
string[] atomDefaultUserLabel = atomBoxModulePrx.getDefaultUserLabel();
if (atomDefaultUserLabel.Length > 0)
atomsUserLabel = atomDefaultUserLabel[0];
}
GaceTypeEnum gaceType = (GaceTypeEnum)Enum.Parse(typeof(GaceTypeEnum), boxModule.GetPropertyString("GaceType"));
string gaceTypeShort = "";
switch (gaceType)
{
case GaceTypeEnum.Positive:
break;
case GaceTypeEnum.Negative:
gaceTypeShort = Constants.Negation.ToString();
break;
case GaceTypeEnum.Both:
gaceTypeShort = Constants.LeftFunctionBracket + Constants.Negation.ToString() + Constants.RightFunctionBracket;
break;
default:
throw Ferda.Modules.Exceptions.SwitchCaseNotImplementedError(gaceType);
}
LiteralTypeEnum literalType = (LiteralTypeEnum)Enum.Parse(typeof(LiteralTypeEnum), boxModule.GetPropertyString("LiteralType"));
string shortLiteralType = this.GetPropertyOptionShortLocalizedLabel("LiteralType", literalType.ToString(), boxModule.LocalePrefs);
return gaceTypeShort + atomsUserLabel + shortLiteralType;
}
示例3: GetReadOnlyPropertyValue
/// <summary>
/// Gets value of readonly property value.
/// </summary>
/// <param name="propertyName">Name of readonly property.</param>
/// <param name="boxModule">Box module.</param>
/// <returns>
/// A <see cref="T:Ferda.Modules.PropertyValue"/> of
/// readonly property named <c>propertyName</c>.
/// </returns>
public override PropertyValue GetReadOnlyPropertyValue(String propertyName, BoxModuleI boxModule)
{
AbstractLMTaskFunctions Func = (AbstractLMTaskFunctions)boxModule.FunctionsIObj;
switch (propertyName)
{
case "GenerationState":
return new Ferda.Modules.StringTI(Func.getGeneratingInfo().generationState.ToString());
case "GenerationNrOfTests":
return new Ferda.Modules.LongTI(Func.getGeneratingInfo().generationNrOfTests);
case "GenerationNrOfHypotheses":
return new Ferda.Modules.LongTI(Func.getGeneratingInfo().generationNrOfHypotheses);
case "GenerationStartTime":
DateTimeT dateTime = Func.getGeneratingInfo().generationStartTime;
return new Ferda.Modules.DateTimeTI(dateTime.year, dateTime.month, dateTime.day, dateTime.hour, dateTime.minute, dateTime.second);
case "GenerationTotalTime":
TimeT time = Func.getGeneratingInfo().generationTotalTime;
return new Ferda.Modules.TimeTI(time.hour, time.minute, time.second);
/*
case "GenerationInfo":
return new Ferda.Modules.GenerationInfoTI(Func.GetGeneratingInfo());
case "Hypotheses":
return new Ferda.Modules.HypothesesTI(Func.GetResult());
*/
default:
throw Ferda.Modules.Exceptions.SwitchCaseNotImplementedError(propertyName);
}
}
示例4: GetHypotheses
/// <summary>
/// Gets the hypotheses.
/// </summary>
/// <param name="boxModule">The box module.</param>
/// <returns>Hypotheses.</returns>
public static HypothesisStruct[] GetHypotheses(BoxModuleI boxModule)
{
HypothesisStruct[] result = ((HypothesesTI)boxModule.GetPropertyOther("Hypotheses")).getHypothesesValue();
if (result == null)
return new HypothesisStruct[0];
else
return result;
}
示例5: GetGenerationInfo
/// <summary>
/// Gets the generation info.
/// </summary>
/// <param name="boxModule">The box module.</param>
/// <returns>Generation info.</returns>
public static GeneratingStruct GetGenerationInfo(BoxModuleI boxModule)
{
GeneratingStruct result = ((GenerationInfoTI)boxModule.GetPropertyOther("GenerationInfo")).getGenerationInfo();
if (result.generationStartTime == null)
result.generationStartTime = new DateTimeTI(0, 0, 0, 0, 0, 0);
if (result.generationTotalTime == null)
result.generationTotalTime = new TimeTI(0, 0, 0);
return result;
}
示例6: GetModulesAskingForCreation
//EachValueOneCategoryAttributeFunctionsI Func = (EachValueOneCategoryAttributeFunctionsI)boxModule.FunctionsIObj;
/// <summary>
/// Gets the box modules asking for creation.
/// </summary>
/// <param name="localePrefs">The localization preferences.</param>
/// <param name="boxModule">The box module.</param>
/// <returns>
/// Array of <see cref="T:Ferda.Modules.ModuleAskingForCreation">
/// Modules Asking For Creation</see>.
/// </returns>
public override ModulesAskingForCreation[] GetModulesAskingForCreation(string[] localePrefs, BoxModuleI boxModule)
{
Dictionary<string, ModulesAskingForCreation> modulesAFC = this.getModulesAskingForCreationNonDynamic(localePrefs);
List<ModulesAskingForCreation> result = new List<ModulesAskingForCreation>();
ModulesAskingForCreation moduleAFC;
ModulesConnection moduleConnection;
ModuleAskingForCreation singleModuleAFC;
//Ferda.ModulesManager.BoxModuleProjectInformationPrx projectInfoPrx = boxModule.Manager.getProjectInformation();
foreach (string moduleAFCName in modulesAFC.Keys)
{
moduleAFC = modulesAFC[moduleAFCName];
moduleConnection = new ModulesConnection();
singleModuleAFC = new ModuleAskingForCreation();
switch (moduleAFCName)
{
case "AtomSetting":
moduleConnection.socketName = "Attribute";
//moduleAFC.newBoxModuleUserLabel = new string[] { projectInfoPrx.getUserLabel(boxModule.StringIceIdentity) };
moduleConnection.boxModuleParam = boxModule.MyProxy;
singleModuleAFC.newBoxModuleIdentifier =
Ferda.Modules.Boxes.DataMiningCommon.AtomSetting.AtomSettingBoxInfo.typeIdentifier;
break;
case "EquivalenceClass":
moduleConnection.socketName = "LiteralSettingOrAttribute";
moduleConnection.boxModuleParam = boxModule.MyProxy;
singleModuleAFC.newBoxModuleIdentifier =
Ferda.Modules.Boxes.DataMiningCommon.EquivalenceClass.EquivalenceClassBoxInfo.typeIdentifier;
break;
case "CategorialPartialCedentSetting":
moduleConnection.socketName = "Attribute";
//moduleAFC.newBoxModuleUserLabel = new string[] { projectInfoPrx.getUserLabel(boxModule.StringIceIdentity) };
moduleConnection.boxModuleParam = boxModule.MyProxy;
singleModuleAFC.newBoxModuleIdentifier =
Ferda.Modules.Boxes.DataMiningCommon.CategorialPartialCedentSetting.CategorialPartialCedentSettingBoxInfo.typeIdentifier;
break;
case "Attribute":
moduleConnection.socketName = "ColumnOrDerivedColumn";
//moduleAFC.newBoxModuleUserLabel = new string[] { projectInfoPrx.getUserLabel(boxModule.StringIceIdentity) };
singleModuleAFC.newBoxModuleIdentifier =
Ferda.Modules.Boxes.DataMiningCommon.Attributes.Attribute.AttributeBoxInfo.typeIdentifier;
try
{
IAbstractDynamicAttribute func = this.getFuncIAbstractDynamicAttribute(boxModule);
moduleConnection.boxModuleParam = func.GetColumnBoxModulePrx();
singleModuleAFC.propertySetting = func.GetSettingForNewAttributeBox();
}
catch (Ferda.Modules.BoxRuntimeError) { continue; }
break;
default:
throw Ferda.Modules.Exceptions.SwitchCaseNotImplementedError(moduleAFCName);
}
singleModuleAFC.modulesConnection = new ModulesConnection[] { moduleConnection };
moduleAFC.newModules = new ModuleAskingForCreation[] { singleModuleAFC };
result.Add(moduleAFC);
}
return result.ToArray();
}
示例7: GetDefaultUserLabel
/// <summary>
/// Gets default value for box module user label.
/// </summary>
public override string GetDefaultUserLabel(BoxModuleI boxModule)
{
string boxLabel = boxModule.BoxInfo.GetLabel(boxModule.LocalePrefs);
return boxLabel
+ Constants.LeftEnum
+ boxModule.GetPropertyLong("MinLen").ToString()
+ Constants.RangeSeparator
+ boxModule.GetPropertyLong("MaxLen").ToString()
+ Constants.RightEnum;
}
示例8: GetCategorialPartialCedentSettingSeq
/// <summary>
/// Gets the categorial partial cedent setting sequence (array).
/// </summary>
/// <param name="boxModule">The box module.</param>
/// <param name="socketName">Name of the socket.</param>
/// <param name="oneAtMinimum">if set to <c>true</c> one patial cedent has to be set at minimum.</param>
/// <returns>All categorial partial cedent settings from specified <c>socketName</c>.</returns>
/// <exception cref="T:Ferda.Modules.NoConnectionInSocketError">Thrown iff there is no BoxModule connected in socketName and oneAtMinimum is true.</exception>
public static CategorialPartialCedentSettingStruct[] GetCategorialPartialCedentSettingSeq(BoxModuleI boxModule, string socketName, bool oneAtMinimum)
{
List<CategorialPartialCedentSettingStruct> result = new List<CategorialPartialCedentSettingStruct>();
Ice.ObjectPrx[] prxs = SocketConnections.GetObjectPrxs(boxModule, socketName, oneAtMinimum);
foreach (Ice.ObjectPrx prx in prxs)
{
result.Add((CategorialPartialCedentSettingFunctionsPrxHelper.checkedCast(prx)).getCategorialPartialCedentSetting());
}
return result.ToArray();
}
示例9: GetReadOnlyPropertyValue
/// <summary>
/// Gets value of readonly property value.
/// </summary>
/// <param name="propertyName">Name of readonly property.</param>
/// <param name="boxModule">Box module.</param>
/// <returns>
/// A <see cref="T:Ferda.Modules.PropertyValue"/> of
/// readonly property named <c>propertyName</c>.
/// </returns>
public override PropertyValue GetReadOnlyPropertyValue(String propertyName, BoxModuleI boxModule)
{
EquifrequencyIntervalsAttributeFunctionsI Func = (EquifrequencyIntervalsAttributeFunctionsI)boxModule.FunctionsIObj;
switch (propertyName)
{
//case "Categories":
// return new Ferda.Modules.CategoriesTI(Func.GetGeneratedAttribute().CategoriesStruct);
case "IncludeNullCategory":
return new Ferda.Modules.StringTI(Func.GetGeneratedAttribute().IncludeNullCategoryName);
default:
throw Ferda.Modules.Exceptions.SwitchCaseNotImplementedError(propertyName);
}
}
开发者ID:BackupTheBerlios,项目名称:ferdadataminer-svn,代码行数:22,代码来源:EquifrequencyIntervalsAttributeBoxInfo.cs
示例10: GetDefaultUserLabel
/// <summary>
/// Gets default value for box module user label.
/// </summary>
public override string GetDefaultUserLabel(BoxModuleI boxModule)
{
string nameInLiterals = boxModule.GetPropertyString("NameInLiterals");
if (!String.IsNullOrEmpty(nameInLiterals))
return nameInLiterals;
Ice.ObjectPrx objectPrx;
if (Ferda.Modules.Boxes.SocketConnections.TryGetObjectPrx(boxModule, "ColumnOrDerivedColumn", out objectPrx))
{
ColumnFunctionsPrx columnFunctionsPrx =
ColumnFunctionsPrxHelper.checkedCast(objectPrx);
return columnFunctionsPrx.getColumnInfo().columnSelectExpression;
}
return null;
}
示例11: GetBoxModulePrx
/// <summary>
/// Iff there is exactly one <see cref="T:Ferda.Modules.BoxModule"/>
/// connected in socket named <c>socketName</c> than this object is
/// returned. Iff there is no BoxModule connected in the socket than
/// <see cref="T:Ferda.Modules.NoConnectionInSocketError"/> is thrown.
/// Otherwise (i.e. there is more than one BoxModule in the socket)
/// <see cref="T:System.Exception"/> is thrown.
/// </summary>
/// <example>
/// <para>
/// This example shows some usage of this function. We are in MyBoxModule instance.
/// There is defined <see cref="T:Ferda.Modules.ModuleAskingForCreation"/> named "MAFC1",
/// which gets proxy of BoxModule (Mark it "InputModule") connected into its socket named
/// "MyBoxBoduleInputSocket" and make a connection from "InputModule" to socket named
/// "Socket1" in newly created BoxModule.
/// </para>
/// <code>
/// namespace MyBoxModule
/// {
/// class MyBoxModuleBoxInfo : Ferda.Modules.Boxes.BoxInfo
/// {
/// public override ModulesAskingForCreation[] GetModulesAskingForCreation(string[] localePrefs, BoxModuleI boxModule)
/// {
/// Dictionary<string, ModuleAskingForCreation> modulesAFC = this.getModulesAskingForCreationNonDynamic(localePrefs);
/// List<ModuleAskingForCreation> result = new List<ModuleAskingForCreation>();
/// ModulesAskingForCreation moduleAFC;
/// ModulesConnection moduleConnection;
/// foreach (string moduleAFCName in modulesAFC.Keys)
/// {
/// moduleAFC = modulesAFC[moduleAFCName];
/// switch (moduleAFCName)
/// {
/// /* ... */
/// case "MAFC1":
/// moduleConnection = new ModulesConnection();
/// moduleConnection.socketName = "Socket1";
/// moduleConnection.boxModuleParam = GetBoxModulePrx(boxModule, "MyBoxBoduleInputSocket");
/// /* ... */
/// break;
/// }
/// moduleAFC.modulesConnection = new ModulesConnection[] { moduleConnection };
/// result.Add(moduleAFC);
/// }
/// return result.ToArray();
/// }
/// }
/// }
/// </code>
/// </example>
/// <param name="boxModule">Box Module (having socket named <c>socketName</c>).</param>
/// <param name="socketName">Name of socket.</param>
/// <returns><see cref="T:Ferda.Modules.BoxModulePrx"/> i.e. proxy of BoxModule connected in <c>socketName</c>.</returns>
/// <exception cref="T:System.Exception">Thrown iff there
/// is connected more than one BoxModule in <c>socketName</c>.
/// </exception>
/// <exception cref="T:Ferda.Modules.NoConnectionInSocketError">
/// Thrown iff there is no BoxModule connected in <c>socketName</c>.
/// </exception>
public static BoxModulePrx GetBoxModulePrx(BoxModuleI boxModule, string socketName)
{
BoxModulePrx[] connections = boxModule.GetConnections(socketName);
if (connections.Length == 0)
{
throw Ferda.Modules.Exceptions.NoConnectionInSocketError(null, boxModule.StringIceIdentity, "BoxInf15: There is no connection in the socket! (" + socketName + ")", new string[] { socketName });
}
else if (connections.Length == 1)
{
foreach (BoxModulePrx prx in connections)
{
return prx;
}
}
string message = "BoxInf16: There should be connected one box at maximum! in socket: \"" + socketName + "\".";
System.Diagnostics.Debug.WriteLine(message);
throw new Exception(message);
}
示例12: GetModulesAskingForCreation
/// <summary>
/// Gets the box modules asking for creation.
/// </summary>
/// <param name="localePrefs">The localization preferences.</param>
/// <param name="boxModule">The box module.</param>
/// <returns>
/// Array of <see cref="T:Ferda.Modules.ModuleAskingForCreation">
/// Modules Asking For Creation</see>.
/// </returns>
public override ModulesAskingForCreation[] GetModulesAskingForCreation(string[] localePrefs, BoxModuleI boxModule)
{
Dictionary<string, ModulesAskingForCreation> modulesAFC = this.getModulesAskingForCreationNonDynamic(localePrefs);
List<ModulesAskingForCreation> result = new List<ModulesAskingForCreation>();
ModulesAskingForCreation moduleAFC;
ModulesConnection moduleConnection;
ModuleAskingForCreation singleModuleAFC;
foreach (string moduleAFCName in modulesAFC.Keys)
{
moduleAFC = modulesAFC[moduleAFCName];
moduleConnection = new ModulesConnection();
singleModuleAFC = new ModuleAskingForCreation();
switch (moduleAFCName)
{
case "AtomSetting":
moduleConnection.socketName = "Attribute";
moduleConnection.boxModuleParam = boxModule.MyProxy;
singleModuleAFC.newBoxModuleIdentifier =
Ferda.Modules.Boxes.DataMiningCommon.AtomSetting.AtomSettingBoxInfo.typeIdentifier;
break;
case "EquivalenceClass":
moduleConnection.socketName = "LiteralSettingOrAttribute";
moduleConnection.boxModuleParam = boxModule.MyProxy;
singleModuleAFC.newBoxModuleIdentifier =
Ferda.Modules.Boxes.DataMiningCommon.EquivalenceClass.EquivalenceClassBoxInfo.typeIdentifier;
break;
case "CategorialPartialCedentSetting":
moduleConnection.socketName = "Attribute";
moduleConnection.boxModuleParam = boxModule.MyProxy;
singleModuleAFC.newBoxModuleIdentifier =
Ferda.Modules.Boxes.DataMiningCommon.CategorialPartialCedentSetting.CategorialPartialCedentSettingBoxInfo.typeIdentifier;
break;
default:
throw Ferda.Modules.Exceptions.SwitchCaseNotImplementedError(moduleAFCName);
}
singleModuleAFC.modulesConnection = new ModulesConnection[] { moduleConnection };
moduleAFC.newModules = new ModuleAskingForCreation[] { singleModuleAFC };
result.Add(moduleAFC);
}
return result.ToArray();
}
示例13: GetDefaultUserLabel
/// <summary>
/// Gets default value for box module user label.
/// </summary>
public override string GetDefaultUserLabel(BoxModuleI boxModule)
{
CoefficientTypeEnum coefficientType = (CoefficientTypeEnum)Enum.Parse(typeof(CoefficientTypeEnum), boxModule.GetPropertyString("CoefficientType"));
string shortCoefficientType = this.GetPropertyOptionShortLocalizedLabel("CoefficientType", coefficientType.ToString(), boxModule.LocalePrefs);
//get attribute`s userLabel
string attributesUserLabel = "???";
BoxModulePrx attributeBoxModulePrx;
if (Ferda.Modules.Boxes.SocketConnections.TryGetBoxModulePrx(boxModule, "Attribute", out attributeBoxModulePrx))
{
string[] attributeDefaultUserLabel = attributeBoxModulePrx.getDefaultUserLabel();
if (attributeDefaultUserLabel.Length > 0)
attributesUserLabel = attributeDefaultUserLabel[0];
}
string result;
switch (coefficientType)
{
case CoefficientTypeEnum.OneParticularCategory:
result = (attributesUserLabel != "???") ? attributesUserLabel : shortCoefficientType;
result += Constants.LeftFunctionBracket
+ boxModule.GetPropertyString("Category")
+ Constants.RightFunctionBracket;
break;
default:
result =
attributesUserLabel
+ Constants.LeftFunctionBracket
+ shortCoefficientType
+ Constants.LeftEnum
+ boxModule.GetPropertyLong("MinLen").ToString()
+ Constants.RangeSeparator
+ boxModule.GetPropertyLong("MaxLen").ToString()
+ Constants.RightEnum
+ Constants.RightFunctionBracket;
break;
}
return result;
}
示例14: GetDefaultUserLabel
/// <summary>
/// Gets default value for box module user label.
/// </summary>
public override string GetDefaultUserLabel(BoxModuleI boxModule)
{
string odbcConnectionString = boxModule.GetPropertyString(OdbcConnectionStringPropertyName);
if (!String.IsNullOrEmpty(odbcConnectionString))
{
string[] itemsOfConnectionString = odbcConnectionString.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
if (itemsOfConnectionString != null)
foreach (string item in itemsOfConnectionString)
{
if (!String.IsNullOrEmpty(item))
{
item.Trim();
if (item.StartsWith("DSN=", StringComparison.OrdinalIgnoreCase))
return item.Substring(4);
}
}
if (odbcConnectionString.Length <= 20)
return odbcConnectionString;
else
return odbcConnectionString.Substring(0, 17) + "...";
}
return null;
}
示例15: GetReadOnlyPropertyValue
/// <summary>
/// Gets value of readonly property value.
/// </summary>
/// <param name="propertyName">Name of readonly property.</param>
/// <param name="boxModule">Box module.</param>
/// <returns>
/// A <see cref="T:Ferda.Modules.PropertyValue"/> of
/// readonly property named <c>propertyName</c>.
/// </returns>
public override PropertyValue GetReadOnlyPropertyValue(String propertyName, BoxModuleI boxModule)
{
switch (propertyName)
{
case RecordCountPropertyName:
DataMatrixFunctionsI Func = (DataMatrixFunctionsI)boxModule.FunctionsIObj;
long recordsCount = 0;
try
{
recordsCount = Func.RecordsCount;
}
catch (Ferda.Modules.BoxRuntimeError) { }
return new Ferda.Modules.LongTI(recordsCount);
default:
throw Ferda.Modules.Exceptions.SwitchCaseNotImplementedError(propertyName);
}
}