public ConfigureLoggingFile(SequenceContext _seqContext, ChannelType _channelType)
        {
            InitializeComponent();
            //Set up Teststand objects
            seqContext         = _seqContext;
            seqContextPO       = seqContext.AsPropertyObject();
            selectedTSSequence = seqContext.SelectedSequences[0];
            selectedTSStep     = seqContext.SelectedSteps[0];
            stepID             = selectedTSStep.UniqueStepId;
            seqFile            = selectedTSSequence.SequenceFile;
            permSeqContext     = selectedTSSequence.Locals; //Must get sequence context this way for variables to save if teststand is restarted
            propObjectFile     = seqFile.AsPropertyObjectFile();
            EvaluationTypes eval = seqContext.Engine.NewEvaluationTypes();

            eval.PropertyValueTypeFlags = 0x4; //set string as the valid evaluation type
            LogFilePath_exp.SetValidEvaluationTypes(eval);
            LogFilePath_exp.Context = seqContextPO;
            EvaluationTypes evalNumeric = seqContext.Engine.NewEvaluationTypes();

            stepPropertyObject = selectedTSSequence.GetStepByUniqueId(stepID).AsPropertyObject();

            //Set up dialog objects
            sysDefPath = seqContext.SequenceFile.FileGlobalsDefaultValues.GetValString("Veristand.SystemDefinitionPath", 1); //Get the System Definition path for the Client Sequence File. Create it if it does not exist.
            seqContext.SequenceFile.FileGlobalsDefaultValues.SetFlags("Veristand.SystemDefinitionPath", 0, 0x4400000);
            channelList                     = stepPropertyObject.GetValVariant("Veristand.ChannelPaths", 0);                 //Get ChannelPaths array of strings.
            LogFilePath_exp.Text            = stepPropertyObject.GetValString("Veristand.LogFilePath", 0);                   //Try to get the Log File Path associated with this step
            SegmentFileSize_boolean.Checked = stepPropertyObject.GetValBoolean("Veristand.FileSegmenting", 0);               //Get the boolean for Segmenting File Size option
            FileSegmentSize_num.Value       = (int)stepPropertyObject.GetValNumber("Veristand.FileSegmentingSize", 0);       //Get the File Segment Size value
            fileDescription                 = stepPropertyObject.GetValString("Veristand.FileDescription", 0);               //Get the File Description advanced property
            filePropertyNames.AddRange(stepPropertyObject.GetValVariant("Veristand.FilePropertyNames", 0));
            filePropertyValues.AddRange(stepPropertyObject.GetValVariant("Veristand.FilePropertyValues", 0));
            channelType = _channelType;
            loggingChannelSelection.ShowCheckBox = true;

            //If the file at path FileGlobals.Veristand.SystemDefinitionPath exists and the extension is ".nivssdf" use that System Definition file to initialize the TreeAliasBrowserWF.
            if (System.IO.File.Exists(StringUtilities.unparseFilePathString(sysDefPath)) && System.IO.Path.GetExtension(StringUtilities.unparseFilePathString(sysDefPath)) == ".nivssdf")
            {
                //File exists with correct extension so try and populate the tree
                InitializeListBox(sysDefPath);
            }
            //If FileGlobals.Veristand.SystemDefinitionPath is empty or the file does not exist at path FileGlobals.Veristand.SystemDefinitionPath.
            else     //(sysDefPath == "" || !System.IO.File.Exists(StringUtilities.unparseFilePathString(sysDefPath)))
            {
                //Do nothing
            }
            VSDialogs vsdiag = new VSDialogs();
        }
        public ConfigureLoggingFile(SequenceContext _seqContext, ChannelType _channelType)
        {
            InitializeComponent();
            //Set up Teststand objects
            seqContext         = _seqContext;
            seqContextPO       = seqContext.AsPropertyObject();
            selectedTSSequence = seqContext.SelectedSequences[0];
            selectedTSStep     = seqContext.SelectedSteps[0];
            stepID             = selectedTSStep.UniqueStepId;
            seqFile            = selectedTSSequence.SequenceFile;
            permSeqContext     = selectedTSSequence.Locals; //Must get sequence context this way for variables to save if teststand is restarted
            propObjectFile     = seqFile.AsPropertyObjectFile();
            EvaluationTypes eval = seqContext.Engine.NewEvaluationTypes();

            eval.PropertyValueTypeFlags = 0x4; //set string as the valid evaluation type
            LogFilePath_exp.SetValidEvaluationTypes(eval);
            LogFilePath_exp.Context = seqContextPO;
            EvaluationTypes evalNumeric = seqContext.Engine.NewEvaluationTypes();

            stepPropertyObject = selectedTSSequence.GetStepByUniqueId(stepID).AsPropertyObject();

            //Set up dialog objects
            sysDefPath = seqContext.SequenceFile.FileGlobalsDefaultValues.GetValString("Veristand.SystemDefinitionPath", 1); //Get the System Definition path for the Client Sequence File. Create it if it does not exist.
            seqContext.SequenceFile.FileGlobalsDefaultValues.SetFlags("Veristand.SystemDefinitionPath", 0, 0x4400000);
            channelList                     = stepPropertyObject.GetValVariant("Veristand.ChannelPaths", 0);                 //Get ChannelPaths array of strings.
            LogFilePath_exp.Text            = stepPropertyObject.GetValString("Veristand.LogFilePath", 0);                   //Try to get the Log File Path associated with this step
            SegmentFileSize_boolean.Checked = stepPropertyObject.GetValBoolean("Veristand.FileSegmenting", 0);               //Get the boolean for Segmenting File Size option
            FileSegmentSize_num.Value       = (int)stepPropertyObject.GetValNumber("Veristand.FileSegmentingSize", 0);       //Get the File Segment Size value
            fileDescription                 = stepPropertyObject.GetValString("Veristand.FileDescription", 0);               //Get the File Description advanced property
            filePropertyNames.AddRange(stepPropertyObject.GetValVariant("Veristand.FilePropertyNames", 0));
            filePropertyValues.AddRange(stepPropertyObject.GetValVariant("Veristand.FilePropertyValues", 0));
            channelType = _channelType;
            if (stepPropertyObject.GetValInterface("Veristand.BaseNodeArray", 0) != null)
            {
                baseNodeArray = (BaseNodeType[])stepPropertyObject.GetValInterface("Veristand.BaseNodeArray", 0);//Get the BaseNodeArray from TestStand and cast to a BaseNodeType[]
            }
            else
            {
                baseNodeArray = new BaseNodeType[0];
            }

            // These changes are in the 2014 VeriStand trunk so as soon as we start using that assembly we should revert these changes.
            // This is a hack for now to get check boxes on the Windows Form TreeAliasBrowserWF.

            Type      TreeAliasBrowser      = typeof(StorageChannelAndAliasBrowser);
            FieldInfo m_ChanAliasWPFElement = typeof(NationalInstruments.VeriStand.SystemStorageUI.WinFormsWrapper.TreeAliasBrowserWF).GetField(
                "m_ChanAliasWPFElement",
                BindingFlags.NonPublic |
                BindingFlags.Instance);
            FieldInfo aliasBrowserInfo = TreeAliasBrowser.GetField(
                "AliasTab",
                BindingFlags.NonPublic |
                BindingFlags.Instance);
            FieldInfo treeviewInfo = TreeAliasBrowser.GetField(
                "TreeView",
                BindingFlags.NonPublic |
                BindingFlags.Instance);
            var topLevelBrowser = (StorageChannelAndAliasBrowser)m_ChanAliasWPFElement.GetValue(loggingChannelSelection);

            this._aliasBrowser = (SystemDefinitionBrowser)aliasBrowserInfo.GetValue(topLevelBrowser);
            this._treeView     = (SystemDefinitionBrowser)treeviewInfo.GetValue(topLevelBrowser);
            this._aliasBrowser.ShowCheckBox = true;
            this._treeView.ShowCheckBox     = true;

            //If the file at path FileGlobals.Veristand.SystemDefinitionPath exists and the extension is ".nivssdf" use that System Definition file to initialize the TreeAliasBrowserWF.
            if (System.IO.File.Exists(StringUtilities.unparseFilePathString(sysDefPath)) && System.IO.Path.GetExtension(StringUtilities.unparseFilePathString(sysDefPath)) == ".nivssdf")
            {
                //File exists with correct extension so try and populate the tree
                InitializeListBox(sysDefPath);
            }
            //If FileGlobals.Veristand.SystemDefinitionPath is empty or the file does not exist at path FileGlobals.Veristand.SystemDefinitionPath.
            else     //(sysDefPath == "" || !System.IO.File.Exists(StringUtilities.unparseFilePathString(sysDefPath)))
            {
                //Do nothing
            }
            VSDialogs vsdiag = new VSDialogs();
        }