コード例 #1
0
 private void _openGrfs(IEnumerable <TkPath> paths, GrfHolder extraGrf)
 {
     try {
         foreach (TkPath resource in paths)
         {
             if ((!String.IsNullOrEmpty(resource.FilePath)) && File.Exists(resource.FilePath))
             {
                 if (!_openedGrfs.ContainsKey(resource.FilePath))
                 {
                     GrfHolder grf = new GrfHolder();
                     grf.Open(resource.FilePath);
                     _openedGrfs.Add(resource.FilePath, grf);
                 }
             }
             else if (resource.FilePath.StartsWith("Currently opened GRF : "))
             {
                 if (!_openedGrfs.ContainsKey(extraGrf.FileName))
                 {
                     //extraGrf.FileTable.HasBeenChanged += new FileTable.FileTableEventHandler(_fileTable_HasBeenChanged);
                     _openedGrfs.Add(extraGrf.FileName, extraGrf);
                 }
             }
         }
     }
     catch (Exception err) {
         ErrorHandler.HandleException(err);
     }
 }
コード例 #2
0
 private void _validateOpened()
 {
     if (!_grf.IsOpened)
     {
         _grf.Open(_grfPath, GrfLoadOptions.OpenOrNew);
     }
 }
コード例 #3
0
		private void _openGrfs(IEnumerable<TkPath> paths, GrfHolder extraGrf) {
			try {
				foreach (TkPath resource in paths) {
					if ((!String.IsNullOrEmpty(resource.FilePath)) && File.Exists(resource.FilePath)) {
						if (!_openedGrfs.ContainsKey(resource.FilePath)) {
							GrfHolder grf = new GrfHolder();
							grf.Open(resource.FilePath);
							_openedGrfs.Add(resource.FilePath, grf);
						}
					}
					else if (resource.FilePath.StartsWith("Currently opened GRF : ")) {
						if (!_openedGrfs.ContainsKey(extraGrf.FileName)) {
							//extraGrf.FileTable.HasBeenChanged += new FileTable.FileTableEventHandler(_fileTable_HasBeenChanged);
							_openedGrfs.Add(extraGrf.FileName, extraGrf);
						}
					}
				}
			}
			catch (Exception err) {
				ErrorHandler.HandleException(err);
			}
		}