WF 4.5 워크 플로 활동에서 폴더 찾아보기를 구현하려고하지만 줄임표 단추가 표시되지 않고 거의 아무 일도 발생하지 않습니다. Windows 워크 플로 디자이너 4.5 (폴더 찾아보기)의 UITypeEditor
이
내 UITypeEditor 클래스입니다 :public class BrowseForFolderEditor : UITypeEditor
{
public override object EditValue(ITypeDescriptorContext context,
IServiceProvider provider, object value)
{
string folderName = string.Empty;
BrowseForFolderAttribute browseForFolderAttribute = null;
if (value is string)
{
if (context?.PropertyDescriptor != null)
{
browseForFolderAttribute =
(BrowseForFolderAttribute)
context.PropertyDescriptor.Attributes[typeof(BrowseForFolderAttribute)];
}
var browse = new FolderBrowserDialogEx
{
Description = browseForFolderAttribute?.Description,
ShowNewFolderButton = true,
ShowEditBox = true,
SelectedPath = folderName,
ShowFullPathInEditBox = false,
RootFolder = Environment.SpecialFolder.MyComputer
};
var result = browse.ShowDialog();
if (result == DialogResult.OK)
folderName = browse.SelectedPath;
return folderName;
}
// Return whatever value if it wasn't a string - Should never occur!
return value;
}
public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
{
return UITypeEditorEditStyle.Modal; //base.GetEditStyle(context);
}
public class BrowseForFolderAttribute : Attribute
{
public BrowseForFolderAttribute(string description)
{
this.Description = description;
}
public string Description { get; set; }
}
}
그리고 내 Activity
의 코드를 선언하는 방법이 있습니다 : 그것은 어떤 차이가 있는지
[Description("Select the folder where the files will be
copied/moved to.")]
[Category("Folders")]
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
[BrowseForFolderEditor.BrowseForFolder("Select the folder where the files will be
copied/moved to.")]
[Editor(typeof(BrowseForFolderEditor), typeof(UITypeEditor))]
public string TargetPath { get; set; }
모르겠어요하지만 내 워크 플로우 Activity
유형은 NativeActivity
입니다.
속성은 속성 표에 나타나지만 줄임표 단추가없는 텍스트 상자로 표시됩니다.
도움을 주시면 감사하겠습니다.
UPDATE-1 :
문제는 난 그냥 CodeActivity
에 내 코드를 변경했습니다과는 차이를하지으로 NativeCodeActivity
사실과는 아무 상관이 없습니다.