Ejemplo n.º 1
0
        void OnTagInstanceExtract(object sender, EventArgs e)
        {
            if (Program.WorkInProgress(this))
            {
                return;
            }

            string path = null;

            if (sender != MenuTagInstanceExtractAs &&             // this has its own dialog for saving
                !OnTagInstanceExtractAskForPath(out path))
            {
                return;
            }

            BlamLib.Blam.CacheIndex.Item tag_instance;
            {
                var sel_node = TagTreeView.SelectedNode;
                if (sel_node == null)
                {
                    return;
                }

                tag_instance = sel_node.Tag as BlamLib.Blam.CacheIndex.Item;
            };

            var tiei = new TagInstanceExtractionInfo();

            if (sender == MenuTagInstanceExtractFolder)
            {
                tiei.InitializeStateForTagInstance(tag_instance, path, null);
                tiei.InitializeExtractionForTagInstance();

                bgwTagExtract.RunWorkerAsync(tiei);
            }
            else if (sender == MenuTagInstanceExtractFolderAll)
            {
//				tiei.InitializeStateForTagHierarchy(
//					GetTagInstanceExtractionArguments(path, true), tag_instance);
//				tiei.InitializeExtractionForTagInstance();

                bgwTagExtract.RunWorkerAsync(tiei);
            }
            else if (sender == MenuTagInstanceExtractAs)
            {
                OnTagInstanceExtractAs(tag_instance);
            }
        }
Ejemplo n.º 2
0
        void OnTagInstanceExtractAs(BlamLib.Blam.CacheIndex.Item tag_instance)
        {
            SaveFileDlg.Filter = tag_instance.GroupTag.Filter;
            if (SaveFileDlg.ShowDialog(this) == DialogResult.OK)
            {
                string path = SaveFileDlg.FileName;
                var    tiei = new TagInstanceExtractionInfo();

                tiei.InitializeStateForTagInstance(tag_instance,
                                                   System.IO.Path.Combine(System.IO.Path.GetDirectoryName(path), @"\"),
                                                   System.IO.Path.GetFileNameWithoutExtension(path));
                tiei.InitializeExtractionForTagInstance();

                bgwTagExtract.RunWorkerAsync(tiei);
            }
            SaveFileDlg.Filter = "";
        }
		void OnTagInstanceExtractAs(BlamLib.Blam.CacheIndex.Item tag_instance)
		{
			SaveFileDlg.Filter = tag_instance.GroupTag.Filter;
			if (SaveFileDlg.ShowDialog(this) == DialogResult.OK)
			{
				string path = SaveFileDlg.FileName;
				var tiei = new TagInstanceExtractionInfo();

				tiei.InitializeStateForTagInstance(tag_instance,
					System.IO.Path.Combine(System.IO.Path.GetDirectoryName(path), @"\"),
					System.IO.Path.GetFileNameWithoutExtension(path));
				tiei.InitializeExtractionForTagInstance();

				bgwTagExtract.RunWorkerAsync(tiei);
			}
			SaveFileDlg.Filter = "";
		}
		void OnTagInstanceExtract(object sender, EventArgs e)
		{
			if (Program.WorkInProgress(this)) return;

			string path = null;
			if (sender != MenuTagInstanceExtractAs && // this has its own dialog for saving
				!OnTagInstanceExtractAskForPath(out path))
				return;

			BlamLib.Blam.CacheIndex.Item tag_instance;
			{
				var sel_node = TagTreeView.SelectedNode;
				if (sel_node == null) return;

				tag_instance = sel_node.Tag as BlamLib.Blam.CacheIndex.Item;
			};

			var tiei = new TagInstanceExtractionInfo();
			if (sender == MenuTagInstanceExtractFolder)
			{
				tiei.InitializeStateForTagInstance(tag_instance, path, null);
				tiei.InitializeExtractionForTagInstance();

				bgwTagExtract.RunWorkerAsync(tiei);
			}
			else if (sender == MenuTagInstanceExtractFolderAll)
			{
//				tiei.InitializeStateForTagHierarchy(
//					GetTagInstanceExtractionArguments(path, true), tag_instance);
//				tiei.InitializeExtractionForTagInstance();

				bgwTagExtract.RunWorkerAsync(tiei);
			}
			else if (sender == MenuTagInstanceExtractAs)
				OnTagInstanceExtractAs(tag_instance);
		}