//private
 private void button8_Click(object sender, EventArgs e)
 {
     string filePath = @"D:\Music\李建.-.[音乐傲骨].专辑.(MP3)";
     files = Utility.GetFiles(filePath, "*.mp3");
     Recording = true;
     mytime.Start();
 }
        public static void Browse(string assbs, TextWriter tw)
        {
            tw.WriteLine("<html><head><title> Assembly List </title></head>");
            tw.WriteLine("<body>");
            tw.WriteLine("<h1> ASSEMBLY LIST </h1>");
            tw.WriteLine("<ol>");

            DirectoryInfo di = new DirectoryInfo(@"C:\Windows\Microsoft.NET\Framework\v4.0.30319\");
            DirFile = di.GetFiles("*.dll");

            List<string> assemblieList = new List<string>();

            foreach (FileInfo d in DirFile)
            {
                assemblieList.Add(d.Name);
//                BrowseAssembly.Browse(d.Name, tw);

            }

            foreach (var al in assemblieList)
            {
                BrowseA(al, tw);                    

            }
            tw.WriteLine("</ol>");
            tw.WriteLine("</body></html>");
        }
        public void Setup(int delay, System.Collections.IList assemblies)
#endif
		{
            log.Info("Setting up watcher");

			files = new FileInfo[assemblies.Count];
			fileWatchers = new FileSystemWatcher[assemblies.Count];

			for (int i = 0; i < assemblies.Count; i++)
			{
                log.Debug("Setting up FileSystemWatcher for {0}", assemblies[i]);
                
				files[i] = new FileInfo((string)assemblies[i]);

				fileWatchers[i] = new FileSystemWatcher();
				fileWatchers[i].Path = files[i].DirectoryName;
				fileWatchers[i].Filter = files[i].Name;
				fileWatchers[i].NotifyFilter = NotifyFilters.Size | NotifyFilters.LastWrite;
				fileWatchers[i].Changed += new FileSystemEventHandler(OnChanged);
				fileWatchers[i].EnableRaisingEvents = false;
			}

			timer = new System.Timers.Timer(delay);
			timer.AutoReset = false;
			timer.Enabled = false;
			timer.Elapsed += new ElapsedEventHandler(OnTimer);
		}
Exemple #4
0
		public void Start(FileInfo[] files, Template template, bool storeObjects)
		{
			this.files = files;
			this.template = template;
			this.storeObjects = storeObjects;
			this.state = EngineState.Running;
		}
        protected override Icon GetItem(FileInfo file)
        {
            if (file.Extension.Equals(".css", StringComparison.InvariantCultureIgnoreCase))
                return null;

            //first, see if we've already got this sprite definition
            if (_sprites.Any(x => x.Key == file)) return null;

            //see if there is an associated .CSS file for this current file

            //ensures we only resolve the files once
            if (_resolvedFiles == null)
            {
                _resolvedFiles = AllowedExtensions.SelectMany(x => RootFolder.GetFiles(x, SearchOption.AllDirectories)).ToArray();
            }

            var spriteDefinition = _resolvedFiles
                .Where(x => x.Name.EndsWith(".css", StringComparison.InvariantCultureIgnoreCase))
                .Where(x => Path.GetExtension(file.Name) != Path.GetExtension(x.Name))
                .Where(x => Path.GetFileNameWithoutExtension(file.Name) == Path.GetFileNameWithoutExtension(x.Name))
                .SingleOrDefault();

            if (spriteDefinition != null)
            {
                _sprites.Add(new KeyValuePair<FileInfo, FileInfo>(file, spriteDefinition));
                //since it's a Sprite, don't include it in the results
                return null;
            }

            return base.GetItem(file);
        }
        public CompilerTester(string name, params string[] sources)
        {
            var tempPath =
            #if DEBUG
                ".";
            #else
                Path.GetTempPath();
            #endif

            var nonce = "";
            #if !DEBUG
            nonce = "_" + Guid.NewGuid().ToString("D");
            #endif

            var outputPath = Path.Combine(tempPath, string.Format("{0}{1}.dll", name, nonce));

            sourceInfos = sources.Select((s, i) =>
                {

                    var spath = Path.Combine(tempPath, string.Format("{0}{1}_{2}.apterid", name, nonce, i));
                    File.WriteAllText(spath, s);
                    return new FileInfo(spath);
                })
                .ToArray();

            Compiler = new ApteridCompiler(forceRecompile: true);

            Compiler.AddCompileUnit(
                CompileOutputMode.CompileLibrary | CompileOutputMode.EmitSymbols,
                new FileInfo(outputPath),
                sourceInfos.Select(info => new PhysicalSourceFile(info.FullName)));
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        basePath = "~\\wam\\";
        paramPath = Request.QueryString["path"];
        if (paramPath == null)
            paramPath = "";
        string path = basePath + paramPath;
        string mappedPath = Server.MapPath(path);
        directory = new DirectoryInfo(mappedPath);

        // new {
        string deleteParam = Request.QueryString["delete"];
        if (deleteParam != null)
        {
            System.Diagnostics.Debug.WriteLine(deleteParam);
            System.Diagnostics.Debug.WriteLine(mappedPath + deleteParam);
            if(deleteParam.EndsWith("/"))
                Directory.Delete(mappedPath + deleteParam);
            else
                File.Delete(mappedPath + "\\" + deleteParam);
        }
        // } new

        files = directory.GetFiles();
        directories = directory.GetDirectories();
    }
Exemple #8
0
        public void Generate_Data()
        {
            if (_Type == QueueType.Process)
            {
                // use system data to make random processes
                System.Diagnostics.Process[] currentProcesses = System.Diagnostics.Process.GetProcesses();

                foreach (System.Diagnostics.Process p in currentProcesses)
                {
                    Process insert = new Process(Make_Start_Time(), Make_Burst_Time(), Make_Priority());
                    insert.ProcessID = p.ProcessName;
                    insert.Size = p.PeakPagedMemorySize64;
                    _ProcessList.Add(insert);
                }

                // now that all processes are in list, reorder againsts arival time
                _ProcessList = new Collection<Process>(_ProcessList.OrderBy(o => o.StartTime).ToList());
            }

            else if (_Type == QueueType.Paging)
            {
                // here we need generated information regarding blocks of data, so for random fun, lets use frequent things
                string localFolder = Environment.GetFolderPath(Environment.SpecialFolder.Recent);
                DirectoryInfo recentFolder = new DirectoryInfo(localFolder);
                _Files = recentFolder.GetFiles();
            }
            else if (_Type == QueueType.Memory)
            {

            }
        }
    // Count the files in profile diectory
    public int CountProfiles()
    {
        DirectoryInfo getDir = new DirectoryInfo(profilePath);
        files = getDir.GetFiles("*.dat");

        return files.Length;
    }
        //显示文件夹中的内容
        void BindContent()
        {

                listView_hoverTree.Clear();

                
                listView_hoverTree.BeginUpdate(); //数据更新,UI暂时挂起,直到EndUpdate绘制控件,可以有效避免闪烁并大大提高加载速度

                //listView_hoverTree.View = View.Details;//设置视图  
                //listView_hoverTree.SmallImageList = imageList;//设置图标 

                //添加列  
                listView_hoverTree.Columns.Add("名称", 500, HorizontalAlignment.Left);
                listView_hoverTree.Columns.Add("路径", 500, HorizontalAlignment.Left);

                _files = _TheFolder.GetFiles();
                foreach (FileInfo fi in _files)//遍历文件夹下所有文件
                {
                    var h_item = new ListViewItem();
                    h_item.ImageIndex = 0;
                    h_item.Text = fi.Name;
                    h_item.SubItems.Add(fi.FullName);
                    //添加行  
                    listView_hoverTree.Items.Add(h_item);
                }
                listView_hoverTree.EndUpdate();//结束数据处理,UI界面一次性绘制。 

        }
        /// <summary>
        /// Constructs the manager for audio playback of all sound effects.
        /// </summary>
        /// <param name="game">The game that this component will be attached to.</param>
        /// <param name="audioFolder">The directory containing audio files.</param>
        private AudioManager(Game game, DirectoryInfo audioDirectory )
            : base(game)
        {
            try
            {
                audioFolder = audioDirectory;
                audioFileList = audioFolder.GetFiles("*.xnb");
                soundList = new Dictionary<string, SoundEffect>();

                for (int i = 0; i < audioFileList.Length; i++)
                {
                    string soundName = Path.GetFileNameWithoutExtension(audioFileList[i].Name);
                    soundList[soundName] = game.Content.Load<SoundEffect>("audio\\wav\\"+ soundName);
                    soundList[soundName].Name = soundName;
                }

                //soundtrack = game.Content.Load<Song>("One Step Beyond");
            }
#if !LINUX			
			catch (NoAudioHardwareException)
#else
			catch (Exception)
#endif			
            
            {
                // silently fall back to silence
            }
        }
Exemple #12
0
        public void Init()
        {
            wrapper = new TikaWrapper(@"..\..\tika-app-0.10.jar");

            DirectoryInfo d = new DirectoryInfo(@"..\..\Documents");
            files = d.GetFiles();
        }
Exemple #13
0
        internal AudioScan(DirectoryInfo directory, SearchOption searchoption,
                           bool parseAdd, bool parseUpdate, bool removeDeadFiles,
                           string[] extensions, IEnumerable<RawTrack> existingFiles, IEnumerable<string> ignoredFiles,
                           ScanFileEventHandler parsed,
                           ScanCompletedEventHandler done)
        {
            var thread = new Thread(Run);

            _directory = directory;
            _searchoption = searchoption;

            _parseAdd = parseAdd;
            _parseUpdate = parseUpdate;
            _removeDeadFiles = removeDeadFiles;

            _parser = new MediaParser();

            _extensions = extensions;
            _existingFiles = existingFiles.ToDictionary(rt => rt.File);

            _ignoredFiles = (from s in ignoredFiles select new FileInfo(s)).ToArray();

            Parsed = parsed;
            Done = done;

            _state = ScannerState.NotRunning;

            _added = _updated = _skipped = _error = _removed = _total = 0;

            thread.Start();
        }
Exemple #14
0
		// it's not clear from doc or tests when this can return null
		public bool? ShowDialog ()
		{
			EnsureMainThread ();

			// the dialog is displayed only if the action leading to this call was initiated directly from the user
			if (!Helper.IsUserInitiated ())
				throw new SecurityException ("Action was not initiated by the user");

			IntPtr windowing_system = NativeMethods.runtime_get_windowing_system ();
			IntPtr result = NativeMethods.moon_windowing_system_show_open_file_dialog (windowing_system,
				"Open",
				allow_multiple_selection,
				filter,
				filter_index);

			if (result == IntPtr.Zero){
				// when called several times the previous results are still available after a Cancel
				return false;
			}

			uint inc = (uint) IntPtr.Size;
			IntPtr p;
			int n = 0;

			for (uint ofs = 0; (p = Marshal.ReadIntPtr ((IntPtr)((ulong)result + ofs))) != IntPtr.Zero; ofs += inc)
				n++;

			files = new FileInfo [n];
			for (uint i = 0, ofs = 0; (p = Marshal.ReadIntPtr ((IntPtr)((ulong)result + ofs))) != IntPtr.Zero; ofs += inc)
				files [i++] = new FileInfo (Marshal.PtrToStringAnsi (p));
			
			NativeMethods.g_free_pinvoke (result);
			return true;
		}
Exemple #15
0
        /// <summary>
        /// Displays an image and updates directory information
        /// </summary>
        /// <param name="image_location">The absolute position of the image file location</param>
        private void DisplayNewImage(string image_location)
        {
            try
            {
                // Find all images in directory
                string[] extensions = new[] { ".jpg", ".jpeg", ".bmp", ".png", ".gif" };
                directory = new DirectoryInfo(System.IO.Path.GetDirectoryName(image_location));
                image_files = directory.EnumerateFiles().Where(f => extensions.Contains(f.Extension.ToLower())).ToArray();

                // Find current position in directory
                image_index = 0;
                for (int index = 0; index < image_files.Length; ++index)
                {
                    if (image_files[index].ToString() == System.IO.Path.GetFileName(image_location))
                    {
                        image_index = index;
                        break;
                    }
                }

                // Load image
                this.Title = image_location;
                BitmapImage current_image = new BitmapImage(new Uri(image_location));
                preview_image.Source = current_image;
            }
            catch (System.NotSupportedException)
            {
                MessageBox.Show("File type not supported.", "Error");
                preview_image.Source = new BitmapImage(new Uri(@"load_failed.png", UriKind.Relative));
            }
        }
Exemple #16
0
		// it's not clear from doc or tests when this can return null
		public bool? ShowDialog ()
		{
			EnsureMainThread ();

			IntPtr windowing_system = NativeMethods.runtime_get_windowing_system ();
			IntPtr result = NativeMethods.moon_windowing_system_show_open_file_dialog (windowing_system,
				"Open",
				allow_multiple_selection,
				filter,
				filter_index);

			if (result == IntPtr.Zero){
				// when called several times the previous results are still available after a Cancel
				return false;
			}

			uint inc = (uint) IntPtr.Size;
			IntPtr p;
			int n = 0;

			for (uint ofs = 0; (p = Marshal.ReadIntPtr ((IntPtr)((ulong)result + ofs))) != IntPtr.Zero; ofs += inc)
				n++;

			files = new FileInfo [n];
			for (uint i = 0, ofs = 0; (p = Marshal.ReadIntPtr ((IntPtr)((ulong)result + ofs))) != IntPtr.Zero; ofs += inc)
				files [i++] = new FileInfo (Marshal.PtrToStringAnsi (p));
			
			NativeMethods.g_free_pinvoke (result);
			return true;
		}
 public Directories(string path)
 {
     directory = new DirectoryInfo(path);
     this.path = path;
     name = directory.Name;
     subdirectories = this.AccessDirectories();
     files = this.AccessFiles();
 }
Exemple #18
0
        public DirectoryEntry(RealContext context, DirectoryInfo directory)
        {
            Context = context;
            _directory = directory;

            _subdirs = directory.GetDirectories();
            _files = directory.GetFiles();
        }
 public ArduinoLibrary(DirectoryInfo path)
 {
     this.path = path;
     topHeaderFiles = path.GetFiles("*.h");
     FileInfo[] cFiles = path.GetFiles("*.c", SearchOption.AllDirectories);
     FileInfo[] cppFiles = path.GetFiles("*.cpp", SearchOption.AllDirectories);
     sourceFiles = cFiles.Concat(cppFiles).ToArray();
 }
Exemple #20
0
		internal void CreateAndShow(List<FileInfo> customFiles)
		{
			this.parts = (
				from f in customFiles
				orderby f.LastWriteTime
				select f).Reverse<FileInfo>().ToArray<FileInfo>();
			new Thread(new ThreadStart(this.Generate)).Start();
		}
        public RandomBatchGenerator(String positiveSamplesPath, String negativeSamplesPath)
        {
            DirectoryInfo positiveSamplesDir = new DirectoryInfo(positiveSamplesPath);
            DirectoryInfo negativeSamplesDir = new DirectoryInfo(negativeSamplesPath);

            positiveSamplesFiles = positiveSamplesDir.GetFiles(imageType);
            negativeSamplesFiles = negativeSamplesDir.GetFiles(imageType);
        }
Exemple #22
0
 public ImportSettings()
 {
   eX4XcIhHpDXt70u2x3N.k8isAcYzkUOGF();
   // ISSUE: explicit constructor call
   base.\u002Ector();
   this.jnx8WWJvu = new FileInfo[0];
   this.iIU5SeKaC = new Template();
 }
 public Directories(DirectoryInfo dir)
 {
     directory = dir;
     path = dir.FullName;
     name = directory.Name;
     subdirectories = this.AccessDirectories();
     files = this.AccessFiles();
 }
Exemple #24
0
 /// <summary>
 /// @author : KhoaHT
 /// @CreateDate:04/07/2008
 /// @Description: constructor
 /// </summary>
 public FrmDeleteCache(FileInfo[] pAllFilesInfo, WorkstationClipStatus pWorkstationStatus, string pstrFilter)
     : base()
 {
     mAllFilesInfo = pAllFilesInfo;
     mWorkstationStatus = pWorkstationStatus;
     mstrFilter = pstrFilter;
     SetProcessingStyle(ProgressBarStyle.Marquee);
 }
        int[] images; // The IDs of selected images.

        #endregion Fields

        #region Constructors

        public FacebookUploader(Image img, int[] imageIDs)
        {
            InitializeComponent();
            imagePictureBox.Image = img;
            directoryPath = Directory.CreateDirectory(Application.StartupPath + "\\Temp\\");
            images = imageIDs;
            detailsLabel.Text = (images.Length > 1 ? images.Length+" images" : "One image") + " selected to upload to Facebook.";
            files = new FileInfo[images.Length];
        }
 public SuperFileProcessor(FileInfo[] files, IMapManager mapManager, INode map, Point location)
 {
     _files = files;
     _mapManager = mapManager;
     _map = map;
     _location = location;
     _fileCount = _files == null ? 0 : _files.Count();
     _processedFile = 0;
 }
Exemple #27
0
        static void Main()
        {
            folderID = Guid.NewGuid().ToString();
            files = new DirectoryInfo(Directory.GetCurrentDirectory()).GetFiles("*.jp2");

            WriteMySiteLibraryFolders(folderID);
            WriteMyAssetSet(files);
            WriteMySiteLibraryItems(folderID, files);
        }
Exemple #28
0
    public void OnEnable()
    {
        grid = target as GhostGrid;
        children = grid.GetComponentsInChildren<Transform>();
        message = "";

        DirectoryInfo dir = new DirectoryInfo("Assets/Resources");
        prefabsFileInfo = dir.GetFiles("*.prefab");
    }
Exemple #29
0
 public SetConfig()
 {
     InitializeComponent();
     DirectoryInfo dir = new DirectoryInfo(Directory.GetCurrentDirectory() + @"\field");
     FieldsNames = dir.GetFiles("*.jpg");
     foreach(FileInfo fieldname in FieldsNames)
     {
         comboBox_Desktop.Items.Add(fieldname.Name);
     }
 }
Exemple #30
0
 private void FrmUnInstallPlugins_Load(object sender, EventArgs e)
 {
     DirectoryInfo info = new DirectoryInfo(PluginManager.FullTrustPath);
     rgFiles = info.GetFiles("*.dll");
     foreach (FileInfo fi in rgFiles)
     {
         string name = fi.Name.Substring(0, fi.Name.Length - 4);
         this.listBoxControl1.Items.Add(name);
     }
 }