Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Initial checkin

  • Loading branch information...
commit 8bf78ea7b91623e180bb7a47ac168dfa2840ae44 0 parents
dharmatech authored
22 .gitattributes
... ... @@ -0,0 +1,22 @@
  1 +# Auto detect text files and perform LF normalization
  2 +* text=auto
  3 +
  4 +# Custom for Visual Studio
  5 +*.cs diff=csharp
  6 +*.sln merge=union
  7 +*.csproj merge=union
  8 +*.vbproj merge=union
  9 +*.fsproj merge=union
  10 +*.dbproj merge=union
  11 +
  12 +# Standard to msysgit
  13 +*.doc diff=astextplain
  14 +*.DOC diff=astextplain
  15 +*.docx diff=astextplain
  16 +*.DOCX diff=astextplain
  17 +*.dot diff=astextplain
  18 +*.DOT diff=astextplain
  19 +*.pdf diff=astextplain
  20 +*.PDF diff=astextplain
  21 +*.rtf diff=astextplain
  22 +*.RTF diff=astextplain
163 .gitignore
... ... @@ -0,0 +1,163 @@
  1 +#################
  2 +## Eclipse
  3 +#################
  4 +
  5 +*.pydevproject
  6 +.project
  7 +.metadata
  8 +bin/
  9 +tmp/
  10 +*.tmp
  11 +*.bak
  12 +*.swp
  13 +*~.nib
  14 +local.properties
  15 +.classpath
  16 +.settings/
  17 +.loadpath
  18 +
  19 +# External tool builders
  20 +.externalToolBuilders/
  21 +
  22 +# Locally stored "Eclipse launch configurations"
  23 +*.launch
  24 +
  25 +# CDT-specific
  26 +.cproject
  27 +
  28 +# PDT-specific
  29 +.buildpath
  30 +
  31 +
  32 +#################
  33 +## Visual Studio
  34 +#################
  35 +
  36 +## Ignore Visual Studio temporary files, build results, and
  37 +## files generated by popular Visual Studio add-ons.
  38 +
  39 +# User-specific files
  40 +*.suo
  41 +*.user
  42 +*.sln.docstates
  43 +
  44 +# Build results
  45 +[Dd]ebug/
  46 +[Rr]elease/
  47 +*_i.c
  48 +*_p.c
  49 +*.ilk
  50 +*.meta
  51 +*.obj
  52 +*.pch
  53 +*.pdb
  54 +*.pgc
  55 +*.pgd
  56 +*.rsp
  57 +*.sbr
  58 +*.tlb
  59 +*.tli
  60 +*.tlh
  61 +*.tmp
  62 +*.vspscc
  63 +.builds
  64 +*.dotCover
  65 +
  66 +## TODO: If you have NuGet Package Restore enabled, uncomment this
  67 +#packages/
  68 +
  69 +# Visual C++ cache files
  70 +ipch/
  71 +*.aps
  72 +*.ncb
  73 +*.opensdf
  74 +*.sdf
  75 +
  76 +# Visual Studio profiler
  77 +*.psess
  78 +*.vsp
  79 +
  80 +# ReSharper is a .NET coding add-in
  81 +_ReSharper*
  82 +
  83 +# Installshield output folder
  84 +[Ee]xpress
  85 +
  86 +# DocProject is a documentation generator add-in
  87 +DocProject/buildhelp/
  88 +DocProject/Help/*.HxT
  89 +DocProject/Help/*.HxC
  90 +DocProject/Help/*.hhc
  91 +DocProject/Help/*.hhk
  92 +DocProject/Help/*.hhp
  93 +DocProject/Help/Html2
  94 +DocProject/Help/html
  95 +
  96 +# Click-Once directory
  97 +publish
  98 +
  99 +# Others
  100 +[Bb]in
  101 +[Oo]bj
  102 +sql
  103 +TestResults
  104 +*.Cache
  105 +ClientBin
  106 +stylecop.*
  107 +~$*
  108 +*.dbmdl
  109 +Generated_Code #added for RIA/Silverlight projects
  110 +
  111 +# Backup & report files from converting an old project file to a newer
  112 +# Visual Studio version. Backup files are not needed, because we have git ;-)
  113 +_UpgradeReport_Files/
  114 +Backup*/
  115 +UpgradeLog*.XML
  116 +
  117 +
  118 +
  119 +############
  120 +## Windows
  121 +############
  122 +
  123 +# Windows image file caches
  124 +Thumbs.db
  125 +
  126 +# Folder config file
  127 +Desktop.ini
  128 +
  129 +
  130 +#############
  131 +## Python
  132 +#############
  133 +
  134 +*.py[co]
  135 +
  136 +# Packages
  137 +*.egg
  138 +*.egg-info
  139 +dist
  140 +build
  141 +eggs
  142 +parts
  143 +bin
  144 +var
  145 +sdist
  146 +develop-eggs
  147 +.installed.cfg
  148 +
  149 +# Installer logs
  150 +pip-log.txt
  151 +
  152 +# Unit test / coverage reports
  153 +.coverage
  154 +.tox
  155 +
  156 +#Translations
  157 +*.mo
  158 +
  159 +#Mr Developer
  160 +.mr.developer.cfg
  161 +
  162 +# Mac crap
  163 +.DS_Store
20 MyDocumentsWatcher.sln
... ... @@ -0,0 +1,20 @@
  1 +
  2 +Microsoft Visual Studio Solution File, Format Version 11.00
  3 +# Visual C# Express 2010
  4 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyDocumentsWatcher", "MyDocumentsWatcher\MyDocumentsWatcher.csproj", "{538E217C-B970-423F-9A04-22E2D5942592}"
  5 +EndProject
  6 +Global
  7 + GlobalSection(SolutionConfigurationPlatforms) = preSolution
  8 + Debug|x86 = Debug|x86
  9 + Release|x86 = Release|x86
  10 + EndGlobalSection
  11 + GlobalSection(ProjectConfigurationPlatforms) = postSolution
  12 + {538E217C-B970-423F-9A04-22E2D5942592}.Debug|x86.ActiveCfg = Debug|x86
  13 + {538E217C-B970-423F-9A04-22E2D5942592}.Debug|x86.Build.0 = Debug|x86
  14 + {538E217C-B970-423F-9A04-22E2D5942592}.Release|x86.ActiveCfg = Release|x86
  15 + {538E217C-B970-423F-9A04-22E2D5942592}.Release|x86.Build.0 = Release|x86
  16 + EndGlobalSection
  17 + GlobalSection(SolutionProperties) = preSolution
  18 + HideSolutionNode = FALSE
  19 + EndGlobalSection
  20 +EndGlobal
57 MyDocumentsWatcher/MyDocumentsWatcher.csproj
... ... @@ -0,0 +1,57 @@
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  3 + <PropertyGroup>
  4 + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
  5 + <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
  6 + <ProductVersion>8.0.30703</ProductVersion>
  7 + <SchemaVersion>2.0</SchemaVersion>
  8 + <ProjectGuid>{538E217C-B970-423F-9A04-22E2D5942592}</ProjectGuid>
  9 + <OutputType>Exe</OutputType>
  10 + <AppDesignerFolder>Properties</AppDesignerFolder>
  11 + <RootNamespace>MyDocumentsWatcher</RootNamespace>
  12 + <AssemblyName>MyDocumentsWatcher</AssemblyName>
  13 + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
  14 + <TargetFrameworkProfile>Client</TargetFrameworkProfile>
  15 + <FileAlignment>512</FileAlignment>
  16 + </PropertyGroup>
  17 + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
  18 + <PlatformTarget>x86</PlatformTarget>
  19 + <DebugSymbols>true</DebugSymbols>
  20 + <DebugType>full</DebugType>
  21 + <Optimize>false</Optimize>
  22 + <OutputPath>bin\Debug\</OutputPath>
  23 + <DefineConstants>DEBUG;TRACE</DefineConstants>
  24 + <ErrorReport>prompt</ErrorReport>
  25 + <WarningLevel>4</WarningLevel>
  26 + </PropertyGroup>
  27 + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
  28 + <PlatformTarget>x86</PlatformTarget>
  29 + <DebugType>pdbonly</DebugType>
  30 + <Optimize>true</Optimize>
  31 + <OutputPath>bin\Release\</OutputPath>
  32 + <DefineConstants>TRACE</DefineConstants>
  33 + <ErrorReport>prompt</ErrorReport>
  34 + <WarningLevel>4</WarningLevel>
  35 + </PropertyGroup>
  36 + <ItemGroup>
  37 + <Reference Include="System" />
  38 + <Reference Include="System.Core" />
  39 + <Reference Include="System.Xml.Linq" />
  40 + <Reference Include="System.Data.DataSetExtensions" />
  41 + <Reference Include="Microsoft.CSharp" />
  42 + <Reference Include="System.Data" />
  43 + <Reference Include="System.Xml" />
  44 + </ItemGroup>
  45 + <ItemGroup>
  46 + <Compile Include="Program.cs" />
  47 + <Compile Include="Properties\AssemblyInfo.cs" />
  48 + </ItemGroup>
  49 + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
  50 + <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
  51 + Other similar extension points exist, see Microsoft.Common.targets.
  52 + <Target Name="BeforeBuild">
  53 + </Target>
  54 + <Target Name="AfterBuild">
  55 + </Target>
  56 + -->
  57 +</Project>
45 MyDocumentsWatcher/Program.cs
... ... @@ -0,0 +1,45 @@
  1 +using System;
  2 +using System.IO;
  3 +
  4 +namespace MyDocumentsWatcher
  5 +{
  6 + class Program
  7 + {
  8 + static void Main(string[] args)
  9 + {
  10 + var random = new Random();
  11 +
  12 + var watcher =
  13 + new FileSystemWatcher()
  14 + {
  15 + Path = @"C:\Users\dharmatech\Documents",
  16 + Filter = "*.cs",
  17 + NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName,
  18 + IncludeSubdirectories = true,
  19 + EnableRaisingEvents = true
  20 + };
  21 +
  22 + watcher.Changed += (s, e) =>
  23 + {
  24 + Console.WriteLine("{0} {1}", e.ChangeType, e.Name);
  25 +
  26 + var path = e.FullPath;
  27 +
  28 + while (true)
  29 + {
  30 + if (Path.GetDirectoryName(path) == @"C:\Users\dharmatech\Documents")
  31 + {
  32 + var tmp = Path.Combine(path, random.Next().ToString());
  33 + using (File.Create(tmp)) { }
  34 + File.Delete(tmp);
  35 + break;
  36 + }
  37 + else
  38 + path = Path.GetDirectoryName(path);
  39 + }
  40 + };
  41 +
  42 + Console.ReadLine();
  43 + }
  44 + }
  45 +}
36 MyDocumentsWatcher/Properties/AssemblyInfo.cs
... ... @@ -0,0 +1,36 @@
  1 +using System.Reflection;
  2 +using System.Runtime.CompilerServices;
  3 +using System.Runtime.InteropServices;
  4 +
  5 +// General Information about an assembly is controlled through the following
  6 +// set of attributes. Change these attribute values to modify the information
  7 +// associated with an assembly.
  8 +[assembly: AssemblyTitle("MyDocumentsWatcher")]
  9 +[assembly: AssemblyDescription("")]
  10 +[assembly: AssemblyConfiguration("")]
  11 +[assembly: AssemblyCompany("")]
  12 +[assembly: AssemblyProduct("MyDocumentsWatcher")]
  13 +[assembly: AssemblyCopyright("Copyright © 2012")]
  14 +[assembly: AssemblyTrademark("")]
  15 +[assembly: AssemblyCulture("")]
  16 +
  17 +// Setting ComVisible to false makes the types in this assembly not visible
  18 +// to COM components. If you need to access a type in this assembly from
  19 +// COM, set the ComVisible attribute to true on that type.
  20 +[assembly: ComVisible(false)]
  21 +
  22 +// The following GUID is for the ID of the typelib if this project is exposed to COM
  23 +[assembly: Guid("c9218709-6eda-47c8-a731-1c3d6d3e98df")]
  24 +
  25 +// Version information for an assembly consists of the following four values:
  26 +//
  27 +// Major Version
  28 +// Minor Version
  29 +// Build Number
  30 +// Revision
  31 +//
  32 +// You can specify all the values or you can default the Build and Revision Numbers
  33 +// by using the '*' as shown below:
  34 +// [assembly: AssemblyVersion("1.0.*")]
  35 +[assembly: AssemblyVersion("1.0.0.0")]
  36 +[assembly: AssemblyFileVersion("1.0.0.0")]
4 MyDocumentsWatcher/README.md
Source Rendered
... ... @@ -0,0 +1,4 @@
  1 +
  2 +I keep most of my Visual C# solution directories in my `Documents` folder. In my file browser, I like sorting by modified time in descending order so that I can see what I've worked on recently. Unfortunately, when I update a C# code file in a solution, this doesn't trigger an update of the solution directory's modified time and so the directory doesn't get moved to the top of the list in my file browser...
  3 +
  4 +This little utility program watches my `Documents` folder for any C# code file changes. It touches the corresponding solution folder so that it's modified time is also updated.

0 comments on commit 8bf78ea

Please sign in to comment.
Something went wrong with that request. Please try again.