Example #1
0
        public void openFile(String path)
        {
            DERMSInterface.CIMDefaults ch = new DERMSInterface.CIMDefaults();
            try
            {
                header.readHeader(path);
                this.Text = "Cim Header Config : " + new System.IO.FileInfo(path).Name.ToString();

            }
            catch (InvalidOperationException)
            {
                if (MessageBox.Show("File does not contain CIM header data. Use default values?", "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Error) == DialogResult.OK)
                {
                    this.Text = "Cim Header Config : Default";
                }
                else
                {
                    return;
                }
            }

            this.replyAddress.Text = header.ReplyAddress;
            this.source.Text = header.Source;
            this.timestamp.Text = header.Timestamp.ToString();
            this.context.Text = header.Context;
            this.revision.Text = header.Revision;
            this.noun.Text = header.Noun;
            this.createDerGroupVerbCombo.Text = header.CreateVerb == null ? "create" : header.CreateVerb;
            this.getDERGroupCombo.Text = header.GetVerb == null ? "get" : header.GetVerb;
            this.GetDERGroupStatusCombo.Text = header.StatusVerb == null ? "get" : header.StatusVerb;
            this.DispatchDERGroupCombo.Text = header.DispatchVerb == null ? "change" : header.DispatchVerb;
            this.nonce.Text = header.ReplayDetectionNonce;
            this.created.Text = header.ReplayDetectionCreated.ToString();
            this.comment.Text = header.Comment;
            this.correlationID.Text = header.CorrelationID;
            this.messageID.Text = header.MessageID;
            this.asyncReplyFlag.Text = (header.AsyncReplyFlag == true) ? "True" : "False";
            this.ackRequired.Text = header.AckRequired == true ? "True" : "False";
            this.createDERGroupEndPointText.Text = header.CreateDERGroupEndPoint;
            this.getDERGroupEndpointText.Text = header.GetDERGroupEndPoint;
            this.dispatchDERGroupEndpointText.Text = header.DispatchDERGroupEndPoint;
            this.getDERGroupStatusEndpointText.Text = header.GetDERGroupStatusEndPoint;
            CIMDefaults.Property[] p = header.getProperties();
            if (p.Length > 0)
            {
                this.propertyValue.Text = p[0].Value;
                this.propertyName.Text = p[0].Name;
            }

            this.organization.Text = header.UserOrganization;
            this.userID.Text = header.UserID;

            this.filePath = path;
        }
Example #2
0
        public void openFile(String path)
        {
            DERMSInterface.CIMDefaults ch = new DERMSInterface.CIMDefaults();
            try
            {
                header.readHeader(path);
                this.Text = "Cim Header Config : " + new System.IO.FileInfo(path).Name.ToString();
            }
            catch (InvalidOperationException)
            {
                if (MessageBox.Show("File does not contain CIM header data. Use default values?", "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Error) == DialogResult.OK)
                {
                    this.Text = "Cim Header Config : Default";
                }
                else
                {
                    return;
                }
            }

            this.replyAddress.Text                  = header.ReplyAddress;
            this.source.Text                        = header.Source;
            this.timestamp.Text                     = header.Timestamp.ToString();
            this.context.Text                       = header.Context;
            this.revision.Text                      = header.Revision;
            this.noun.Text                          = header.Noun;
            this.createDerGroupVerbCombo.Text       = header.CreateVerb == null ? "create" : header.CreateVerb;
            this.getDERGroupCombo.Text              = header.GetVerb == null ? "get" : header.GetVerb;
            this.GetDERGroupStatusCombo.Text        = header.StatusVerb == null ? "get" : header.StatusVerb;
            this.DispatchDERGroupCombo.Text         = header.DispatchVerb == null ? "change" : header.DispatchVerb;
            this.nonce.Text                         = header.ReplayDetectionNonce;
            this.created.Text                       = header.ReplayDetectionCreated.ToString();
            this.comment.Text                       = header.Comment;
            this.correlationID.Text                 = header.CorrelationID;
            this.messageID.Text                     = header.MessageID;
            this.asyncReplyFlag.Text                = (header.AsyncReplyFlag == true) ? "True" : "False";
            this.ackRequired.Text                   = header.AckRequired == true ? "True" : "False";
            this.createDERGroupEndPointText.Text    = header.CreateDERGroupEndPoint;
            this.getDERGroupEndpointText.Text       = header.GetDERGroupEndPoint;
            this.dispatchDERGroupEndpointText.Text  = header.DispatchDERGroupEndPoint;
            this.getDERGroupStatusEndpointText.Text = header.GetDERGroupStatusEndPoint;
            CIMDefaults.Property[] p = header.getProperties();
            if (p.Length > 0)
            {
                this.propertyValue.Text = p[0].Value;
                this.propertyName.Text  = p[0].Name;
            }

            this.organization.Text = header.UserOrganization;
            this.userID.Text       = header.UserID;

            this.filePath = path;
        }