// 建立測試File public void CreateTestFile() { var fileModel = new FileParam { Creator = "Test", FileName = "TestFile", Row = 5, Column = 5, Editor = new List <UserParam>() }; List <CellParam> textList = new List <CellParam>(); for (int i = 0; i < 5; i++) { for (int j = 0; j < 5; j++) { var cellModel = new CellParam(); cellModel.LockState = true; cellModel.Text = ""; cellModel.CellName = $"{i}{j}"; textList.Add(cellModel); } } fileModel.TextList = textList; list.Add(fileModel); }
private void File_Click(object sender, RoutedEventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog() { Filter = "所有文件|*.zip;*.rar;*.xls;*.txt;*.psd;*.csv;*.doc" }; if ((bool)openFileDialog.ShowDialog()) { using (FileStream file = File.OpenRead(openFileDialog.FileName)) { System.Drawing.Bitmap map = new FileUtil().GetIconName(CommonUtil.GetFileExtra(openFileDialog.SafeFileName)); FileParam fileParam = new FileParam() { FileIcon = map, UserImg = "https://video.yestar.com/chat_desktop_customer_avatr_img.png", FileName = openFileDialog.SafeFileName, FileSize = FormattableString.Invariant($"{file.Length / 1024}") + " KB", Default = new FileParam().FileDefault, instance = new DockPanel() }; ChatingContent.Children.Add(fileParam.instance); } } }
/// <summary> /// The Parameter array should be populated with default values here /// </summary> public override void Initialize() { _inputParam = new Parameter[4]; _inputParam[0] = new FileParam(TextStrings.lasFilename, "LAS Files(*.las)|*.las") { HelpText = TextStrings.LasFullpath }; ExtentParam p = new ExtentParam(TextStrings.RasterExtent); p.HelpText = TextStrings.GeographicExtent; p.DefaultToMapExtent = true; _inputParam[1] = p; _inputParam[2] = new IntParam(TextStrings.NumRows) { HelpText = TextStrings.numberofrows }; _inputParam[3] = new IntParam(TextStrings.NumColumns) { HelpText = TextStrings.numberofcolums }; _outputParam = new Parameter[1]; _outputParam[0] = new RasterParam(TextStrings.OutputRaster) { HelpText = TextStrings.ResultRasterDirectory }; }
private FileParam _GetPackType(string fileName) { FileParam type = null; packTypeDatas.TryGetValue(fileName, out type); return(type); }
private void btnAddData_Click(object sender, EventArgs e) { using (OpenFileDialog dialog = new OpenFileDialog()) { dialog.Title = ModelingMessageStrings.OpenFileElement_btnAddDataClick_SelectFileName; if (Param == null) { Param = new FileParam("open filename"); } FileParam p = Param as FileParam; if (p != null) { dialog.Filter = p.DialogFilter; } if (dialog.ShowDialog() == DialogResult.OK) { TextFile tmpTextFile = new TextFile(dialog.FileName); _addedTextFile = new DataSetArray(Path.GetFileNameWithoutExtension(dialog.FileName), tmpTextFile); Param.ModelName = _addedTextFile.Name; Param.Value = _addedTextFile.DataSet; Refresh(); base.Status = ToolStatus.Ok; } } }
private void BtnAddDataClick(object sender, EventArgs e) { FileParam p = Param as FileParam; using (SaveFileDialog sfd = new SaveFileDialog()) { sfd.OverwritePrompt = true; sfd.Filter = p != null ? p.DialogFilter : @"CSV Files|*.csv"; if (sfd.ShowDialog() != DialogResult.OK) { return; } TextFile addedTextFile = new TextFile(sfd.FileName); // This inserts the new featureset into the list txtDataTable.Text = Path.GetFileNameWithoutExtension(addedTextFile.Filename); Param.Value = addedTextFile; } Status = ToolStatus.Ok; LightTipText = ModelingMessageStrings.FeaturesetValid; }
public static async Task <bool> shareFile(int id) { HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, string.Format("{0}/{1}", BASE_FILE_URL, "share")); request.Headers.Add("Authorization", "Token token=" + App.TOKEN); var data = new FileParam { file = new ShareFileParam { id = id } }; string jsonData = JsonConvert.SerializeObject(data); request.Content = new StringContent(jsonData, Encoding.UTF8, "application/json"); HttpResponseMessage response = await client.SendAsync(request); if (response.IsSuccessStatusCode) { string content = await response.Content.ReadAsStringAsync(); var feedback = JsonConvert.DeserializeObject <SuccessFeedBack>(content); if (200 == feedback.success) { return(true); } } return(false); }
/// <summary> /// The Parameter array should be populated with default values here /// </summary> public override void Initialize() { _inputParam = new Parameter[4]; _inputParam[0] = new FileParam(TextStrings.lasFilename, "LAS Files(*.las)|*.las") { HelpText = TextStrings.LasFullpath }; _inputParam[1] = new ExtentParam(TextStrings.RasterExtent) { HelpText = TextStrings.GeographicExtent, DefaultToMapExtent = true }; _inputParam[2] = new IntParam(TextStrings.NumRows) { HelpText = TextStrings.numberofrows }; _inputParam[3] = new IntParam(TextStrings.NumColumns) { HelpText = TextStrings.numberofcolums }; _outputParam = new Parameter[2]; _outputParam[0] = new RasterParam(TextStrings.OutputRaster) { HelpText = TextStrings.ResultRasterDirectory }; _outputParam[1] = new BooleanParam(TextStrings.OutputParameter_AddToMap, TextStrings.OutputParameter_AddToMap_CheckboxText, true); }
public void TestFileParam() { FileParam sparam = new FileParam("myname", "myvalue"); FileParam sparam2 = (FileParam)sparam.ToXmlAndBack(); Assert.AreEqual(sparam.Value, sparam2.Value); Assert.AreEqual(sparam.Name, sparam2.Name); }
public void Initialize() { _inputParameters = new Parameter[2]; _inputParameters[0] = new FileParam("Select the Hydrodesktop SQLITE database"); _inputParameters[1] = new FileParam("Select Final Forecasting Results"); _outputParameters = new Parameter[1]; _outputParameters[0] = new FileParam("Final Forecasting Result"); }
public void Initialize() { _inputParameters = new Parameter[1]; _inputParameters[0] = new FileParam("Choose the source data for Normalization"); _outputParameters = new Parameter[1]; _outputParameters[0] = new FileParam("Normalized Data"); }
private string SaveDWGNewVersion(FormCollection saveForm, BsonDocument oldfileDoc, DataOperation dataOp) { string localPath = PageReq.GetForm("uploadFileList"); string name = PageReq.GetForm("name"); string subMapParam = PageReq.GetForm("subMapParam"); string newGuid2d = PageReq.GetForm("guid2d"); BsonDocument fileDoc = new BsonDocument(); fileDoc.Add("version", (oldfileDoc.Int("version") + 1).ToString()); fileDoc.Add("localPath", localPath); fileDoc.Add("ext", Path.GetExtension(localPath)); fileDoc.Add("name", string.IsNullOrEmpty(name) == true ? Path.GetFileName(localPath) : name); fileDoc.Add("subMapParam", subMapParam); fileDoc.Add("guid2d", newGuid2d); var query = Query.EQ("fileId", oldfileDoc.String("fileId")); dataOp.Update("FileLibrary", query, fileDoc); BsonDocument fileVerDoc = new BsonDocument(); fileVerDoc.Add("name", fileDoc.String("name")); fileVerDoc.Add("ext", fileDoc.String("ext")); fileVerDoc.Add("localPath", localPath); fileVerDoc.Add("version", fileDoc.String("version")); fileVerDoc.Add("subMapParam", subMapParam); fileVerDoc.Add("guid2d", newGuid2d); fileVerDoc.Add("fileId", oldfileDoc.String("fileId")); InvokeResult result = dataOp.Insert("FileLibVersion", fileVerDoc); fileVerDoc = result.BsonInfo; int fileRelId = 0; if (result.Status == Status.Successful) { var relResult = dataOp.Update("FileRelation", "db.FileRelation.distinct('_id',{'fileId':'" + fileDoc.String("fileId") + "'})", "version=" + fileDoc.String("version")); fileRelId = result.BsonInfo.Int("fileRelId"); } List <FileParam> paramList = new List <FileParam>(); FileParam fp = new FileParam(); fp.path = localPath; fp.ext = fileDoc.String("ext"); fp.strParam = string.Format("{0}@{1}-{2}-{3}", "sysObject", fileRelId, oldfileDoc.String("fileId"), fileVerDoc.String("fileVerId")); paramList.Add(fp); JavaScriptSerializer script = new JavaScriptSerializer(); string strJson = script.Serialize(paramList); PageJson json = new PageJson(); json.Success = result.Status == Status.Successful ? true : false; string keyValue = saveForm["keyValue"] != null ? saveForm["keyValue"] : "0"; var strResult = json.ToString() + "|" + strJson + "|" + keyValue; return(strResult); }
public void Initialize() { _inputParameters = new Parameter[1]; _inputParameters[0] = new FileParam("Select the Data table"); _outputParameters = new Parameter[1]; _outputParameters[0] = new FileParam("Save Lag Values"); }
public void Initialize() { _inputParameters = new Parameter[1]; _inputParameters[0] = new FileParam("Select the Normalized source file - Streamflow"); _outputParameters = new Parameter[1]; _outputParameters[0] = new FileParam("Neural Network Input Normalized Data"); }
/// <summary> /// загрузить из таблички Excel в DTO с записью в лог /// </summary> protected List <T> LoadFromExcel <T>(FileParam excelFileParam, string logScopeName, int cellCount, Func <ExcelRangeBase[], T> createElem) { logger.LogTrace(logScopeName); using (logger.BeginScope(logScopeName)) { if ((excelFileParam == null) || (string.IsNullOrWhiteSpace(excelFileParam.fileName))) { throw new ArgumentException("No filename given"); } logger.LogTrace(string.Format("opening '{0}'", excelFileParam.fileName)); FileInfo excelFile = new FileInfo(excelFileParam.fileName); if (!excelFile.Exists) { throw new ArgumentException("File not found"); } using (ExcelPackage package = new ExcelPackage(excelFile)) { ExcelWorksheet worksheet = package.Workbook.Worksheets[1]; int rowCount = worksheet.Dimension.Rows; if (rowCount < 2) { throw new ApplicationException("Too little rows. Need at least two: header + data"); } List <T> result = new List <T>(); //skipping first line - that is header //numeration base is 1, not 0 for (int i = 2; i <= rowCount; i++) { ExcelRange row = worksheet.Cells[string.Format("{0}:{0}", i)]; // see if all cells of this row are empty bool allEmpty = row.All(c => string.IsNullOrWhiteSpace(c.Text)); if (allEmpty) { continue; // skip this row } //check that we have correct number of non-empty first cells bool hasEnoughNotEmpty = (row.Take(cellCount).Count(cell => !string.IsNullOrWhiteSpace(cell.Text)) == cellCount); if (!hasEnoughNotEmpty) { throw new ArgumentException( string.Format("file '{0}' row {1}, need at least {2} non-empty starting columns", excelFileParam.fileName, i, cellCount)); } T newElem = createElem(row.Take(cellCount).ToArray()); result.Add(newElem); logger.LogTrace(string.Format("row {0}. Created element: {1}", i, newElem.ToString())); } logger.LogDebug(string.Format("{0} elements found", result.Count)); return(result); } } }
void ITool.Initialize() { _inputParameters = new Parameter[3]; _inputParameters[0] = new FileParam("Select the lag table"); _inputParameters[1] = new StringParam("Enter the neighbour values"); _inputParameters[2] = new DateTimeParam("Upto which date you need to forecast"); _outputParameters = new Parameter[1]; _outputParameters[0] = new FileParam("Forecasting Values"); }
public void Initialize() { _inputParameters = new Parameter[2]; _inputParameters[0] = new FileParam("Select the Streamflow source table"); _inputParameters[1] = new FileParam("Select the Forecasting Results table"); _outputParameters = new Parameter[1]; _outputParameters[0] = new FileParam("Denormalized Data"); }
void ITool.Initialize() { _inputParameters = new Parameter[2]; _inputParameters[0] = new FileParam("Select the lag table"); _inputParameters[1] = new DateTimeParam("Please select the forecaasting final date"); _outputParameters = new Parameter[1]; _outputParameters[0] = new FileParam("Forecasting Values"); }
private void AddFiles() { if (ofdSelectFiles.ShowDialog() == DialogResult.OK) { SetState(true, ofdSelectFiles.FileNames.Length); bgWorker.DoWork += new DoWorkEventHandler(bgWorker_DoWork); FileParam param = new FileParam(); param.Files = ofdSelectFiles.FileNames; param.Folder = cbFolders.Text; bgWorker.RunWorkerAsync(param); } }
public void Initialize() { _inputParameters = new Parameter[5]; _inputParameters[0] = new FileParam("Select the Hydrodesktop database"); _inputParameters[1] = new ListParam("Select the Site"); _inputParameters[2] = new ListParam("Select the Variable"); _inputParameters[3] = new DateTimeParam("Start Date"); _inputParameters[4] = new DateTimeParam("End Date"); _outputParameters = new Parameter[1]; _outputParameters[0] = new FileParam("Save Data"); }
/// <summary> /// FileParam for specifying the exectable. See <see cref="GetExectuable"/>. /// </summary> protected virtual FileParam ExecutableParam() { var executableParam = new FileParam(InterpreterLabel) { Filter = InterpreterFilter }; if (TryFindExecutable(out var executable)) { executableParam.Value = executable; } return(executableParam); }
void ITool.Initialize() { _inputParameters = new Parameter[3]; _inputParameters[0] = new FileParam("Select the Neurons and their weights for the network"); _inputParameters[1] = new FileParam("Select the input data file"); _inputParameters[2] = new DateTimeParam("Please select the forecasting final date"); _outputParameters = new Parameter[1]; _outputParameters[0] = new FileParam("Forecasting Values"); }
public void Initialize() { _inputParameters = new Parameter[3]; _inputParameters[0] = new FileParam("Select the Normalized source file - Temperature"); _inputParameters[1] = new FileParam("Select the Normalized source file - Precipiation"); _inputParameters[2] = new FileParam("Select the Normalized source file - Streamflow"); _outputParameters = new Parameter[1]; _outputParameters[0] = new FileParam("Save Neural Network Input Normalized Data"); }
/// <summary> /// Creates an instance of the dialog /// </summary> /// <param name="inputParam">The parameter this element represents</param> /// <param name="dataSets">An array of available data</param> public OpenFileElement(FileParam inputParam, List <DataSetArray> dataSets) { //Needed by the designer InitializeComponent(); //We save the parameters passed in Param = inputParam; _dataSets = dataSets; //Saves the label GroupBox.Text = Param.Name; DoRefresh(); }
/// <summary> /// Initializes a new instance of the <see cref="OpenFileElement"/> class. /// </summary> /// <param name="param">The parameter this element represents.</param> /// <param name="text">Not used.</param> public OpenFileElement(FileParam param, string text) { InitializeComponent(); Param = param; GroupBox.Text = param.Name; DoRefresh(); // Populates the dialog with the default parameter value if (param.Value != null && param.DefaultSpecified) { Status = ToolStatus.Ok; LightTipText = ModelingMessageStrings.FeaturesetValid; } }
public static void createfile(Document currentDoc, int Category) { Application App = currentDoc.Application; App.SharedParametersFilename = DBIdentifiers.SharedParams; DefinitionFile deffile = App.OpenSharedParameterFile(); ProjectInfo info = currentDoc.ProjectInformation; Param[] p; Parameter FileParam; string filename = GetFileName(); switch (Category) { default: case ParamCategory.Materials: p = ParameterGroup.MaterialTrackedParams; FileParam = info.get_Parameter(ParameterLibrary.MaterialFile.ID); break; case ParamCategory.Equipment: p = ParameterGroup.EquipmentTrackedParams; FileParam = info.get_Parameter(ParameterLibrary.EquipFile.ID); break; case ParamCategory.Users: FileParam = info.get_Parameter(ParameterLibrary.StaffFile.ID); break; case ParamCategory.Doors: FileParam = info.get_Parameter(ParameterLibrary.DoorFile.ID); break; } if (!File.Exists(filename)) { CC_CoreData.DatabaseIO.CreateFile(filename, Category); } FileParam.Set(filename); }
public IActionResult GetFileUrlItem(FileParam param) { string url = ""; ResponseModel result = new ResponseModel(ResponseCode.Error, "获取文件url失败"); try { //获取文件地址信息 var jsonresult = ZlsoftFtpHelper.GetFileUrl(param.fileid, param.imgfiletype); if (jsonresult.code == ResponseCode.Success) { if (jsonresult.data != null && jsonresult.data.Any()) { url = jsonresult.data.FirstOrDefault().filepath; } } } catch (Exception ex) { Logger.Instance.Error("获取单个连接信息发生异常", ex); } return(Json(url)); }
/// <summary> /// Initializes a new instance of the <see cref="SaveFileElement"/> class. /// </summary> /// <param name="outputParam">The parameter this element represents.</param> /// <param name="dataSets">An array of available data.</param> public SaveFileElement(FileParam outputParam, List <DataSetArray> dataSets) { // Needed by the designer InitializeComponent(); // We save the parameters passed in Param = outputParam; // Saves the label GroupBox.Text = Param.Name; // Sets up the initial status light indicator Status = ToolStatus.Empty; LightTipText = ModelingMessageStrings.FeaturesetMissing; // Populates the dialog with the default parameter value if (outputParam.Value != null && outputParam.DefaultSpecified) { txtDataTable.Text = outputParam.ModelName; Status = ToolStatus.Ok; LightTipText = ModelingMessageStrings.FeaturesetValid; } }
public IActionResult GetFileUrl(FileParam param) { ResponseModel result = new ResponseModel(ResponseCode.Error, "获取文件url失败"); try { //获取文件地址信息 var jsonresult = ZlsoftFtpHelper.GetFileUrl(param.fileid, param.imgfiletype); if (jsonresult.code == ResponseCode.Success) { result.code = jsonresult.code.ToInt32(); result.data = jsonresult.data; result.msg = jsonresult.msg; } } catch (Exception ex) { result.msg = ex.Message; Logger.Instance.Error("获取多个连接信息发生异常", ex); } return(Json(result)); }
private void btnAddData_Click(object sender, EventArgs e) { OpenFileDialog dialog = new OpenFileDialog(); dialog.Title = "Select File Name"; if (Param == null) Param = new FileParam("open filename"); FileParam p = Param as FileParam; if (p != null) dialog.Filter = p.DialogFilter; if (dialog.ShowDialog() == DialogResult.OK) { TextFile tmpTextFile = new TextFile(dialog.FileName); _addedTextFile = new DataSetArray(Path.GetFileNameWithoutExtension(dialog.FileName), tmpTextFile); Param.ModelName = _addedTextFile.Name; Param.Value = _addedTextFile.DataSet; Refresh(); base.Status = ToolStatus.Ok; } else { return; } }
/// <summary> /// вывести результат в консоль и в файл excel, /// если это указано в опциях /// </summary> /// <param name="result"></param> private static void OutputResult(ISimulationResult result) { Console.WriteLine(); //выведем на консоль результаты foreach (string str in result.ToText()) { Console.WriteLine(str); logger.LogInformation(str); } //проверим, указан ли файл для вывода в Excel logger.LogInformation("Creating Excel output file"); FileParam excelFile = configRoot.GetSection("output").Get <FileParam>(); if (FileParam.IsEmpty(excelFile)) { string msg = "Excel output file not specified in config file and thus won't be generated"; logger.LogWarning(msg); Console.WriteLine(msg); return; } result.ToExcel(excelFile.fileName); logger.LogInformation("Excel output file created"); }
public override Parameters GetParameters(IMatrixData[] inputData, ref string errString) { ValidateParameters(inputData, ref errString); Parameter[] param = new Parameter[parameter.Length]; for (int i = 0; i < parameter.Length; i++) { if (i < parameter.Length - 1){ param[i] = new FileParam(parameter[i]); } else{ param[i] = new FolderParam(parameter[i]); } } return new Parameters(param); }
public void TestFileParam() { var sparam = new FileParam("myname", "myvalue"); var sparam2 = (FileParam) sparam.ToXmlAndBack(); Assert.AreEqual(sparam.Value, sparam2.Value); Assert.AreEqual(sparam.Name, sparam2.Name); }
/// <summary> /// Convert <see cref="BaseLib.Param"/> to <see cref="BaseLibS.Param"/> /// </summary> /// <param name="p"></param> /// <returns></returns> public static Parameter Convert(Parameter p) { if (p.Type == ParamType.Server){ return p; } if (p is RegexReplaceParamWf){ RegexReplaceParamWf q = (RegexReplaceParamWf) p; RegexReplaceParam b = new RegexReplaceParam(q.Name, q.Value.Item1, q.Value.Item2, q.Previews){ Help = q.Help, Visible = q.Visible, Default = q.Default, Url = q.Url }; foreach (ValueChangedHandler act in q.GetPropertyChangedHandlers()){ b.ValueChanged += act; } return b; } if (p is RegexMatchParamWf){ RegexMatchParamWf q = (RegexMatchParamWf) p; RegexMatchParam b = new RegexMatchParam(q.Name, q.Value, q.Previews){ Help = q.Help, Visible = q.Visible, Default = q.Default, Url = q.Url }; foreach (ValueChangedHandler act in q.GetPropertyChangedHandlers()){ b.ValueChanged += act; } return b; } if (p is BoolParamWf){ BoolParamWf q = (BoolParamWf) p; BoolParam b = new BoolParam(q.Name, q.Value){ Help = q.Help, Visible = q.Visible, Default = q.Default, Url = q.Url }; foreach (ValueChangedHandler act in q.GetPropertyChangedHandlers()){ b.ValueChanged += act; } return b; } if (p is BoolWithSubParamsWf){ BoolWithSubParamsWf q = (BoolWithSubParamsWf) p; q.SubParamsFalse?.Convert(Convert); q.SubParamsTrue?.Convert(Convert); BoolWithSubParams b = new BoolWithSubParams(q.Name, q.Value){ Help = q.Help, Visible = q.Visible, SubParamsFalse = q.SubParamsFalse, SubParamsTrue = q.SubParamsTrue, Default = q.Default, ParamNameWidth = q.ParamNameWidth, TotalWidth = q.TotalWidth, Url = q.Url }; foreach (ValueChangedHandler act in q.GetPropertyChangedHandlers()){ b.ValueChanged += act; } return b; } if (p is DictionaryIntValueParamWf){ DictionaryIntValueParamWf q = (DictionaryIntValueParamWf) p; DictionaryIntValueParam b = new DictionaryIntValueParam(q.Name, q.Value, q.Keys){ Help = q.Help, Visible = q.Visible, Default = q.Default, Url = q.Url }; foreach (ValueChangedHandler act in q.GetPropertyChangedHandlers()){ b.ValueChanged += act; } return b; } if (p is DoubleParamWf){ DoubleParamWf q = (DoubleParamWf) p; DoubleParam b = new DoubleParam(q.Name, q.Value){ Help = q.Help, Visible = q.Visible, Default = q.Default, Url = q.Url }; foreach (ValueChangedHandler act in q.GetPropertyChangedHandlers()){ b.ValueChanged += act; } return b; } if (p is FileParamWf){ FileParamWf q = (FileParamWf) p; FileParam b = new FileParam(q.Name, q.Value){ Help = q.Help, Visible = q.Visible, Default = q.Default, Filter = q.Filter, ProcessFileName = q.ProcessFileName, Save = q.Save, Url = q.Url }; foreach (ValueChangedHandler act in q.GetPropertyChangedHandlers()){ b.ValueChanged += act; } return b; } if (p is FolderParamWf){ FolderParamWf q = (FolderParamWf) p; FolderParam b = new FolderParam(q.Name, q.Value){ Help = q.Help, Visible = q.Visible, Default = q.Default, Url = q.Url }; foreach (ValueChangedHandler act in q.GetPropertyChangedHandlers()){ b.ValueChanged += act; } return b; } if (p is IntParamWf){ IntParamWf q = (IntParamWf) p; IntParam b = new IntParam(q.Name, q.Value){ Help = q.Help, Visible = q.Visible, Default = q.Default, Url = q.Url }; foreach (ValueChangedHandler act in q.GetPropertyChangedHandlers()){ b.ValueChanged += act; } return b; } if (p is LabelParamWf){ LabelParamWf q = (LabelParamWf) p; LabelParam b = new LabelParam(q.Name, q.Value){ Help = q.Help, Visible = q.Visible, Default = q.Default, Url = q.Url }; foreach (ValueChangedHandler act in q.GetPropertyChangedHandlers()){ b.ValueChanged += act; } return b; } if (p is MultiChoiceMultiBinParamWf){ MultiChoiceMultiBinParamWf q = (MultiChoiceMultiBinParamWf) p; MultiChoiceMultiBinParam b = new MultiChoiceMultiBinParam(q.Name, q.Value){ Help = q.Help, Visible = q.Visible, Values = q.Values, Bins = q.Bins, Default = q.Default, Url = q.Url }; foreach (ValueChangedHandler act in q.GetPropertyChangedHandlers()){ b.ValueChanged += act; } return b; } if (p is MultiChoiceParamWf){ MultiChoiceParamWf q = (MultiChoiceParamWf) p; MultiChoiceParam b = new MultiChoiceParam(q.Name, q.Value){ Help = q.Help, Visible = q.Visible, Repeats = q.Repeats, Values = q.Values, Default = q.Default, DefaultSelections = q.DefaultSelections, DefaultSelectionNames = q.DefaultSelectionNames, Url = q.Url }; foreach (ValueChangedHandler act in q.GetPropertyChangedHandlers()){ b.ValueChanged += act; } return b; } if (p is MultiFileParamWf){ MultiFileParamWf q = (MultiFileParamWf) p; MultiFileParam b = new MultiFileParam(q.Name, q.Value){ Help = q.Help, Visible = q.Visible, Filter = q.Filter, Default = q.Default, Url = q.Url }; foreach (ValueChangedHandler act in q.GetPropertyChangedHandlers()){ b.ValueChanged += act; } return b; } if (p is MultiStringParamWf){ MultiStringParamWf q = (MultiStringParamWf) p; MultiStringParam b = new MultiStringParam(q.Name, q.Value){ Help = q.Help, Visible = q.Visible, Default = q.Default, Url = q.Url }; foreach (ValueChangedHandler act in q.GetPropertyChangedHandlers()){ b.ValueChanged += act; } return b; } if (p is SingleChoiceParamWf){ SingleChoiceParamWf q = (SingleChoiceParamWf) p; SingleChoiceParam b = new SingleChoiceParam(q.Name, q.Value){ Help = q.Help, Visible = q.Visible, Values = q.Values, Default = q.Default, Url = q.Url }; foreach (ValueChangedHandler act in q.GetPropertyChangedHandlers()){ b.ValueChanged += act; } return b; } if (p is SingleChoiceWithSubParamsWf){ SingleChoiceWithSubParamsWf q = (SingleChoiceWithSubParamsWf) p; foreach (Parameters param in q.SubParams){ param?.Convert(Convert); } SingleChoiceWithSubParams b = new SingleChoiceWithSubParams(q.Name, q.Value){ Help = q.Help, Visible = q.Visible, Values = q.Values, Default = q.Default, SubParams = new Parameters[q.SubParams.Count], ParamNameWidth = q.ParamNameWidth, TotalWidth = q.TotalWidth, Url = q.Url }; for (int i = 0; i < q.SubParams.Count; i++){ b.SubParams[i] = q.SubParams[i]; } foreach (ValueChangedHandler act in q.GetPropertyChangedHandlers()){ b.ValueChanged += act; } return b; } if (p is StringParamWf){ StringParamWf q = (StringParamWf) p; StringParam b = new StringParam(q.Name, q.Value){ Help = q.Help, Visible = q.Visible, Default = q.Default, Url = q.Url }; foreach (ValueChangedHandler act in q.GetPropertyChangedHandlers()){ b.ValueChanged += act; } return b; } if (p is Ms1LabelParamWf){ Ms1LabelParamWf q = (Ms1LabelParamWf) p; Ms1LabelParam b = new Ms1LabelParam(q.Name, q.Value){ Values = q.Values, Multiplicity = q.Multiplicity, Help = q.Help, Visible = q.Visible, Default = q.Default, Url = q.Url }; foreach (ValueChangedHandler act in q.GetPropertyChangedHandlers()){ b.ValueChanged += act; } return b; } throw new Exception("Could not convert ParamWfeter"); }