示例#1
0
        public NewUserDlg()
        {
            InitializeComponent();

            aHelpProvider.HelpNamespace = MMUtils.instPath + "\\Synergy.chm";
            aHelpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            aHelpProvider.SetHelpKeyword(this, "start.htm");

            Text             = MMUtils.GetString("newuserDlg.dlgtitle.text");
            lblPrompt.Text   = MMUtils.GetString("newuserDlg.lblPrompt.text");
            lblName.Text     = MMUtils.GetString("newuserDlg.lblName.text");
            lblLogin.Text    = MMUtils.GetString("newuserDlg.lblLogin.text");
            lblPassword.Text = MMUtils.GetString("newuserDlg.lblPassword.text");
            lblRole.Text     = MMUtils.GetString("newuserDlg.lblRole.text");
            rbtnAdmin.Text   = MMUtils.GetString("newuserDlg.rbtnAdmin.text");
            rbtnDAdmin.Text  = MMUtils.GetString("newuserDlg.rbtnDAdmin.text");
            rbtnMember.Text  = MMUtils.GetString("newuserDlg.rbtnMember.text");
            btnCancel.Text   = MMUtils.GetString("buttonCancel.text");

            toolTipName.SetToolTip(this.lblName, MMUtils.GetString("newuserDlg.name.tooltip"));
            toolTipLogin.SetToolTip(this.lblLogin, MMUtils.GetString("newuserDlg.login.tooltip"));
            toolTipEmail.SetToolTip(this.lblEmail, MMUtils.GetString("newuserDlg.email.tooltip"));
            toolTipPassword.SetToolTip(this.lblPassword, MMUtils.GetString("newuserDlg.password.tooltip"));
            toolTipAdmin.SetToolTip(this.rbtnAdmin, MMUtils.GetString("newuserDlg.admin.tooltip"));
            toolTipDAdmin.SetToolTip(this.rbtnDAdmin, MMUtils.GetString("newuserDlg.dadmin.tooltip"));
            toolTipMember.SetToolTip(this.rbtnMember, MMUtils.GetString("newuserDlg.member.tooltip"));

            txtName.Text  = MMUtils.MindManager.Options.UserName;
            txtEmail.Text = MMUtils.MindManager.Options.UserEmail;

            lblRequired.Text   = "";
            rbtnMember.Checked = true;
        }
示例#2
0
        public LinkedFilesDlg(List <string> links, Document _doc)
        {
            InitializeComponent();

            aHelpProvider.HelpNamespace = MMUtils.instPath + "\\Synergy.chm";
            aHelpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            aHelpProvider.SetHelpKeyword(this, "publishmap.htm"); // TODO

            checkedListBox.MouseHover += new EventHandler(checkedListBox_MouseHover);
            checkedListBox.MouseMove  += new MouseEventHandler(checkedListBox_MouseMove);

            Text           = MMUtils.GetString("linkedfilesdlg.dlgtitle.text");
            lblList.Text   = MMUtils.GetString("linkedfilesdlg.lblList.text");
            btnCancel.Text = MMUtils.GetString("buttonCancel.text");

            _links     = links;
            doc        = _doc;
            aLocalPath = doc.Path + "\\"; // path to map folder

            foreach (string link in links)
            {
                string fn = System.IO.Path.GetFileName(link);
                checkedListBox.Items.Add(fn);
            }
        }
示例#3
0
        private void ComboPlaces_SelectedIndexChanged(object sender, EventArgs e)
        {
            using (PlacesDB _db = new PlacesDB())
            {
                DataTable _dt = _db.ExecuteQuery("select * from PLACES where PLACENAME='" + comboPlaces.Text + "'");
                aStorage   = _dt.Rows[0]["STORAGE"].ToString();
                aPlacePath = _dt.Rows[0]["PLACEPATH"].ToString();
            }

            string LeaveInPlace = MMUtils.GetString("receivedmapdlg.rbtnLeaveInPlace.text");

            if (aStorage == "OneDrive")
            {
                LeaveInPlace             = LeaveInPlace + MMUtils.GetString("receivedmapdlg.LeaveInPlaceRec.text");
                rbtnLeaveInPlace.Checked = true;
                HelpRecommend.Visible    = true;
            }
            else
            {
                rbtnPlace.Checked     = true;
                HelpRecommend.Visible = false;
            }
            rbtnLeaveInPlace.Text = LeaveInPlace;

            // For FolderBrowser dialog
            System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(aPlacePath).Parent;
            initfolder = dir.FullName.ToString();
        }
示例#4
0
 private void m_cmdOpenMaps_Click()
 {
     if (OpenButtons.Count == 0)
     {
         System.Windows.Forms.MessageBox.Show(MMUtils.GetString("maps.nomapsyet.message"));
     }
 }
示例#5
0
        private void btnNext_Click(object sender, EventArgs e)
        {
            aPlaceName = txtNetworkDiskName.Text;

            // If Place with this name exists
            using (PlacesDB _db = new PlacesDB())
            {
                DataTable _dt = _db.ExecuteQuery("select * from PLACES");
                foreach (DataRow _row in _dt.Rows)
                {
                    // Storage name exists
                    if (aPlaceName == _row["PLACENAME"].ToString())
                    {
                        lblPlaceNameExists.Text = MMUtils.GetString("cloudstoragedlg.lblPlaceNameExists.text");
                        return;
                    }
                }
            }

            if (aPlaceName == "")
            {
                lblPlace.ForeColor = System.Drawing.Color.Red;
            }
            else
            {
                this.DialogResult = DialogResult.OK;
            }
        }
示例#6
0
        public CloudStorageDlg()
        {
            InitializeComponent();

            aHelpProvider.HelpNamespace = MMUtils.instPath + "\\Synergy.chm";
            aHelpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            aHelpProvider.SetHelpKeyword(this, "publishmap.htm"); // TODO

            Text = MMUtils.GetString("cloudstoragedlg.dlgtitle");
            lblChooseStorage.Text   = MMUtils.GetString("cloudstoragedlg.lblChooseStorage.text");
            btnAddNewStorage.Text   = MMUtils.GetString("cloudstoragedlg.btnAddNewStorage.text");
            lblPlaceName.Text       = MMUtils.GetString("cloudstoragedlg.lblPlaceName.text");
            lblPlaceNameExists.Text = "";
            btnCancel.Text          = MMUtils.GetString("buttonCancel.text");
            btnNext.Text            = MMUtils.GetString("buttonNext.text");
            btnBack.Text            = MMUtils.GetString("buttonBack.text");

            tltPlaceName.SetToolTip(help, MMUtils.GetString("cloudstoragedlg.PlaceName.tooltip"));

            using (StoragesDB _db = new StoragesDB())
            {
                DataTable _dt = _db.ExecuteQuery("select * from STORAGES");
                foreach (DataRow _row in _dt.Rows)
                {
                    if (_row["TYPE"].ToString() == "cloud")
                    {
                        comboStorageName.Items.Add(_row["STORAGENAME"]);
                    }
                }

                comboStorageName.SelectedIndex = 0;
                txtPlaceName.Text = comboStorageName.Text;
            }
        }
示例#7
0
        private void btnNext_Click(object sender, EventArgs e)
        {
            if (txtDiskName.Text == "")
            {
                lblDiskName.ForeColor = System.Drawing.Color.Red;
                return;
            }

            using (StoragesDB _db = new StoragesDB())
            {
                DataTable _dt = _db.ExecuteQuery("select * from STORAGES where STORAGENAME=`" + txtDiskName.Text + "`");
                if (_dt.Rows.Count != 0)
                {
                    lblDiskNameExists.Text = MMUtils.GetString("newnetworkdiskdlg.lblDiskNameExists.text");
                    return;
                }

                _db.ExecuteNonQuery("insert into STORAGES values(" +
                                    "`" + txtDiskName.Text + "`," +
                                    "`" + "networkdisk" + "`," +
                                    "``, ``, ``, ``, 0, 0)");
            }

            this.DialogResult = DialogResult.OK;
        }
示例#8
0
        public GetPathDlg(string storage = "", string _place = "", string cause = "", string type = "")
        {
            InitializeComponent();

            btnCancel.Text = MMUtils.GetString("buttonCancel.text");
            btnBack.Text   = MMUtils.GetString("buttonBack.text");

            aCause = cause;
            aPlace = _place;
            string aStorage = storage;

            if (cause == "receivemap")
            {
                btnBack.Enabled = false;
                Text            = MMUtils.GetString("getpathdlg.receivemap.dlgtitle");
                lblFolder.Text  = String.Format(MMUtils.GetString("getpathdlg.lblFolderReceiveMap.text"), aStorage);
            }

            if (cause == "publish")
            {
                Text           = MMUtils.GetString("getpathdlg.publish.dlgtitle");
                lblFolder.Text = String.Format(MMUtils.GetString("getpathdlg.lblFolderForPublish.text"), aStorage);
            }

            if (cause == "newplace")
            {
                if (type == "cloud")
                {
                    Text           = MMUtils.GetString("getpathdlg.newplace.dlgtitle");
                    lblFolder.Text = String.Format(MMUtils.GetString("getpathdlg.lblFolderNewPlace.text"), aStorage);
                }
            }
        }
示例#9
0
        void CreateLogin(bool _logInSynergy = false)
        {
            string imagePath = MMUtils.imagePath;
            string _caption  = MMUtils.GetString("login.commands.login.caption");
            string _tooltip  = MMUtils.GetString("login.commands.login.tooltip");

            if (_logInSynergy)
            {
                imagePath = imagePath + "user.png";
                SUtils.currentUserName = MMUtils.GetRegistry("", "CurrentUserName");
                _caption = SUtils.currentUserName + "    |";
                _tooltip = MMUtils.GetString("login.commands.logout.tooltip");
            }
            else // Log out
            {
                imagePath = imagePath + "connection.png";
            }

            m_cmdLogin              = CreateCommand("synergylogin");
            m_cmdLogin.Caption      = _caption;
            m_cmdLogin.ToolTip      = _tooltip;
            m_cmdLogin.ImagePath    = imagePath;
            m_cmdLogin.UpdateState += new ICommandEvents_UpdateStateEventHandler(m_cmdLogin_UpdateState);
            m_cmdLogin.Click       += new ICommandEvents_ClickEventHandler(m_cmdLogin_Click);
            m_ctrlLogin             = MMUtils.MindManager.StatusBarControls.AddButton(m_cmdLogin);
        }
示例#10
0
        public void Create(ribbonTab myTab)
        {
            m_myTab = myTab;
            string imagePath = MMUtils.imagePath;

            try
            {
                m_rgPlaces = m_myTab.Groups.Add(0, MMUtils.GetString("places.group.name"), "www.palmaross.com", imagePath + "lists_s.png");

                m_cmdNewPlace                = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "NewPlace");
                m_cmdNewPlace.Caption        = MMUtils.GetString("places.commands.newplace.caption");
                m_cmdNewPlace.ToolTip        = MMUtils.GetString("places.commands.newplace.tooltip") + "\n" + m_cmdNewPlace.Caption;
                m_cmdNewPlace.LargeImagePath = MMUtils.imagePath + "common_stock.png";
                m_cmdNewPlace.ImagePath      = imagePath + "audio.png";
                m_cmdNewPlace.UpdateState   += new ICommandEvents_UpdateStateEventHandler(m_cmdNewPlace_UpdateState);
                m_cmdNewPlace.Click         += new ICommandEvents_ClickEventHandler(m_cmdNewPlace_Click);
                m_ctrlNewPlace               = m_rgPlaces.GroupControls.AddButton(m_cmdNewPlace);

                m_cmdManagePlaces                = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "ManagePlaces");
                m_cmdManagePlaces.Caption        = MMUtils.GetString("places.commands.manageplaces.caption");
                m_cmdManagePlaces.ToolTip        = MMUtils.GetString("places.commands.manageplaces.tooltip") + "\n" + m_cmdManagePlaces.Caption;
                m_cmdManagePlaces.LargeImagePath = MMUtils.imagePath + "common_stock.png";
                m_cmdManagePlaces.ImagePath      = imagePath + "audio.png";
                m_cmdManagePlaces.UpdateState   += new ICommandEvents_UpdateStateEventHandler(m_cmdManagePlaces_UpdateState);
                m_cmdManagePlaces.Click         += new ICommandEvents_ClickEventHandler(m_cmdManagePlaces_Click);
                m_ctrlManagePlaces               = m_rgPlaces.GroupControls.AddTwoPartButton(m_cmdManagePlaces);
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
            }
        }
示例#11
0
        public void m_command_Click() // open map
        {
            string aMapGuid      = m_command.ToolTip;
            string _mapName      = m_command.Caption;
            string _mapPlacePath = "";
            string aStorage      = "";
            string _mapLocalPath = "";
            bool   mapnotfound   = true;

            using (MapsDB _db = new MapsDB())
            {
                System.Data.DataTable _dt = _db.ExecuteQuery("select * from MAPS where MAPGUID=`" + aMapGuid + "`");
                if (_dt.Rows.Count != 0)
                {
                    mapnotfound   = false;
                    _mapLocalPath = _dt.Rows[0]["LOCALPATH"].ToString();
                    _mapPlacePath = _dt.Rows[0]["PATHTOPLACE"].ToString();
                    aStorage      = _dt.Rows[0]["STORAGE"].ToString();
                }
            }

            if (mapnotfound)
            {
                System.Windows.Forms.MessageBox.Show(String.Format(MMUtils.GetString("maps.mapnoexists.message"), _mapName),
                                                     MMUtils.GetString("maps.mapnoexists.caption"));
                return; // TODO нужно предложить удалить ее - из БД и из меню
            }

            // if map is opened already
            foreach (Document _map in MMUtils.MindManager.AllDocuments)
            {
                if (SUtils.SynergyMapGuid(_map) == aMapGuid)
                {
                    _map.Activate();
                    return;
                }
            }

            if (Directory.Exists(_mapPlacePath)) // TODO если по причине неподключенного сетевого диска -
            {
                string _latestfile        = Directory.GetFiles(_mapPlacePath, "*.mmap").Last().ToString();
                long   localmap_lastwrite = Convert.ToInt64(File.GetLastWriteTimeUtc(_mapLocalPath).ToString("yyyyMMddHHmmssfff"));
                long   placemap_time      = Convert.ToInt64(Path.GetFileNameWithoutExtension(_latestfile));

                // Check if map in Place is newer than local map, if yes - replace local map
                if (placemap_time > localmap_lastwrite)
                {
                    try
                    {
                        File.Copy(_latestfile, _mapLocalPath, true); // copy (overwrite) map from its Place to local Synergy
                    }
                    catch { } // TODO
                }
            }

            DocumentStorage.reopenmap = false;
            System.IO.File.SetAttributes(_mapLocalPath, System.IO.FileAttributes.Normal);
            MMUtils.MindManager.AllDocuments.Open(_mapLocalPath);
        }
示例#12
0
        public NetworkDiskDlg()
        {
            InitializeComponent();

            aHelpProvider.HelpNamespace = MMUtils.instPath + "\\Synergy.chm";
            aHelpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            aHelpProvider.SetHelpKeyword(this, "publishmap.htm"); // TODO

            Text                    = MMUtils.GetString("networkdiskdlg.dlgtitle");
            lblChooseND.Text        = MMUtils.GetString("networkdiskdlg.lblChooseND.text");
            btnAddNewDisk.Text      = MMUtils.GetString("cloudstoragedlg.btnAddNewStorage.text");
            lblPlace.Text           = MMUtils.GetString("networkdiskdlg.lblNetworkDisk.text");
            lblPlaceNameExists.Text = "";
            btnCancel.Text          = MMUtils.GetString("buttonCancel.text");
            btnNext.Text            = MMUtils.GetString("buttonNext.text");
            btnBack.Text            = MMUtils.GetString("buttonBack.text");

            using (StoragesDB _db = new StoragesDB())
            {
                DataTable _dt = _db.ExecuteQuery("select * from STORAGES");

                foreach (DataRow _row in _dt.Rows)
                {
                    if (_row["PROCESS"].ToString() != "" && _row["SITE"].ToString() == "")
                    {
                        comboDisks.Items.Add(_row["STORAGENAME"]);
                    }
                }
            }

            if (comboDisks.Items.Count != 0)
            {
                comboDisks.SelectedIndex = 0;
            }
            else
            {
                using (NewNetworkDiskDlg _dlg = new NewNetworkDiskDlg())
                {
                    DialogResult result = _dlg.ShowDialog(new WindowWrapper((IntPtr)MMUtils.MindManager.hWnd));
                    aStorage = _dlg.txtDiskName.Text;

                    if (result == DialogResult.Cancel)
                    {
                        this.DialogResult = DialogResult.Cancel;
                        return;
                    }
                    if (result == DialogResult.Retry)
                    {
                        this.DialogResult = DialogResult.Retry;
                        return;
                    }

                    comboDisks.Items.Add(aStorage);
                    comboDisks.Text = aStorage;
                }
            }
        }
示例#13
0
        public NewMapDlg()
        {
            InitializeComponent();

            Text                 = MMUtils.GetString("newmapdlg.dlgtitle");
            lblNotSaved.Text     = MMUtils.GetString("newmapdlg.lblNotSaved.text");
            textBox_MapName.Text = MMUtils.MindManager.ActiveDocument.CentralTopic.Text;
            btn_cancel.Text      = MMUtils.GetString("buttonCancel.text");
        }
示例#14
0
 void m_cmdNewPlace_Click()
 {
     using (NewPlaceDlg _dlg = new NewPlaceDlg())
     {
         if (_dlg.ShowDialog(new WindowWrapper((IntPtr)MMUtils.MindManager.hWnd)) == System.Windows.Forms.DialogResult.OK)
         {
             System.Windows.Forms.MessageBox.Show(MMUtils.GetString("places.placecreated.message"));
         }
     }
 }
示例#15
0
        public CreateProjectDlg()
        {
            InitializeComponent();

            aHelpProvider.HelpNamespace = MMUtils.instPath + "\\Synergy.chm";
            aHelpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            aHelpProvider.SetHelpKeyword(this, "publishmap.htm"); // TODO

            Text                     = MMUtils.GetString("createprojectdlg.title");
            lblPlace.Text            = MMUtils.GetString("createprojectdlg.lblPlace.text");
            lblProjectName.Text      = MMUtils.GetString("createprojectdlg.lblProjectName.text");
            btnCreate.Text           = MMUtils.GetString("createprojectdlg.btnOK.text");
            btnCancel.Text           = MMUtils.GetString("buttonCancel.text");
            lblProjectNameError.Text = "";

            using (PlacesDB _db = new PlacesDB())
            {
                DataTable _dt = _db.ExecuteQuery("select * from PLACES");

                if (_dt.Rows.Count != 0)
                {
                    foreach (DataRow _row in _dt.Rows)
                    {
                        comboPlaces.Items.Add(_row["PLACENAME"]);
                    }
                }
            }

            // No places yet
            if (comboPlaces.Items.Count == 0)
            {
                if (MessageBox.Show(MMUtils.GetString("createprojectdlg.noplaces.text"),
                                    MMUtils.GetString("createprojectdlg.noplaces.caption"),
                                    MessageBoxButtons.YesNo, MessageBoxIcon.Question)
                    == DialogResult.No)
                {
                    this.DialogResult = DialogResult.Cancel;
                    return;
                }

                using (Places.NewPlaceDlg _dlg = new Places.NewPlaceDlg())
                {
                    if (_dlg.ShowDialog(new WindowWrapper((IntPtr)MMUtils.MindManager.hWnd)) == DialogResult.Cancel)
                    {
                        this.DialogResult = DialogResult.Cancel;
                        return;
                    }
                    aPlaceName = _dlg.aPlaceName;
                }

                comboPlaces.Items.Add(aPlaceName);
            }

            comboPlaces.Text = comboPlaces.Items[0].ToString();
        }
示例#16
0
        public FirstUserDlg()
        {
            InitializeComponent();

            aHelpProvider.HelpNamespace = MMUtils.instPath + "\\Synergy.chm";
            aHelpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            aHelpProvider.SetHelpKeyword(this, "synergy_struct.htm");

            btnOK.Text      = MMUtils.GetString("firstuserdlg.btnOK.text");
            btnCancel.Text  = MMUtils.GetString("buttonCancel.text");
            lblWelcome.Text = MMUtils.GetString("firstuserdlg.lblWelcome.text");
        }
示例#17
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            foreach (int idx in checkedListBox.CheckedIndices)
            {
                string _pathorig = _links[idx];
                string _pathdest = aLocalPath + checkedListBox.Items[idx];
                try
                {
                    if (System.IO.File.Exists(_pathdest)) // TODO потом сделать диалог
                    {
                        if (MessageBox.Show(String.Format(MMUtils.GetString("linkedfilesdlg.fileexists.message"), ""),
                                            MMUtils.GetString("linkedfilesdlg.fileexists.caption"),
                                            MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) == DialogResult.Yes)
                        {
                            System.IO.File.Copy(_pathorig, _pathdest, true);
                        }
                    }
                    else
                    {
                        System.IO.File.Copy(_pathorig, _pathdest);
                    }
                }
                catch (Exception _e) // TODO cause!!! read-only, etc...
                {
                    MessageBox.Show(this, "Error " + _e.Message, "title", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    this.DialogResult = DialogResult.Cancel;
                }
            }

            // TODO меняем ссылку в локальной карте
            foreach (Topic t in doc.Range(MmRange.mmRangeAllTopics))
            {
                if (t.Hyperlinks.Count > 0)
                {
                    foreach (Hyperlink h in t.Hyperlinks)
                    {
                        foreach (int idx in checkedListBox.CheckedIndices)
                        {
                            string _path = _links[idx];
                            if (h.Address == _path)
                            {
                                h.Address  = checkedListBox.Items[idx].ToString();
                                h.Absolute = false;
                                break;
                            }
                        }
                    }
                }
            }

            doc.Save();
            _links.Clear();
        }
示例#18
0
        void m_cmdNewProject_Click()
        {
            using (CreateProjectDlg _dlg = new CreateProjectDlg())
            {
                System.Windows.Forms.DialogResult result = _dlg.ShowDialog(new WindowWrapper((IntPtr)MMUtils.MindManager.hWnd));

                if (result == System.Windows.Forms.DialogResult.OK)
                {
                    System.Windows.Forms.MessageBox.Show(String.Format(
                                                             MMUtils.GetString("createprojectdlg.newprojectcreated.message"), _dlg.txtProjectName.Text));
                }
            }
        }
示例#19
0
        public LogOutDlg()
        {
            InitializeComponent();

            Text                  = MMUtils.GetString("logoutdlg.dlgtitle.text");
            btnExit.Text          = MMUtils.GetString("logoutdlg.btnExit.text");
            checkBoxForgetMe.Text = MMUtils.GetString("logoutdlg.checkBoxForgetMe.text");

            tltForgetMe.SetToolTip(this.checkBoxForgetMe, MMUtils.GetString("logoutdlg.checkBoxForgetMe.tooltip"));

            this.Location = new System.Drawing.Point(MMUtils.MindManager.Left + MMUtils.MindManager.Width - 510,
                                                     MMUtils.MindManager.Top + MMUtils.MindManager.Height - this.Height - 17);
        }
示例#20
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            string aStorage     = "";                  // name of Storage
            string aProjectPath = "";
            string aPlaceName   = comboPlaces.Text;    // name of selected Place
            string aPlacePath   = "";
            string aProjectName = txtProjectName.Text; // project to which we have to save the map

            using (ProjectsDB _db = new ProjectsDB())
            {
                DataTable _dt = _db.ExecuteQuery("select * from PROJECTS where PROJECTNAME='" + aProjectName + "' and PLACENAME='" + aPlaceName + "'");
                if (_dt.Rows.Count > 0) // project with this name already exists
                {
                    lblProjectNameError.Text = MMUtils.GetString("createprojectdlg.projectexists.text");
                    return;
                }
            }

            // project name not entered
            if (aProjectName == "")
            {
                lblProjectNameError.Text = MMUtils.GetString("createprojectdlg.projectnameempty.text");
                return;
            }

            using (PlacesDB _db = new PlacesDB())
            {
                DataTable _dt = _db.ExecuteQuery("select * from PLACES where PLACENAME='" + aPlaceName + "'");
                aStorage   = _dt.Rows[0]["STORAGE"].ToString();
                aPlacePath = _dt.Rows[0]["PLACEPATH"].ToString();
            }

            aProjectPath = aPlacePath + "$$" + aProjectName;
            string _localPath = MMUtils.m_SynergyLocalPath + aPlaceName + "\\" + aProjectName;

            try
            {
                System.IO.Directory.CreateDirectory(_localPath);
                System.IO.Directory.CreateDirectory(aProjectPath); // in the Place
            }
            catch (Exception _e)                                   // TODO cause!!! read-only, etc...
            {
                MessageBox.Show(this, "Error " + _e.Message, "title", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.DialogResult = DialogResult.Cancel; // TODO
            }

            ProjectsDB.AddProjectToDB(aStorage, aPlaceName, aProjectName, aProjectPath, _localPath);

            this.DialogResult = DialogResult.OK;
        }
示例#21
0
        public ProjectReceivedDlg()
        {
            InitializeComponent();

            aHelpProvider.HelpNamespace = MMUtils.instPath + "\\Synergy.chm";
            aHelpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            aHelpProvider.SetHelpKeyword(this, "publishmap.htm"); // TODO

            Text              = MMUtils.GetString("receivedprojectdlg.dlgtitle.text");
            lblProject.Text   = MMUtils.GetString("receivedprojectdlg.lblPlace.text");
            lblOr.Text        = MMUtils.GetString("publishmapdlg.lblOr.text");
            linkNewPlace.Text = MMUtils.GetString("receivedmapdlg.linkNewPlace.text");
            btnCancel.Text    = MMUtils.GetString("buttonCancel.text");
        }
示例#22
0
        public LinkToFileDlg()
        {
            InitializeComponent();

            aHelpProvider.HelpNamespace = MMUtils.instPath + "\\Synergy.chm";
            aHelpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            aHelpProvider.SetHelpKeyword(this, "publishmap.htm"); // TODO

            // TODO
            Text         = MMUtils.GetString("publishmapdlg.dlgtitle.text");
            lblLink.Text = MMUtils.GetString("publishmapdlg.lblPickProject.text");
            btnYes.Text  = MMUtils.GetString("publishmapdlg.lblOr.text");
            btnNo.Text   = MMUtils.GetString("publishmapdlg.linkNewProject.text");
        }
示例#23
0
        public ShareMapDlg(string _mapname, string _mapfolderPath)
        {
            InitializeComponent();

            aHelpProvider.HelpNamespace = MMUtils.instPath + "\\Synergy.chm";
            aHelpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            aHelpProvider.SetHelpKeyword(this, "share.htm");

            Text = MMUtils.GetString("sharemapdlg.dlgtitle.text");
            lblFolderToShare.Text = MMUtils.GetString("sharemapdlg.lblFolderToShare.text");
            lblMessage.Text       = MMUtils.GetString("sharemapdlg.lblMessage.text");
            lblPath.Text          = _mapfolderPath;
            txtMessage.Text       = String.Format(MMUtils.GetString("sharemapdlg.txtMessage.text"), _mapname);
            btnOpenFolder.Text    = MMUtils.GetString("sharemapdlg.btnOpenFolder.text");
        }
示例#24
0
        public NewNetworkDiskDlg()
        {
            InitializeComponent();

            aHelpProvider.HelpNamespace = MMUtils.instPath + "\\Synergy.chm";
            aHelpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            aHelpProvider.SetHelpKeyword(this, "publishmap.htm"); // TODO

            Text                   = MMUtils.GetString("newnetworkdiskdlg.dlgtitle");
            lblDiskName.Text       = MMUtils.GetString("newnetworkdiskdlg.lblDiskName.text");
            lblDiskNameExists.Text = "";
            btnCancel.Text         = MMUtils.GetString("buttonCancel.text");
            btnNext.Text           = MMUtils.GetString("buttonNext.text");
            btnBack.Text           = MMUtils.GetString("buttonBack.text");
        }
示例#25
0
 void m_cmdPublishMap_Click()
 {
     using (PublishMaptDlg _dlg = new PublishMaptDlg(MMUtils.ActiveDocument))
     {
         System.Windows.Forms.DialogResult result = _dlg.ShowDialog(new WindowWrapper((IntPtr)MMUtils.MindManager.hWnd));
         if (result == System.Windows.Forms.DialogResult.Cancel)
         {
             System.Windows.Forms.MessageBox.Show(MMUtils.GetString("maps.nosuccessmessage.text"));
         }
         if (result == System.Windows.Forms.DialogResult.OK)
         {
             System.Windows.Forms.MessageBox.Show(MMUtils.GetString("maps.successmessage.text"));
         }
     }
 }
示例#26
0
        public void Create(ribbonTab myTab)
        {
            m_myTab = myTab;
            string imagePath = MMUtils.imagePath;

            m_rgProjects = m_myTab.Groups.Add(0, MMUtils.GetString("projects.group.name"), "www.palmaross.com", imagePath + "lists_s.png");

            m_cmdNewProject                = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "NewProject");
            m_cmdNewProject.Caption        = MMUtils.GetString("projects.commands.newproject.caption");
            m_cmdNewProject.ToolTip        = MMUtils.GetString("projects.commands.newproject.tooltip") + "\n" + m_cmdNewProject.Caption;
            m_cmdNewProject.LargeImagePath = imagePath + "common_stock.png";
            m_cmdNewProject.ImagePath      = imagePath + "audio.png";
            m_cmdNewProject.UpdateState   += new ICommandEvents_UpdateStateEventHandler(m_cmdNewProject_UpdateState);
            m_cmdNewProject.Click         += new ICommandEvents_ClickEventHandler(m_cmdNewProject_Click);
            m_ctrlNewProject               = m_rgProjects.GroupControls.AddButton(m_cmdNewProject);

            m_cmdManageProjects                = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "ManageProjects");
            m_cmdManageProjects.Caption        = MMUtils.GetString("projects.commands.manageprojects.caption");
            m_cmdManageProjects.ToolTip        = MMUtils.GetString("projects.commands.manageprojects.tooltip") + "\n" + m_cmdManageProjects.Caption;
            m_cmdManageProjects.LargeImagePath = imagePath + "common_stock.png";
            m_cmdManageProjects.ImagePath      = imagePath + "audio.png";
            m_cmdManageProjects.UpdateState   += new ICommandEvents_UpdateStateEventHandler(m_cmdManageProjects_UpdateState);
            m_cmdManageProjects.Click         += new ICommandEvents_ClickEventHandler(m_cmdManageProjects_Click);
            m_ctrlManageProjects               = m_rgProjects.GroupControls.AddTwoPartButton(m_cmdManageProjects);

            m_cmdShareProjects                = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "ShareProjects");
            m_cmdShareProjects.Caption        = MMUtils.GetString("projects.commands.shareprojects.caption");
            m_cmdShareProjects.ToolTip        = MMUtils.GetString("projects.commands.shareprojects.tooltip") + "\n" + m_cmdShareProjects.Caption;
            m_cmdShareProjects.LargeImagePath = imagePath + "common_stock.png";
            m_cmdShareProjects.ImagePath      = imagePath + "audio.png";
            m_cmdShareProjects.UpdateState   += new ICommandEvents_UpdateStateEventHandler(m_cmdShareProjects_UpdateState);
            m_cmdShareProjects.Click         += new ICommandEvents_ClickEventHandler(m_cmdShareProjects_Click);
            m_ctrlShareProjects               = m_rgProjects.GroupControls.AddButton(m_cmdShareProjects);

            m_cmdShareProject              = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "ShareProject");
            m_cmdShareProject.Caption      = MMUtils.GetString("projects.commands.shareproject.caption");
            m_cmdShareProject.ImagePath    = imagePath + "audio.png";
            m_cmdShareProject.Click       += new ICommandEvents_ClickEventHandler(m_cmdShareProject_Click);
            m_cmdShareProject.UpdateState += new ICommandEvents_UpdateStateEventHandler(m_cmdShareProject_UpdateState);
            m_ctrlShareProject             = m_ctrlShareProjects.Controls.AddButton(m_cmdShareProject);

            m_cmdReceiveProject              = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "ReceiveProject");
            m_cmdReceiveProject.Caption      = MMUtils.GetString("projects.commands.receiveproject.caption");
            m_cmdReceiveProject.ImagePath    = imagePath + "audio.png";
            m_cmdReceiveProject.Click       += new ICommandEvents_ClickEventHandler(m_cmdReceiveProject_Click);
            m_cmdReceiveProject.UpdateState += new ICommandEvents_UpdateStateEventHandler(m_cmdReceiveProject_UpdateState);
            m_ctrlReceiveProject             = m_ctrlShareProjects.Controls.AddButton(m_cmdReceiveProject);
        }
示例#27
0
        public void Create(ribbonTab myTab)
        {
            m_myTab = myTab;
            string imagePath = MMUtils.imagePath;

            m_rgMaps = m_myTab.Groups.Add(0, MMUtils.GetString("about.group.name"), "www.palmaross.com", imagePath + "lists_s.png");

            m_cmdHelp                = MMUtils.MindManager.Commands.Add(MMUtils.AddinName, "SynergyHelp");
            m_cmdHelp.Caption        = MMUtils.GetString("about.commands.help.caption");
            m_cmdHelp.ToolTip        = MMUtils.GetString("about.commands.help.tooltip") + "\n" + m_cmdHelp.Caption;
            m_cmdHelp.LargeImagePath = MMUtils.imagePath + "common_stock.png";
            m_cmdHelp.ImagePath      = imagePath + "audio.png";
            m_cmdHelp.UpdateState   += new ICommandEvents_UpdateStateEventHandler(m_cmdHelp_UpdateState);
            m_cmdHelp.Click         += new ICommandEvents_ClickEventHandler(m_cmdHelp_Click);
            m_ctrlHelp               = m_rgMaps.GroupControls.AddButton(m_cmdHelp);
        }
示例#28
0
        public SiteVerificationDlg(string _site)
        {
            InitializeComponent();

            aHelpProvider.HelpNamespace = MMUtils.instPath + "\\Synergy.chm";
            aHelpProvider.SetHelpNavigator(this, HelpNavigator.Topic);
            aHelpProvider.SetHelpKeyword(this, "publishmap.htm"); // TODO

            Text           = MMUtils.GetString("siteverificationdlg.dlgtitle");
            btnCancel.Text = MMUtils.GetString("buttonCancel.text");
            btnOK.Text     = MMUtils.GetString("siteverificationdlg.btnOK.text");
            btnVerify.Text = MMUtils.GetString("siteverificationdlg.btnVerify.text");

            lblMessage.Text = String.Format(MMUtils.GetString("siteverificationdlg.lblNewStorageName.text"),
                                            btnVerify.Text, btnOK.Text);

            aSite = _site;
        }
示例#29
0
        string AddNewPlace(string storagetype)
        {
            using (Maps.GetPathDlg dlg = new Maps.GetPathDlg(aPlaceName, "", "newplace", storagetype))
            {
                DialogResult result = dlg.ShowDialog(new WindowWrapper((IntPtr)MMUtils.MindManager.hWnd));
                aPlacePath = dlg.aFolder;

                if (result == DialogResult.Cancel)
                {
                    return("cancel");
                }
                if (result == DialogResult.Retry)
                {
                    return("back");
                }
            }

            aPlacePath = aPlacePath + "Synergy\\";

            try
            {
                System.IO.Directory.CreateDirectory(MMUtils.m_SynergyLocalPath + aPlaceName);
                System.IO.Directory.CreateDirectory(aPlacePath);
            }
            catch (Exception _e) // TODO cause!!! read-only, etc...
            {
                MessageBox.Show(this, "Error " + _e.Message, "title", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.DialogResult = DialogResult.Cancel; // TODO
            }

            using (PlacesDB _db = new PlacesDB())
                _db.ExecuteNonQuery(
                    "INSERT INTO PLACES VALUES(" +
                    "`" + aStorage + "`," +
                    "`" + aPlaceName + "`," +
                    "`" + aPlacePath + "`, ``, ``, 0, 0)");

            if (storagetype == "cloud")
            {
                MessageBox.Show(MMUtils.GetString("newplacedlg.cloudstorage.message"), MMUtils.GetString("newplacedlg.cloudstorage.caption"));
            }

            return("ok");
        }
示例#30
0
        private void LinkNewProject_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            using (Projects.CreateProjectDlg _dlg = new Projects.CreateProjectDlg())
            {
                DialogResult result = _dlg.ShowDialog(new WindowWrapper((IntPtr)MMUtils.MindManager.hWnd));
                if (DialogResult == DialogResult.Cancel)
                {
                    return;
                }
                if (!comboMyProjects.Enabled)
                {
                    comboMyProjects.Items.Remove(MMUtils.GetString("publishmapdlg.noprojects"));
                }

                comboMyProjects.Items.Add(_dlg.txtProjectName.Text);
                comboMyProjects.SelectedIndex = comboMyProjects.Items.Count - 1;
                comboMyProjects.Enabled       = true;
            }
        }