public bool Update(int percent, string description)
 {
     this.description = description;
     this.percent     = percent;
     MOG_Progress.ProgressUpdateStep(this.Handle, description, percent);
     return(CancelClicked());
 }
Ejemplo n.º 2
0
        private classTreeNode EncodeTree(AssetTreeNode tn, MOG_Properties props, int dialogId)
        {
            classTreeNode classNode = new classTreeNode(tn.Text);

            classNode.ImageIndex         = BLUEDOT_INDEX;
            classNode.SelectedImageIndex = BLUEDOT_INDEX;

            // Get a local handle for our progress dialog
            MOG_Progress.ProgressUpdate(dialogId, tn.FullPath);

            // if this is an asset filename node?
            if (tn.IsAnAssetFilename)
            {
                classNode.Text                = classNode.Text;
                classNode.ForeColor           = Color.Blue;
                classNode.ImageIndex          = ARROW_INDEX;
                classNode.SelectedImageIndex  = ARROW_INDEX;
                classNode.IsAssetFilenameNode = true;

                // Inherit Properties from parent
                // 'props' needs to be cloned or else all of these children assets will share the same Properties!!!
                classNode.props = props;

                // Make list o' children
                foreach (AssetTreeNode fileNode in tn.fileNodes)
                {
                    if (fileNode.IsAFile)
                    {
                        classNode.importFiles.Add(fileNode.FileFullPath);
                    }
                }

                // setup gamedatapath
                string assetDirectoryPath = MOG.CONTROLLER.CONTROLLERASSET.MOG_ControllerAsset.GetCommonDirectoryPath(this.projectRootPath, classNode.importFiles);
                string relativePath       = "";
                if (assetDirectoryPath.Length > this.projectRootPath.Length)
                {
                    relativePath = assetDirectoryPath.Substring(this.projectRootPath.Length + 1);
                }
                classNode.props.SyncTargetPath = relativePath;

                // add it to the list of asset filename nodes for later processing
                this.assetFilenameNodes.Add(classNode);

                return(classNode);                              // don't do children of an asset filename node
            }

            // Use our properties to pass along to our children
            props = MOG_ControllerProject.GetClassificationProperties(tn.FullPath.Replace(tn.TreeView.PathSeparator, "~"));
            props.SetImmeadiateMode(true);
            classNode.props = props;

            // Loop through all of our children nodes sending them our Properties
            foreach (AssetTreeNode subNode in tn.Nodes)
            {
                classNode.Nodes.Add(EncodeTree(subNode, props, dialogId));
            }

            return(classNode);
        }
 public void Kill()
 {
     MOG_Progress.ProgressClose(this.Handle);
 }
 public bool Update(string description)
 {
     MOG_Progress.ProgressUpdate(this.Handle, description);
     this.description = description;
     return(CancelClicked());
 }
 public bool CancelClicked()
 {
     return(MOG_Progress.ProgressStatus(this.Handle) != MOGPromptResult.Cancel);
 }
 public int DialogInit(string title, string description, bool bCancelVisible)
 {
     this.Handle = MOG_Progress.ProgressSetup(title, description, 0, 100);
     this.Title  = title;
     return(this.Handle);
 }