コード例 #1
0
 /// <summary>
 /// Ice run method
 /// </summary>
 /// <param name="valueBefore">Previous parameter value</param>
 /// <param name="boxModuleParam"></param>
 /// <param name="localePrefs"></param>
 /// <param name="manager"></param>
 /// <param name="about"></param>
 /// <param name="__current"></param>
 /// <returns>New property value</returns>
 public override PropertyValue run(PropertyValue valueBefore, BoxModulePrx boxModuleParam, string[] localePrefs, ManagersEnginePrx manager, out string about, Ice.Current __current)
 {
     PropertyValue propertyValue = valueBefore;
     string locale;
     try
     {
         locale = localePrefs[0];
         localizationString = locale;
         locale = "Ferda.FrontEnd.AddIns.EditCategories.Localization_" + locale;
         resManager = new ResourceManager(locale, Assembly.GetExecutingAssembly());
     }
     catch
     {
     }
     about = resManager.GetString("EditCategoriesAbout");
     try
     {
         Ferda.Modules.Boxes.DataMiningCommon.Attributes.AbstractAttributeFunctionsPrx prx =
        Ferda.Modules.Boxes.DataMiningCommon.Attributes.AbstractAttributeFunctionsPrxHelper.checkedCast(boxModuleParam.getFunctions());
         String[] distinctValues;
         PropertyValue returnValue = new PropertyValue();
         CategoriesT categories = (CategoriesT)valueBefore;
         try
         {
             BoxModulePrx boxModuleParamNew = boxModuleParam.getConnections("ColumnOrDerivedColumn")[0];
             Ferda.Modules.Boxes.DataMiningCommon.Column.ColumnFunctionsPrx prx1 =
                 Ferda.Modules.Boxes.DataMiningCommon.Column.ColumnFunctionsPrxHelper.checkedCast(boxModuleParamNew.getFunctions());
             distinctValues = prx1.getDistinctValues();
         }
         catch
         {
             distinctValues = null;
         }
         Ferda.FrontEnd.AddIns.EditCategories.MainListView listView = new Ferda.FrontEnd.AddIns.EditCategories.MainListView(localePrefs, categories.categoriesValue, distinctValues, ownerOfAddIn);
         listView.ShowInTaskbar = false;
         listView.Disposed += new EventHandler(SetCategories);
         System.Windows.Forms.DialogResult result = this.ownerOfAddIn.ShowDialog(listView);
         if (result == System.Windows.Forms.DialogResult.OK)
         {
             PropertyValue resultValue = new CategoriesTI(this.categories);
             about = this.getPropertyAbout(resultValue);
             propertyValue = resultValue;
         }
         else
         {
             about = this.getPropertyAbout(valueBefore);
         }
     }
     catch (Ferda.Modules.BadParamsError ex)
     {
         if (ex.restrictionType == Ferda.Modules.restrictionTypeEnum.DbConnectionString)
         {
             MessageBox.Show(resManager.GetString("BadConnectionString"), resManager.GetString("Error"),
                        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else if (ex.restrictionType == Ferda.Modules.restrictionTypeEnum.DbTable)
         {
             MessageBox.Show(resManager.GetString("NoDataMatrix"), resManager.GetString("Error"),
                        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else if (ex.restrictionType == Ferda.Modules.restrictionTypeEnum.DbColumn)
         {
             MessageBox.Show(resManager.GetString("BadColumnSelectExpression"), resManager.GetString("Error"),
                        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
         else
         {
             MessageBox.Show(resManager.GetString("InvalidParameters"), resManager.GetString("Error"),
                        MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         }
     }
     catch (Ferda.Modules.NoConnectionInSocketError)
     {
         MessageBox.Show(resManager.GetString("BoxNotConnected"), resManager.GetString("Error"),
                    MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     return propertyValue;
 }
コード例 #2
0
 public override PropertyValue GetPropertyValue()
 {
     CategoriesTI result = new CategoriesTI();
     result.categoriesValue = Ferda.Modules.CategoriesTI.Categories.Struct2Dict(Value);
     return result;
 }