using System.Threading;\r
using System.Reflection;\r
using System.Linq;\r
+using System.IO;\r
\r
\r
-namespace test\r
+namespace test2\r
{\r
- class GOLIBTest_TypeViewer : OpenTKGameWindow\r
+ class GOLIBTest_DirViewer : OpenTKGameWindow\r
{\r
- public GOLIBTest_TypeViewer ()\r
+ public GOLIBTest_DirViewer ()\r
: base(1024, 600,"test")\r
{}\r
\r
- VerticalStack g;\r
- TypeContainer type;\r
+ public DirContainer CurDir;\r
\r
protected override void OnLoad (EventArgs e)\r
{\r
base.OnLoad (e);\r
- type = new TypeContainer(typeof (GraphicObject));\r
+ CurDir = new DirContainer(new DirectoryInfo ("/home/jp/"));\r
\r
- this.AddWidget(Interface.Load ("Interfaces/testTypeViewer.goml", type));\r
+ this.AddWidget(Interface.Load ("Interfaces/testDirViewer.goml", CurDir));\r
//LoadInterface("Interfaces/testTypeViewer.goml", out g);\r
}\r
\r
- protected override void OnRenderFrame (FrameEventArgs e)\r
- {\r
- GL.Clear (ClearBufferMask.ColorBufferBit);\r
- base.OnRenderFrame (e);\r
- SwapBuffers ();\r
-\r
- MemberInfo mi;\r
-\r
-\r
- }\r
-\r
[STAThread]\r
static void Main ()\r
{\r
Console.WriteLine ("starting example");\r
\r
- using (GOLIBTest_TypeViewer win = new GOLIBTest_TypeViewer( )) {\r
+ using (GOLIBTest_DirViewer win = new GOLIBTest_DirViewer( )) {\r
win.Run (30.0);\r
}\r
}\r
}\r
- public class TypeContainer\r
+ public class DirContainer\r
{\r
- public Type Type;\r
- public TypeContainer(Type _type){\r
- Type = _type;\r
+ public DirectoryInfo CurDir;\r
+ public DirContainer(DirectoryInfo _dir){\r
+ CurDir = _dir;\r
}\r
public string Name {\r
- get { return Type.Name; }\r
+ get { return CurDir.Name; }\r
}\r
- public MemberInfo[] Members {\r
+ public FileSystemInfo[] GetFileSystemInfos\r
+ {\r
get {\r
- MemberInfo[] mi = Properties.Cast<MemberInfo> ().Concat (Methods.Cast<MemberInfo> ()).ToArray(); \r
- return mi;\r
+ return CurDir.GetFileSystemInfos ().Where(fi => !fi.Attributes.HasFlag(FileAttributes.Hidden)).ToArray();\r
}\r
}\r
- public MethodInfo[] Methods {\r
- get { return Type.GetMethods (BindingFlags.Public | BindingFlags.Instance).Where (m => !m.IsSpecialName).ToArray(); }\r
+ void onDirUp(object sender, MouseButtonEventArgs e)\r
+ {\r
+ \r
}\r
- public PropertyInfo[] Properties {\r
- get { return Type.GetProperties (); }\r
+ public void onMouseDown(object sender, MouseButtonEventArgs e)\r
+ {\r
+ Debug.WriteLine (sender.ToString ());\r
}\r
- \r
}\r
\r
}
\ No newline at end of file
<?xml version="1.0"?>
- <VerticalStack Height="-1" Width="250" Name="hstack" Margin="0" Spacing="0">
+ <VerticalStack Height="-1" Width="600" Name="hstack" Margin="0" Spacing="0">
<Border Height="-1" Width="0" BorderWidth="2" CornerRadius="10">
<Label Name="labName" Text="{Name}" Width="0" Height="-1"/>
</Border>
- <ListBox Data="{Members}" Width="0" Height="400" ItemTemplate="Interfaces/tmpMembers.goml" Focusable="true">
+ <ListBox Data="{GetFileSystemInfos}" Width="0" Height="400" ItemTemplate="Interfaces/tmpDirItem.goml" Focusable="true">
<Template>
<Border Width="0" Height="0" BorderWidth="1" Margin="1" MinimumSize="0;100" >
<HorizontalStack Width="0" Height="0">
<?xml version="1.0"?>\r
- <HorizontalStack Width="0" Height="-1" Focusable="true" \r
+ <HorizontalStack Width="0" Height="-1" Focusable="true" MouseClick="onMouseDown"\r
MouseEnter="{Background=Red}"\r
MouseLeave="{Background=Transparent}">\r
- <Image Width="8" Height="8" Path="#go.Images.Icons.member.svg" SvgSub="{GetIcon}"/>\r
+<!-- <Image Width="8" Height="8" Path="#go.Images.Icons.member.svg" SvgSub="{GetIcon}"/>-->\r
<Label Text="{Name}" Width="0" Height="-1" Margin="0"/>\r
- <Label Text="{MemberType}" Width="-1" Height="-1" Margin="0"/>\r
+ <Label Text="{Attributes}" Width="-1" Height="-1" Margin="0"/>\r
</HorizontalStack>\r
\r
<Compile Include="GOLIBTest_TypeViewer.cs" />
<Compile Include="GOLIBTest_stack.cs" />
<Compile Include="GOLIBTest_HStack.cs" />
+ <Compile Include="GOLIBTest_DirViewer.cs" />
</ItemGroup>
<ItemGroup>
<None Include="image\u.svg">
<None Include="Interfaces\testHStack.goml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
+ <None Include="Interfaces\testDirViewer.goml">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
+ <None Include="Interfaces\tmpDirItem.goml">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </None>
</ItemGroup>
<ItemGroup>
<Folder Include="Interfaces\" />