Exemplo n.º 1
0
        public void ValidCreateFolderDuplicateTests(FolderParam param, Enums.ValidDuplicated duplicate)
        {
            var request = JsonConvert.SerializeObject(new Dictionary <string, string>
            {
                ["name"]    = "TestDuplicateCreateFolder",
                ["type"]    = "public",
                ["tempKey"] = "tempValue"
            });

            request.Replace("tempKey", param.ToString().ToLower());
            if (duplicate == Enums.ValidDuplicated.SameValue)
            {
                request.Replace("tempValue", param == FolderParam.Name ? "TestDuplicateCreateFolder" : "public");
            }
            else
            {
                request.Replace("tempValue", param == FolderParam.Name ? "TestDuplicateCreateFolderOther" : "private");
            }
            var reportHandler = new DefaultManager();
            var result        = reportHandler.Send <FolderResponse>(EndPoint, request, HttpMethod.POST);

            PrAssert.That(result, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.OK), "Create report folder is failed.");
            PrAssert.That(result.Result.Id, PrIs.Not.Null.Or.Not.Empty.And.Positive);
            PrAssert.That(result.Result.Code, PrIs.EqualTo("Data Created."));
        }
Exemplo n.º 2
0
        public static async Task <int> createNewFolder(string name, int fromId)
        {
            HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, String.Format(BASE_FOLDER_URL + "/create"));

            request.Method = HttpMethod.Post;
            request.Headers.Add("Authorization", "Token token=" + App.TOKEN);
            var data = new FolderParam
            {
                folder = new NewFolderParam
                {
                    folder_name = name,
                    from_folder = fromId
                }
            };
            string json = JsonConvert.SerializeObject(data);

            request.Content = new StringContent(json, Encoding.UTF8, "application/json");
            HttpResponseMessage result = await client.SendAsync(request);

            if (result.IsSuccessStatusCode)
            {
                string content = await result.Content.ReadAsStringAsync();

                var feedback = JsonConvert.DeserializeObject <SuccessFeedBack>(content);
                if (feedback.success == 200)
                {
                    return(int.Parse(feedback.info));
                }
                return(-1);
            }
            else
            {
                return(-1);
            }
        }
Exemplo n.º 3
0
        public void ValidUpdateFolderDuplicateTests(FolderParam param, Enums.ValidDuplicated duplicate)
        {
            var request = JsonConvert.SerializeObject(new Dictionary <string, string>
            {
                ["id"]      = FolderTest.Data.ToString(),
                ["name"]    = "UpdateName",
                ["type"]    = "public",
                ["tempKey"] = "tempValue"
            });

            request = request.Replace("tempKey", FolderParamMapper[param]);
            if (duplicate == Enums.ValidDuplicated.SameValue)
            {
                request = request.Replace("tempValue", param == FolderParam.Id ? $"{FolderTest.Data}" : param == FolderParam.Name ? "UpdateName" : "public");
            }
            else
            {
                request = request.Replace("tempValue", param == FolderParam.Id ? "1" : param == FolderParam.Name ? "UpdateNameOther" : "private");
            }
            var reportHandler = new DefaultManager();
            var result        = reportHandler.Send <FolderResponse>(EndPoint, request, HttpMethod.PUT);

            PrAssert.That(result, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.OK), "Update report folder is failed.");
            PrAssert.That(result.Result.Code, PrIs.EqualTo("OK"));
        }
Exemplo n.º 4
0
        public static async Task <bool> decryptFolder(int id, string passPhrase)
        {
            HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post,
                                                                String.Format(BASE_FOLDER_URL + "/decrypt"));

            request.Method = HttpMethod.Post;
            request.Headers.Add("Authorization", "Token token=" + App.TOKEN);

            var data = new FolderParam
            {
                folder = new EncryptFolderParam
                {
                    folder_id   = id,
                    pass_phrase = passPhrase
                }
            };
            string json = JsonConvert.SerializeObject(data);

            request.Content = new StringContent(json, Encoding.UTF8, "application/json");
            HttpResponseMessage result = await client.SendAsync(request);

            if (result.IsSuccessStatusCode)
            {
                string content = await result.Content.ReadAsStringAsync();

                var feedback = JsonConvert.DeserializeObject <SuccessFeedBack>(content);
                if (feedback.success == 200)
                {
                    return(true);
                }
                return(false);
            }
            return(false);
        }
Exemplo n.º 5
0
        public void TestFolderParam()
        {
            FolderParam sparam  = new FolderParam("myname", "myvalue");
            FolderParam sparam2 = (FolderParam)sparam.ToXmlAndBack();

            Assert.AreEqual(sparam.Value, sparam2.Value);
            Assert.AreEqual(sparam.Name, sparam2.Name);
        }
        public void InvalidInjectionUpdateFolderTests(FolderParam param, Enums.InvalidInjection testcase)
        {
            var request = new Dictionary <string, string>
            {
                ["id"] = FolderTest.Data.ToString(),
                [FolderParamMapper[param]] = InjectionMapper[testcase]
            };
            var reportHandler = new DefaultManager();
            var result        = reportHandler.Send <FolderResponse>(EndPoint, request, HttpMethod.PUT);

            PrAssert.That(result, PrIs.ErrorResponse().And.HttpCode(System.Net.HttpStatusCode.BadRequest), "Still update folder successful.");
        }
        public void InvalidInjectionCreateFolderTests(FolderParam param, Enums.InvalidInjection testcase)
        {
            var request = new Dictionary <string, string>
            {
                ["name"] = GetStringLengthMapper[Length.Random],
                ["type"] = Types.Public.ToString().ToLower()
            };

            request[FolderParamMapper[param]] = InjectionMapper[testcase];
            var reportHandler = new DefaultManager();
            var result        = reportHandler.Send <FolderResponse>(EndPoint, request, HttpMethod.POST);

            PrAssert.That(result, PrIs.ErrorResponse().And.HttpCode(System.Net.HttpStatusCode.BadRequest), "Still create folder successful.");
        }
        public void InvalidSpecialUpdateFolderTest(FolderParam param, string value)
        {
            var request = new Dictionary <string, string>
            {
                ["id"]   = FolderTest.Data.ToString(),
                ["name"] = GetStringLengthMapper[Length.Random],
                ["type"] = Types.Public.ToString().ToLower()
            };

            request[FolderParamMapper[param]] = value;
            var reportHandler = new DefaultManager();
            var result        = reportHandler.Send <FolderResponse>(EndPoint, request, HttpMethod.PUT);

            PrAssert.That(result, PrIs.ErrorResponse().And.HttpCode(System.Net.HttpStatusCode.BadRequest), "Still update folder successful.");
        }
Exemplo n.º 9
0
        public void ValidReadFolderTests(FolderParam param, string testcase)
        {
            var request = new Dictionary <string, string>
            {
                [FolderParamMapper[param]] = testcase == "Default" ? "1" : FolderTest.Data.ToString()
            };
            var reportHandler = new DefaultManager();
            var result        = reportHandler.Send <FolderResponse.Read>(EndPoint, request, HttpMethod.GET);

            PrAssert.That(result, PrIs.SuccessfulResponse().And.HttpCode(System.Net.HttpStatusCode.OK), "Read report folder is failed.");
            PrAssert.That(result.Result.Id, PrIs.EqualTo(Int32.Parse(request.Single().Value)));
            PrAssert.That(result.Result.Name, PrIs.EqualTo(testcase == "Default" ? "進捗レポート" : "TestFolder"));
            PrAssert.That(result.Result.Type, PrIs.EqualTo("public"));
            PrAssert.That(result.Result.Content.Folder, PrIs.Empty);
            PrAssert.That(result.Result.Content.Spec, testcase == "Default" ? PrIs.Not.Null.Or.Empty : PrIs.Empty);
        }
Exemplo n.º 10
0
        public void InvalidUpdateFolderTests(FolderParam param, Invalid testcase)
        {
            var request = new Dictionary <string, string>
            {
                ["id"]   = FolderTest.Data.ToString(),
                ["name"] = "TestUpdate",
                ["type"] = "public"
            };

            if (testcase == Invalid.Missing)
            {
                request.Remove(FolderParamMapper[param]);
            }
            else
            {
                request[FolderParamMapper[param]] = InvalidMapper[testcase];
            }
            var reportHandler = new DefaultManager();
            var result        = reportHandler.Send <FolderResponse>(EndPoint, request, HttpMethod.PUT);

            PrAssert.That(result, PrIs.ErrorResponse().And.HttpCode(System.Net.HttpStatusCode.BadRequest), "Still update folder successful.");
        }
Exemplo n.º 11
0
 /// <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");
 }
Exemplo n.º 12
0
 public void TestFolderParam()
 {
     var sparam = new FolderParam("myname", "myvalue");
     var sparam2 = (FolderParam) sparam.ToXmlAndBack();
     Assert.AreEqual(sparam.Value, sparam2.Value);
     Assert.AreEqual(sparam.Name, sparam2.Name);
 }
Exemplo n.º 13
0
        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);
        }
 /// <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");
 }