public PropertiesControl()
        {
            InitializeComponent();
            MMCMiscUtil.SetDoubleBuffered(this.listViewProp);
            this.Dock = DockStyle.Fill;

            ColumnHeader attrColumnHeader = new ColumnHeader();

            attrColumnHeader.Text  = "Attribute";
            attrColumnHeader.Width = 400;
            listViewProp.Columns.Add(attrColumnHeader);
            ColumnHeader valColumnHeader = new ColumnHeader();

            valColumnHeader.Text  = "Value";
            valColumnHeader.Width = 400;
            listViewProp.Columns.Add(valColumnHeader);
            ColumnHeader typColumnHeader = new ColumnHeader();

            typColumnHeader.Text  = "Syntax";
            typColumnHeader.Width = 400;
            listViewProp.Columns.Add(typColumnHeader);

            _properties       = new Dictionary <string, VMDirAttributeDTO>();
            _currAttrDTOList  = new List <AttributeDTO>();
            _optAttrDTOList   = new List <AttributeDTO>();
            _oprAttrDTOList   = new List <AttributeDTO>();
            _mayAttrTyDTOList = new List <AttributeTypeDTO>();
            _modData          = new HashSet <string>();
            SetEditState(false);
        }
Esempio n. 2
0
        private void buttonExport_Click(object sender, EventArgs e)
        {
            if (!ValidateForm())
            {
                return;
            }
            MiscUtilsService.CheckedExec(delegate()
            {
                StringBuilder sb = new StringBuilder();
                var start        = 0;
                var end          = _result.Count();
                if (comboBoxScope.SelectedIndex == (int)ExportScope.CURR_PAGE)
                {
                    start = (_currPage - 1) * _pageSize;
                    end   = _currPage * _pageSize > _result.Count ? _result.Count : _currPage * _pageSize;
                }
                HashSet <string> attrToExport = new HashSet <string>();
                if (checkBoxAttToExport.CheckState == CheckState.Checked)
                {
                    foreach (var item in _attrList)
                    {
                        attrToExport.Add(item);
                    }
                }
                else
                {
                    foreach (ListViewItem item in listViewAttrToExport.Items)
                    {
                        attrToExport.Add(item.SubItems[0].Text);
                    }
                }

                foreach (var item in attrToExport)
                {
                    sb.Append(item + ",");
                }
                sb.Append(Environment.NewLine);
                for (var i = start; i < end; i++)
                {
                    foreach (var item in attrToExport)
                    {
                        sb.Append("\"");
                        if (_result[i].NodeProperties.ContainsKey(item))
                        {
                            foreach (var val in _result[i].NodeProperties[item].Values)
                            {
                                sb.Append(val.StringValue + " ");
                            }
                        }
                        sb.Append("\"");
                        sb.Append(",");
                    }
                    sb.Append(Environment.NewLine);
                }
                if (MMCMiscUtil.SaveDataToFile(sb.ToString(), "Export Result", MMCUIConstants.CSV_FILTER))
                {
                    MMCDlgHelper.ShowInformation(VMDirConstants.STAT_RES_EXPO_SUCC);
                }
            });
        }
Esempio n. 3
0
 public RootNode(PropertiesControl control)
     : base(null, control)
 {
     this.Text  = MMCMiscUtil.GetBrandConfig(CommonConstants.DIR_ROOT);
     ImageIndex = SelectedImageIndex = (int)VMDirIconIndex.Directory;
     this.Tag   = "root";
 }
Esempio n. 4
0
 void ExportSigningRequest()
 {
     MMCActionHelper.CheckedExec(delegate()
     {
         var cert = this.SelectedNodes[0].Tag as SigningRequestDTO;
         MMCMiscUtil.SaveDataToFile(cert.CSR, "Save CSR", MMCUIConstants.CSR_FILTER);
     });
 }
Esempio n. 5
0
 private void buttonBrowse_Click(object sender, EventArgs e)
 {
     MiscUtilsService.CheckedExec(delegate()
     {
         var values         = MMCMiscUtil.ReadAllFromFile("Select File", MMCUIConstants.TXT_FILTER);
         this.textBox1.Text = values;
     });
 }
Esempio n. 6
0
        private void button1_Click(object sender, EventArgs e)
        {
            var keyFile = MMCMiscUtil.SelectFile("Select Secret key", MMCUIConstants.PRI_KEY_FILTER);

            try{
                this.txtSecretKey.Text = File.ReadAllText(keyFile);
            }
            catch (Exception) {}
        }
Esempio n. 7
0
        public VMCARootNode()
            : base()
        {
            DisplayName     = MMCMiscUtil.GetBrandConfig(CommonConstants.CA_ROOT);
            RefreshDelegate = new Refresh(RefreshMethod);

            this.ActionsPaneItems.Add(new Microsoft.ManagementConsole.Action("Add Server",
                                                                             "Add Server", -1, ACTION_ADD_SERVER));
            ImageIndex = SelectedImageIndex = (int)VMCAImageIndex.CertificateAuthority;
        }
Esempio n. 8
0
        public VMCertStoreRootNode()
            : base()
        {
            DisplayName = MMCMiscUtil.GetBrandConfig(CommonConstants.CS_ROOT);

            RefreshDelegate = new Refresh(RefreshMethod);

            this.ActionsPaneItems.Add(new Microsoft.ManagementConsole.Action("Add Server",
                                                                             "Add Server", -1, ACTION_ADD_SERVER));
        }
Esempio n. 9
0
 public NewServerView(ServiceGateway service)
 {
     InitializeComponent();
     _service                   = service;
     _dto                       = new Dto.ServerDto();
     cbIsSsl.Checked            = true;
     lblStsUrl.Visible          = cbSAML.Checked;
     txtStsUrl.Visible          = cbSAML.Checked;
     this.txtDefaultTenant.Text = MMCMiscUtil.GetBrandConfig(CommonConstants.TENANT);
     UpdateUrlPreview();
 }
Esempio n. 10
0
 public LoginForm(string server, string user, string domain) : this()
 {
     this.Server   = server;
     this.UserName = user;
     if (!string.IsNullOrWhiteSpace(domain))
     {
         this.DomainName = domain;
     }
     else
     {
         this.DomainName = MMCMiscUtil.GetBrandConfig(CommonConstants.TENANT);
     }
 }
Esempio n. 11
0
        public VMDNSRootNode()

            : base()

        {
            DisplayName = MMCMiscUtil.GetBrandConfig(CommonConstants.DNS_ROOT);



            this.ActionsPaneItems.Add(new Microsoft.ManagementConsole.Action("Add Server",

                                                                             "Add Server", -1, ACTION_ADD_SERVER));
        }
Esempio n. 12
0
 public void StoreQuery()
 {
     MiscUtilsService.CheckedExec(delegate
     {
         if (!ValidateSearch())
         {
             return;
         }
         var qdto = GetQuery();
         if (qdto == null)
         {
             return;
         }
         MMCMiscUtil.SaveObjectToFile(qdto, "Store Query", MMCUIConstants.XML_FILTER);
     });
 }
Esempio n. 13
0
        public frmConnectToServer(VMDirServerDTO dto)
            : this()
        {
            _dto = dto;
            txtDirectoryServer.Text = dto.Server;
            var tenant = MMCMiscUtil.GetBrandConfig(CommonConstants.TENANT);

            if (string.IsNullOrWhiteSpace(dto.BindDN))
            {
                txtBindUPN.Text = "Administrator@" + tenant;
            }
            else
            {
                txtBindUPN.Text = dto.BindDN;
            }
            if (string.IsNullOrWhiteSpace(dto.BaseDN))
            {
                txtBaseDN.Text = CommonConstants.GetDNFormat(tenant);
            }
            else
            {
                txtBaseDN.Text = dto.BaseDN;
            }
        }
Esempio n. 14
0
        public frmLogin()

        {
            InitializeComponent();
            this.txtUser.Text = "Administrator@" + MMCMiscUtil.GetBrandConfig(CommonConstants.TENANT);
        }
Esempio n. 15
0
 private void btnBrowseCertificate_Click(object sender, EventArgs e)
 {
     txtCertificate.Text = MMCMiscUtil.SelectFile("Select Certificate", MMCUIConstants.CERT_FILTER);
 }
Esempio n. 16
0
 public SnapInNode() : base(false)
 {
     this.DisplayName = MMCMiscUtil.GetBrandConfig(CommonConstants.SSO_ROOT);
     AddActions();
 }
Esempio n. 17
0
 private void btnBrowse_Click(object sender, EventArgs e)
 {
     txtFileName.Text = MMCMiscUtil.SelectFile("Select private key file", MMCUIConstants.PRI_KEY_FILTER);
 }
Esempio n. 18
0
 public VMDirRootNode()
 {
     DisplayName = MMCMiscUtil.GetBrandConfig(CommonConstants.DIR_ROOT);
     AddViewDescription();
 }
Esempio n. 19
0
 public static void SaveKeyData(KeyPairData data)
 {
     MMCMiscUtil.SaveDataToFile(data.PrivateKey, "Save private key", MMCUIConstants.PRI_KEY_FILTER);
     MMCMiscUtil.SaveDataToFile(data.PublicKey, "Save public key", MMCUIConstants.PUB_KEY_FILTER);
 }
Esempio n. 20
0
 /// <summary>
 /// Constructor
 /// </summary>
 public RootNode()
 {
     this.DisplayName = MMCMiscUtil.GetBrandConfig(CommonConstants.PSC_ROOT);
     this.ActionsPaneItems.Add(new Microsoft.ManagementConsole.Action(Constants.ConnectToServer,
                                                                      Constants.ConnectToServer, -1, ConnectToServerAction));
 }
Esempio n. 21
0
 private void btnBrowsePrivateKey_Click(object sender, EventArgs e)
 {
     this.txtPrivateKey.Text = MMCMiscUtil.SelectFile("Select Private key", MMCUIConstants.PRI_KEY_FILTER);
 }