Changeset 2761
- Timestamp:
- 7/2/2012 7:38:10 AM (12 months ago)
- Location:
- branches/eraser6/EraserService
- Files:
-
- 3 edited
-
Eraser.Service/Eraser.Service.csproj (modified) (3 diffs)
-
Eraser.Service/Program.cs (modified) (3 diffs)
-
Eraser/Program.cs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/EraserService/Eraser.Service/Eraser.Service.csproj
r2743 r2761 7 7 <SchemaVersion>2.0</SchemaVersion> 8 8 <ProjectGuid>{62840616-03D1-45E8-A29B-A8EDF883A32E}</ProjectGuid> 9 <OutputType> Exe</OutputType>9 <OutputType>WinExe</OutputType> 10 10 <AppDesignerFolder>Properties</AppDesignerFolder> 11 11 <RootNamespace>Eraser.Service</RootNamespace> … … 15 15 </TargetFrameworkProfile> 16 16 <FileAlignment>512</FileAlignment> 17 <SignAssembly>true</SignAssembly>17 <SignAssembly>true</SignAssembly> 18 18 <AssemblyOriginatorKeyFile>..\Strong Name.snk</AssemblyOriginatorKeyFile> 19 19 </PropertyGroup> … … 69 69 <CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules> 70 70 </PropertyGroup> 71 <PropertyGroup> 72 <StartupObject /> 73 </PropertyGroup> 71 74 <ItemGroup> 75 <Reference Include="CommonLibrary, Version=0.9.7.4, Culture=neutral, PublicKeyToken=3ac89a0351e689b6, processorArchitecture=MSIL"> 76 <HintPath>..\Dependencies\CommonLibrary.dll</HintPath> 77 </Reference> 72 78 <Reference Include="System" /> 73 79 <Reference Include="System.Core" /> 80 <Reference Include="System.Windows.Forms" /> 74 81 <Reference Include="System.Xml.Linq" /> 75 82 <Reference Include="System.Data.DataSetExtensions" /> 76 <Reference Include="Microsoft.CSharp" />77 83 <Reference Include="System.Data" /> 78 84 <Reference Include="System.Xml" /> -
branches/eraser6/EraserService/Eraser.Service/Program.cs
r2754 r2761 27 27 using System.IO; 28 28 29 using ComLib.Arguments; 30 29 31 using Eraser.Manager; 30 32 using Eraser.Plugins; 33 using System.Windows.Forms; 31 34 32 35 namespace Eraser.Service 33 36 { 37 /// <summary> 38 /// Program arguments which only apply to the Eraser Service. 39 /// </summary> 40 class ServiceArguments 41 { 42 /// <summary> 43 /// True if the command line specified atRestart, which should result in the 44 /// queueing of tasks meant for running at restart. 45 /// </summary> 46 [Arg("atRestart", "r", "The program should queue all tasks scheduled for " + 47 "running at the system restart.", typeof(bool), false, false)] 48 public bool AtRestart { get; set; } 49 } 50 34 51 public class Program 35 52 { 36 53 static void Main(string[] args) 37 54 { 55 //Parse the command line arguments 56 ServiceArguments arguments = new ServiceArguments(); 57 Args.Parse(args, CommandLinePrefixes, CommandLineSeparators, arguments); 58 38 59 using (ManagerLibrary library = new ManagerLibrary(Settings.Get())) 39 60 { … … 68 89 } 69 90 91 //Queue tasks meant for running at restart if we are given that command line. 92 if (arguments.AtRestart) 93 eraserClient.QueueRestartTasks(); 94 70 95 //Run the eraser client. 71 96 eraserClient.Run(); 72 73 Console.ReadKey(); 97 Application.Run(); 74 98 75 99 //Save the task list … … 106 130 /// </summary> 107 131 public const string SettingsPath = @"SOFTWARE\Eraser\Eraser 6"; 132 133 /// <summary> 134 /// The acceptable list of command line prefixes we will accept. 135 /// </summary> 136 public const string CommandLinePrefixes = "^(/|-|--)"; 137 138 /// <summary> 139 /// The acceptable list of command line separators we will accept. 140 /// </summary> 141 public const string CommandLineSeparators = "(:|=)"; 108 142 } 109 143 } -
branches/eraser6/EraserService/Eraser/Program.cs
r2753 r2761 62 62 } 63 63 64 /// <summary>65 /// Program arguments which only apply to the GUI program.66 /// </summary>67 class GuiArguments : Arguments68 {69 /// <summary>70 /// True if the command line specified atRestart, which should result in the71 /// queueing of tasks meant for running at restart.72 /// </summary>73 [Arg("atRestart", "r", "The program should queue all tasks scheduled for " +74 "running at the system restart.", typeof(bool), false, false)]75 public bool AtRestart { get; set; }76 }77 78 64 class ConsoleArguments : Arguments 79 65 { … … 679 665 680 666 //Decide whether to display any UI. 681 GuiArguments arguments = new GuiArguments();667 Arguments arguments = new Arguments(); 682 668 Args.Parse(program.CommandLine, CommandLinePrefixes, CommandLineSeparators, arguments); 683 e.ShowMainForm = !arguments.AtRestart && !arguments.Quiet; 684 685 //Queue tasks meant for running at restart if we are given that command line. 686 if (arguments.AtRestart) 687 eraserClient.QueueRestartTasks(); 669 e.ShowMainForm = !arguments.Quiet; 688 670 689 671 //Run the eraser client. … … 731 713 /// The acceptable list of command line prefixes we will accept. 732 714 /// </summary> 733 public const string CommandLinePrefixes = "^(/|-|--)"; 715 [Obsolete] 716 public const string CommandLinePrefixes = Service.Program.CommandLinePrefixes; 734 717 735 718 /// <summary> 736 719 /// The acceptable list of command line separators we will accept. 737 720 /// </summary> 738 public const string CommandLineSeparators = "(:|=)"; 721 [Obsolete] 722 public const string CommandLineSeparators = Service.Program.CommandLineSeparators; 739 723 740 724 /// <summary>
Note: See TracChangeset
for help on using the changeset viewer.
