Exemple #1
0
        internal static void CacheLocalDirectories(LocalDirectory local, PatchHandler handler)
        {
            try
            {
                for (int i = 0; i < local.FileIndex.Count; i++)
                {
                    string name = local.FileIndex[i].
                                  FullName.Substring(local.DirectoryPath.Length);

                    if (!LocalCache.ContainsKey(name.Replace("\\", string.Empty)))
                    {
                        LocalCache.Add
                            (name.Replace("\\", string.Empty), local.FileIndex[i].Length);
                    }

                    handler.UI.UpdatePatchNotes
                        (string.Format("Caching Local Bytes: [{1}] {0}",
                                       name.Replace("\\", string.Empty), local.FileIndex[i].Length));

                    handler.UI.UpdateProgressBar();
                }

                for (int n = 0; n < local.subDirectories.Count; n++)
                {
                    CacheLocalDirectories(local.subDirectories[n], handler);
                }
            }

            catch (Exception e)
            {
                LogHandler.LogErrors(e.ToString(), handler);
            }
        }
Exemple #2
0
        /// <summary>
        /// Generates new local directory object based on path of the .exe
        /// </summary>
        private void QueryLocalDirectory()
        {
            try
            {
                string localPath = m_DestinationFolder;
                localDirectory = new LocalDirectory(localPath, this);
            }

            catch (Exception e) { LogHandler.LogErrors(e.ToString(), this); }
        }
Exemple #3
0
        private static void ParseLocalDirectory
            (LocalDirectory directory, PatchHandler handler, XmlTextWriter xml)
        {
            IterateFileSizeIndex
                (directory.FileIndex, directory.DirectoryPath, xml);

            for (int i = 0; i < directory.subDirectories.Count; i++)
            {
                ParseLocalDirectory(directory.subDirectories[i], handler, xml);
            }
        }