public ConsoleModeController( ProgramCore core , string[] programargs )
        {
            this.core = core;
            this.args = new List<string>( programargs );
            this.processFiles = new List<String>();

            foreach( string arg in this.args )
            {
                //this is a file, add it to the list of files to process, and enable cli mode
                if( !arg.StartsWith( "-" ) && System.IO.File.Exists( arg ) && core.CanReadFile( arg ) )
                {
                    Console.WriteLine( arg );
                    this.processFiles.Add( arg );
                    cliMode = true;
                    continue;
                }

                //check to see if the user wants to enable cli mode
                if( arg.Contains( "-c" ) )
                {
                    cliMode = true;
                    continue;
                }
            }
        }
示例#2
0
        private System.IO.FileSystemWatcher watcher; //but who watches the watchmen?

        #endregion Fields

        #region Constructors

        public DGHC_MainForm( ProgramCore mycore , string[] programargs )
        {
            InitializeComponent();

            this.core = mycore;

            foreach( string arg in programargs.ToList<string>() )
            {
                if( !arg.StartsWith( "-" ) && System.IO.File.Exists( arg ) && core.CanReadFile( arg ) )
                {
                    this.processFiles.Add( arg );
                }
            }

            imageSizeMultiplier = 4;

            //drag and drop support
            this.DragEnter += new DragEventHandler( FileDragEnter );
            this.DragDrop += new DragEventHandler( FileDragDrop );
            this.FormClosing += new FormClosingEventHandler( AboutToCloseMe );
            //quack box
            this.hatsSmallPictureBox.MouseDown += new System.Windows.Forms.MouseEventHandler( this.hatsPictureBox_Click );
            this.hatsSmallPictureBox.MouseUp += new System.Windows.Forms.MouseEventHandler( this.hatsPictureBox_ReleaseClick );

            enableWatcher = Properties.Settings.Default.AutoRefresh;

            //doesn't work for now, gotta figure out why
            if( enableWatcher )
            {
                watcher = new System.IO.FileSystemWatcher();
                watcher.Changed += new FileSystemEventHandler( OnPNGFileChanged );
            }
        }