Skip to content

Commit

Permalink
Final
Browse files Browse the repository at this point in the history
  • Loading branch information
Detrav committed Dec 30, 2015
1 parent ee45ea6 commit 949da3e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
1 change: 1 addition & 0 deletions TWeather2015/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ private void Window_Loaded(object sender, RoutedEventArgs e)
files.AddRange(Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.CommonDesktopDirectory)));
dIconManager.loadIcons(files.ToArray());
}
dIconManager.reCalculateItems();
//dIconManager.UpdateLayout();
}

Expand Down
2 changes: 1 addition & 1 deletion TWeather2015/TWeather2015.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{58FBC381-0364-4014-8EED-8E4EC0E169AC}</ProjectGuid>
<OutputType>Exe</OutputType>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TWeather2015</RootNamespace>
<AssemblyName>TWeather2015</AssemblyName>
Expand Down
17 changes: 9 additions & 8 deletions TWeather2015/Theme/DIconManager.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using TWeather2015.Core;

namespace TWeather2015.Theme
Expand Down Expand Up @@ -76,6 +69,7 @@ public void loadIcons(string[] files)
DIconPositionManager.loadPositions();
foreach (var f in files)
{
if (isFileHidden(f)) continue;
var p = DIconPositionManager.getPosition(f);
if (p.x == 0 && p.y == 0)
addNewIconToEnd(f);
Expand All @@ -89,6 +83,7 @@ public void loadIcons(string[] files)

public DIcon addNewIconToEnd(string filename)
{
if (isFileHidden(filename)) return null;
for (int i = 0; i < wcount; i++)
for (int j = 0; j < hcount; j++)
{
Expand Down Expand Up @@ -283,6 +278,7 @@ internal void addNewIcon(string fullPath)
{
this.Dispatcher.Invoke((Action)(() =>
{
if (isFileHidden(fullPath)) return;
var p = DIconPositionManager.getPosition(fullPath);
if (p.x == 0 && p.y == 0)
addNewIconToEnd(fullPath);
Expand Down Expand Up @@ -375,5 +371,10 @@ public int Compare(TKey x, TKey y)

#endregion
}

static public bool isFileHidden(string fileName)
{
return new FileInfo(fileName).Attributes.HasFlag(FileAttributes.Hidden);
}
}
}

0 comments on commit 949da3e

Please sign in to comment.