Пример #1
0
        private void getNodeTypeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_AppClient != null)
            {
                AppTestGenericInputForm aInput = new AppTestGenericInputForm();
                aInput.Text = "Get Node Type";
                aInput.SetItems(1);
                aInput.SetPrompt(0, "Index:");

                if (aInput.ShowDialog() == DialogResult.OK)
                {
                    int aIndex = 0;
                    if (int.TryParse(aInput.GetValue(0), out aIndex))
                    {
                        string aNodeType = null;
                        string aDetails  = "null";

                        AppendToOutput("Get Node Type", true);
                        aNodeType = _AppClient.GetNodeType(aIndex);

                        if (aNodeType != null)
                        {
                            aDetails = aNodeType;
                        }

                        AppendToOutput(aDetails, true);
                    }
                }
            }
        }
Пример #2
0
        private void getNodeType2ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_AppClient != null)
            {
                AppTestGenericInputForm aInput = new AppTestGenericInputForm();
                aInput.Text = "Get Node Type (2)";
                aInput.SetItems(2);
                aInput.SetPrompt(0, "Extent Name:");
                aInput.SetPrompt(1, "Node Name:");

                if (aInput.ShowDialog() == DialogResult.OK)
                {
                    string aNodeType = null;
                    string aDetails  = "null";

                    AppendToOutput("Get Node Type (2)", true);
                    aNodeType = _AppClient.GetNodeType(aInput.GetValue(0), aInput.GetValue(1));

                    if (aNodeType != null)
                    {
                        aDetails = aNodeType;
                    }

                    AppendToOutput(aDetails, true);
                }
            }
        }
Пример #3
0
        private void getFullNodeNameToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_AppClient != null)
            {
                AppTestGenericInputForm aInput = new AppTestGenericInputForm();
                aInput.Text = "Get Full Node Name";
                aInput.SetItems(2);
                aInput.SetPrompt(0, "Extent Name:");
                aInput.SetPrompt(1, "Index:");

                if (aInput.ShowDialog() == DialogResult.OK)
                {
                    string aExtentName   = aInput.GetValue(0).Trim();
                    int    aIndex        = 0;
                    string aFullNodeName = "null";

                    int.TryParse(aInput.GetValue(1), out aIndex);

                    AppendToOutput("Get Full Node Name", true);
                    if (aExtentName.Length > 0)
                    {
                        aFullNodeName = _AppClient.GetFullNodeName(aExtentName, aIndex);
                    }
                    else
                    {
                        aFullNodeName = _AppClient.GetFullNodeName(aIndex);
                    }

                    AppendToOutput(aFullNodeName, true);
                }
            }
        }
Пример #4
0
        private void getNodeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_AppClient != null)
            {
                AppTestGenericInputForm aInput = new AppTestGenericInputForm();
                aInput.Text = "Get Node";
                aInput.SetItems(1);
                aInput.SetPrompt(0, "Index:");

                if (aInput.ShowDialog() == DialogResult.OK)
                {
                    int aIndex = 0;
                    if (int.TryParse(aInput.GetValue(0), out aIndex))
                    {
                        ANodeInfo aNodeInfo = null;
                        string    aDetails  = "null";

                        AppendToOutput("Get Node", true);
                        aNodeInfo = _AppClient.GetNode(aIndex);

                        if (aNodeInfo != null)
                        {
                            aDetails = string.Format("Date: {0}\nSize: {1}\nSymbol: {2}\nTime: {3}\n Type: {4}\nUnique Key: {5}\nValue: {6}\nVersion: {7}",
                                                     aNodeInfo.Date, aNodeInfo.Size, aNodeInfo.Symbol, aNodeInfo.Time, aNodeInfo.Type, aNodeInfo.UniqueKey, aNodeInfo.Value, aNodeInfo.Version);
                        }

                        AppendToOutput(aDetails, true);
                    }
                }
            }
        }
Пример #5
0
        private void removeUserToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int aUserId = 0;

            if (_AppClient != null)
            {
                AppTestGenericInputForm aInput = new AppTestGenericInputForm();

                aInput.Text = "Remove User";
                aInput.SetItems(1);
                aInput.SetPrompt(0, "User Id:");

                if (aInput.ShowDialog() == DialogResult.OK)
                {
                    try
                    {
                        aUserId = int.Parse(aInput.GetValue(0));

                        _AppClient.DeleteUser(_DefaultReceiver, aUserId);
                    }
                    catch (Exception ex)
                    {
                        uStatusError.Text = "Remove user failed: " + ex.Message;
                    }
                }
            }
            else
            {
            }
        }
Пример #6
0
        private void getNodeActionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_AppClient != null)
            {
                AppTestGenericInputForm aInput = new AppTestGenericInputForm();
                aInput.Text = "Get Node Actions";
                aInput.SetItems(1);
                aInput.SetPrompt(0, "Index:");

                if (aInput.ShowDialog() == DialogResult.OK)
                {
                    int aIndex = 0;
                    if (int.TryParse(aInput.GetValue(0), out aIndex))
                    {
                        AppendToOutput("Get Node Actions", true);
                        string[] aActions = _AppClient.GetNodeActions(aIndex);

                        if (aActions != null)
                        {
                            foreach (string aAction in aActions)
                            {
                                AppendToOutput(aAction, true);
                            }
                        }
                        else
                        {
                            AppendToOutput("null", true);
                        }
                    }
                }
            }
        }
Пример #7
0
        private void getServerTypeActionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_AppClient != null)
            {
                AppTestGenericInputForm aInput = new AppTestGenericInputForm();
                aInput.Text = "Get Server Type Actions";
                aInput.SetItems(2);
                aInput.SetPrompt(0, "Type:");
                aInput.SetPrompt(1, "Extent:");

                if (aInput.ShowDialog() == DialogResult.OK)
                {
                    AppendToOutput("Get Server Type Actions", true);

                    string[] aActions = _AppClient.GetServerTypeActions(aInput.GetValue(0), aInput.GetValue(1));
                    if (aActions != null)
                    {
                        foreach (string aAction in aActions)
                        {
                            AppendToOutput(aAction, true);
                        }
                    }
                    else
                    {
                        AppendToOutput("null", true);
                    }
                }
            }
        }
Пример #8
0
        private void getContextParamsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_AppClient != null)
            {
                AppTestGenericInputForm aInput = new AppTestGenericInputForm();
                aInput.Text = "Get Context Params";
                aInput.SetItems(1);
                aInput.SetPrompt(0, "Context:");

                if (aInput.ShowDialog() == DialogResult.OK)
                {
                    _AppClient.GetContextParams(_DefaultReceiver, aInput.GetValue(0));
                }
            }
        }
Пример #9
0
        private void getExtentTypeOptionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_AppClient != null)
            {
                AppTestGenericInputForm aInput = new AppTestGenericInputForm();
                aInput.Text = "Get Extent Type Options";
                aInput.SetItems(1);
                aInput.SetPrompt(0, "Extent Name:");

                if (aInput.ShowDialog() == DialogResult.OK)
                {
                    AppendToOutput("Get Extent Type Options", true);
                    AppendToOutput(_AppClient.GetExtentTypeOptions(aInput.GetValue(0)), true);
                }
            }
        }
Пример #10
0
        private void setCurrentExtentToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_AppClient != null)
            {
                AppTestGenericInputForm aInput = new AppTestGenericInputForm();
                aInput.Text = "Set Current Extent";
                aInput.SetItems(1);
                aInput.SetPrompt(0, "Current Extent");

                if (aInput.ShowDialog() == DialogResult.OK)
                {
                    AppendToOutput("Set Current Extent", true);
                    bool aRes = _AppClient.SetCurrentExtent(aInput.GetValue(0));
                    AppendToOutput(aRes.ToString(), true);
                }
            }
        }
Пример #11
0
        private void editUserToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int      aUserId      = 0;
            string   aUsername    = string.Empty;
            string   aPassword    = string.Empty;
            int      aSecurityLvl = 0;
            DateTime aEndDate     = DateTime.Now;
            string   aComment     = string.Empty;

            if (_AppClient != null)
            {
                AppTestGenericInputForm aInput = new AppTestGenericInputForm();

                aInput.Text = "Update User";
                aInput.SetItems(6);
                aInput.SetPrompt(0, "Username:"******"Password:"******"Security Level:");
                aInput.SetPrompt(3, "End Date:");
                aInput.SetPrompt(4, "Comment:");
                aInput.SetPrompt(5, "User Id:");

                if (aInput.ShowDialog() == DialogResult.OK)
                {
                    try
                    {
                        aUsername    = aInput.GetValue(0);
                        aPassword    = aInput.GetValue(1);
                        aSecurityLvl = int.Parse(aInput.GetValue(2));
                        aEndDate     = DateTime.Parse(aInput.GetValue(3));
                        aComment     = aInput.GetValue(4);
                        aUserId      = int.Parse(aInput.GetValue(5));

                        _AppClient.UpdateUser(_DefaultReceiver, aUserId, aUsername, aPassword, aSecurityLvl, aEndDate, aComment);
                    }
                    catch (Exception ex)
                    {
                        uStatusError.Text = "Update user failed: " + ex.Message;
                    }
                }
            }
            else
            {
                uStatusError.Text = "Update user failed: Not connected.";
            }
        }
Пример #12
0
        private void getNumNodes2ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_AppClient != null)
            {
                AppTestGenericInputForm aInput = new AppTestGenericInputForm();
                aInput.Text = "Get Num Nodes (2)";
                aInput.SetItems(1);
                aInput.SetPrompt(0, "Extent Name:");

                if (aInput.ShowDialog() == DialogResult.OK)
                {
                    AppendToOutput("Get Num Nodes (2)", true);
                    int aCnt = _AppClient.GetNumNodes(aInput.GetValue(0));

                    AppendToOutput(aCnt.ToString(), true);
                }
            }
        }
Пример #13
0
        private void getContextParamToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_AppClient != null)
            {
                AppTestGenericInputForm aInput = new AppTestGenericInputForm();
                aInput.Text = "Get Context Param";
                aInput.SetItems(1);
                aInput.SetPrompt(0, "Param Name:");

                if (aInput.ShowDialog() == DialogResult.OK)
                {
                    string aValue = "null";

                    _AppClient.GetContextParam(aInput.GetValue(0), out aValue);

                    AppendToOutput(string.Format("{0} = {1}", aInput.GetValue(0), aValue), true);
                }
            }
        }
Пример #14
0
        private void getNextLevelToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_AppClient != null)
            {
                AppTestGenericInputForm aInput = new AppTestGenericInputForm();
                aInput.Text = "Get Next Level";
                aInput.SetItems(1);
                aInput.SetPrompt(0, "Node Name:");

                if (aInput.ShowDialog() == DialogResult.OK)
                {
                    string aNodeName = aInput.GetValue(0).Trim();
                    if (aNodeName.Length > 0)
                    {
                        _AppClient.GetNextLevel(_DefaultReceiver, aNodeName);
                    }
                    else
                    {
                        _AppClient.GetNextLevel(_DefaultReceiver);
                    }
                }
            }
        }