Skip to content

Commit 71e1bce

Browse files
committed
Merge branch 'release/0.1.77'
2 parents 4ab534a + d4704c4 commit 71e1bce

18 files changed

Lines changed: 548 additions & 143 deletions

Utils/Common/DesignerMetadata.cs

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Activities;
6+
using System.ComponentModel;
7+
using System.Threading;
8+
using Utils.Properties;
9+
using Utils.Common;
10+
using System.Activities.Presentation.Metadata;
11+
using Utils.PathUtils;
12+
using Utils.StringUtils;
13+
14+
namespace Utils
15+
{
16+
public class DesignerMetadata : IRegisterMetadata
17+
{
18+
public void Register()
19+
{
20+
AttributeTableBuilder builder = new AttributeTableBuilder();
21+
22+
addCustomAttributes_PathUtils_categories(builder);
23+
addCustomAttributes_StringUtils_categoriess(builder);
24+
25+
MetadataStore.AddAttributeTable(builder.CreateTable());
26+
27+
//ShowPropertyInOutlineViewAttribute hideFromOutlineAttribute = new ShowPropertyInOutlineViewAttribute() { CurrentPropertyVisible = false, DuplicatedChildNodesVisible = false };
28+
//builder.AddCustomAttributes(typeof(WithFtpSession), nameof(WithFtpSession.Body), hideFromOutlineAttribute);
29+
30+
}
31+
32+
private void addCustomAttributes_PathUtils_categories(AttributeTableBuilder builder)
33+
{
34+
// 1.Activitiesペイン上のツリー構造を構築する。
35+
// ドットで階層を表現する
36+
{
37+
string PathUtils_categories = "Utils.Path Utilities";
38+
builder.AddCustomAttributes(typeof(Combine), new CategoryAttribute(PathUtils_categories));
39+
builder.AddCustomAttributes(typeof(CurrentDir), new CategoryAttribute(PathUtils_categories));
40+
builder.AddCustomAttributes(typeof(Utils.PathUtils.PathUtils), new CategoryAttribute(PathUtils_categories));
41+
}
42+
43+
// 2.Activitiesペイン上のアクティビティ名
44+
{
45+
builder.AddCustomAttributes(typeof(Combine), new DisplayNameAttribute(Resources.DisplayName2_Combine));
46+
builder.AddCustomAttributes(typeof(CurrentDir), new DisplayNameAttribute(Resources.DisplayName2_CurrentDir));
47+
builder.AddCustomAttributes(typeof(Utils.PathUtils.PathUtils), new DisplayNameAttribute(Resources.DisplayName2_PathUtils));
48+
}
49+
50+
// 3.Activitiesペイン上のアクティビティをポイントしたときに表示されるツールチップ文言
51+
{
52+
builder.AddCustomAttributes(typeof(Combine), new DescriptionAttribute(Resources.Description3_Combine));
53+
builder.AddCustomAttributes(typeof(CurrentDir), new DescriptionAttribute(Resources.Description3_CurrentDir));
54+
builder.AddCustomAttributes(typeof(Utils.PathUtils.PathUtils), new DescriptionAttribute(Resources.Description3_PathUtils));
55+
}
56+
57+
// 4.プロパティペイン内のプロパティの説明文言
58+
{
59+
builder.AddCustomAttributes(typeof(Combine), nameof(Combine.PathArray), new DescriptionAttribute(Resources.Description4_Combine_PathArray));
60+
builder.AddCustomAttributes(typeof(CurrentDir), nameof(CurrentDir.FullPath), new DescriptionAttribute(Resources.Description4_CurrentDir_FullPath));
61+
{
62+
builder.AddCustomAttributes(typeof(Utils.PathUtils.PathUtils), nameof(Utils.PathUtils.PathUtils.Path), new DescriptionAttribute(Resources.Description4_PathUtils_Path));
63+
builder.AddCustomAttributes(typeof(Utils.PathUtils.PathUtils), nameof(Utils.PathUtils.PathUtils.FullPath), new DescriptionAttribute(Resources.Description4_PathUtils_FullPath));
64+
builder.AddCustomAttributes(typeof(Utils.PathUtils.PathUtils), nameof(Utils.PathUtils.PathUtils.DirectoryName), new DescriptionAttribute(Resources.Description4_PathUtils_DirectoryName));
65+
builder.AddCustomAttributes(typeof(Utils.PathUtils.PathUtils), nameof(Utils.PathUtils.PathUtils.DirExists), new DescriptionAttribute(Resources.Description4_PathUtils_DirExists));
66+
builder.AddCustomAttributes(typeof(Utils.PathUtils.PathUtils), nameof(Utils.PathUtils.PathUtils.FileExists), new DescriptionAttribute(Resources.Description4_PathUtils_FileExists));
67+
}
68+
69+
}
70+
71+
// 5.プロパティペインの、カテゴリ名
72+
//{
73+
//builder.AddCustomAttributes(typeof(ConvertCRLF), nameof(ConvertCRLF.CR), new CategoryAttribute(nameof(Resources.ConvertCRLF_Category)));
74+
//builder.AddCustomAttributes(typeof(ConvertCRLF), nameof(ConvertCRLF.LF), new CategoryAttribute(nameof(Resources.ConvertCRLF_Category)));
75+
//}
76+
77+
// 6.プロパティペイン内のプロパティの変数名
78+
//builder.AddCustomAttributes(typeof(Combine), nameof(Combine.PathArray), new DisplayNameAttribute("test display1")); //クラスのプロパティに直接 DisplayNameを書いたのと意味おなじ。
79+
}
80+
81+
private void addCustomAttributes_StringUtils_categoriess(AttributeTableBuilder builder)
82+
{
83+
84+
// 1.Activitiesペイン上のツリー構造を構築する。
85+
// ドットで階層を表現する
86+
{
87+
string StringUtils_categories = "Utils.String Utilities";
88+
builder.AddCustomAttributes(typeof(Base64Encode), new CategoryAttribute(StringUtils_categories));
89+
builder.AddCustomAttributes(typeof(Base64Decode), new CategoryAttribute(StringUtils_categories));
90+
builder.AddCustomAttributes(typeof(Base64EncodeFromFile), new CategoryAttribute(StringUtils_categories));
91+
builder.AddCustomAttributes(typeof(ConvertCRLF), new CategoryAttribute(StringUtils_categories));
92+
builder.AddCustomAttributes(typeof(ToJSONString), new CategoryAttribute(StringUtils_categories));
93+
}
94+
95+
// 2.Activitiesペイン上のアクティビティ名
96+
{
97+
builder.AddCustomAttributes(typeof(Base64Encode), new DisplayNameAttribute(Resources.DisplayName2_Base64Encode));
98+
builder.AddCustomAttributes(typeof(Base64Decode), new DisplayNameAttribute(Resources.DisplayName2_Base64Decode));
99+
builder.AddCustomAttributes(typeof(Base64EncodeFromFile), new DisplayNameAttribute(Resources.DisplayName2_Base64EncodeFromFile));
100+
builder.AddCustomAttributes(typeof(ConvertCRLF), new DisplayNameAttribute(Resources.DisplayName2_ConvertCRLF));
101+
builder.AddCustomAttributes(typeof(ToJSONString), new DisplayNameAttribute(Resources.DisplayName2_ToJSONString));
102+
}
103+
104+
// 3.Activitiesペイン上のアクティビティをポイントしたときに表示されるツールチップ文言
105+
{
106+
builder.AddCustomAttributes(typeof(Base64Encode), new DescriptionAttribute(Resources.Description3_Base64Encode));
107+
builder.AddCustomAttributes(typeof(Base64Decode), new DescriptionAttribute(Resources.Description3_Base64Decode));
108+
builder.AddCustomAttributes(typeof(Base64EncodeFromFile), new DescriptionAttribute(Resources.Description3_Base64EncodeFromFile));
109+
builder.AddCustomAttributes(typeof(ConvertCRLF), new DescriptionAttribute(Resources.Description3_ConvertCRLF));
110+
builder.AddCustomAttributes(typeof(ToJSONString), new DescriptionAttribute(Resources.Description3_ToJSONString));
111+
112+
}
113+
114+
// 4.プロパティペイン内のプロパティの説明文言
115+
{
116+
builder.AddCustomAttributes(typeof(Base64Encode), nameof(Base64Encode.Target), new DescriptionAttribute(Resources.Description4_Base64Encode_Target));
117+
builder.AddCustomAttributes(typeof(Base64Decode), nameof(Base64Decode.Target), new DescriptionAttribute(Resources.Description4_Base64Decode_Target));
118+
builder.AddCustomAttributes(typeof(Base64EncodeFromFile), nameof(Base64EncodeFromFile.Path), new DescriptionAttribute(Resources.Description4_Base64EncodeFromFile_Path));
119+
builder.AddCustomAttributes(typeof(ConvertCRLF), nameof(ConvertCRLF.Target), new DescriptionAttribute(Resources.Description4_ConvertCRLF_Target));
120+
}
121+
122+
// 5.プロパティペインの、カテゴリ名
123+
{
124+
builder.AddCustomAttributes(typeof(ConvertCRLF), nameof(ConvertCRLF.CR), new CategoryAttribute(Resources.Category5_ConvertCRLF_CRLF));
125+
builder.AddCustomAttributes(typeof(ConvertCRLF), nameof(ConvertCRLF.LF), new CategoryAttribute(Resources.Category5_ConvertCRLF_CRLF));
126+
}
127+
128+
// 6.プロパティペイン内のプロパティの変数名
129+
{ }
130+
131+
132+
}
133+
}
134+
}

Utils/Common/Localization.cs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Activities;
6+
using System.ComponentModel;
7+
using System.Threading;
8+
using Utils.Properties;
9+
10+
namespace Utils.Common
11+
{
12+
//[AttributeUsage(AttributeTargets.Property)]
13+
//public class LocalizedCategoryAttribute : CategoryAttribute
14+
//{
15+
// public LocalizedCategoryAttribute(string category) : base(category)
16+
// {
17+
// }
18+
19+
// protected override string GetLocalizedString(string value)
20+
// {
21+
// return Resources.ResourceManager.GetString(value);
22+
// }
23+
24+
//}
25+
26+
//public class LocalizedDescriptionAttribute : DescriptionAttribute
27+
//{
28+
// private readonly string resourceName;
29+
// public LocalizedDescriptionAttribute(string resourceName)
30+
// : base()
31+
// {
32+
// this.resourceName = resourceName;
33+
// }
34+
35+
// public override string Description
36+
// {
37+
// get
38+
// {
39+
// return Resources.ResourceManager.GetString(this.resourceName);
40+
// }
41+
// }
42+
//}
43+
}

Utils/Common/LocalizedCategoryAttribute.cs

Lines changed: 0 additions & 24 deletions
This file was deleted.

Utils/Common/LocalizedDescriptionAttribute.cs

Lines changed: 0 additions & 29 deletions
This file was deleted.

Utils/PathUtils/Combine.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@ namespace Utils.PathUtils
1313
{
1414

1515
[Designer(typeof(CombineDesigner))]
16-
//[DisplayName("パス連結")]
1716
public sealed class Combine : CodeActivity
1817
{
1918
[Category("Input")]
2019
[RequiredArgument]
21-
[LocalizedDescription("Combine_Description")]
22-
//[DisplayName("パスの配列")]
2320
public InArgument<String[]> PathArray { get; set; }
2421

2522
[Category("Output")]

Utils/PathUtils/CurrentDir.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.ComponentModel;
77
using System.IO;
88
using Utils.Common;
9+
using Utils.Properties;
910

1011
namespace Utils.PathUtils
1112
{
@@ -14,7 +15,6 @@ namespace Utils.PathUtils
1415
public sealed class CurrentDir : CodeActivity
1516
{
1617
[Category("Output")]
17-
[LocalizedDescription("CurrentDir_Description")]
1818
public OutArgument<String> FullPath { get; set; }
1919

2020
protected override void Execute(CodeActivityContext context)

Utils/PathUtils/PathUtils.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.ComponentModel;
77
using System.IO;
88
using Utils.Common;
9+
using Utils.Properties;
910

1011
namespace Utils.PathUtils
1112
{
@@ -16,26 +17,21 @@ public sealed class PathUtils : CodeActivity
1617

1718
[Category("Input")]
1819
[RequiredArgument]
19-
[LocalizedDescription("PathUtils_Path_Desc")]
2020
public InArgument<String> Path { get; set; }
2121

2222
[Category("Output")]
23-
[LocalizedDescription("PathUtils_FullPath_Desc")]
2423
public OutArgument<String> FullPath { get; set; }
2524

2625

2726
[Category("Output")]
28-
[LocalizedDescription("PathUtils_DirectoryName_Desc")]
2927
public OutArgument<String> DirectoryName { get; set; }
3028

3129

3230
[Category("Output")]
33-
[LocalizedDescription("PathUtils_DirExists_Desc")]
3431
public OutArgument<Boolean> DirExists { get; set; }
3532

3633

3734
[Category("Output")]
38-
[LocalizedDescription("PathUtils_FileExists_Desc")]
3935
public OutArgument<Boolean> FileExists { get; set; }
4036

4137

Utils/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@
3333
// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
3434
// 以下のように '*' を使用します:
3535
// [assembly: AssemblyVersion("1.0.*")]
36-
[assembly: AssemblyVersion("0.1.61.0")]
36+
[assembly: AssemblyVersion("0.1.77.0")]
3737
[assembly: AssemblyFileVersion("1.0.0.0")]

0 commit comments

Comments
 (0)