SamePath() публичный статический Метод

True if the two paths are the same. However, two paths to the same file or directory using different network shares or drive letters are not treated as equal.
public static SamePath ( string path1, string path2, bool ignoreCase = false ) : bool
path1 string
path2 string
ignoreCase bool
Результат bool
Пример #1
0
        private void OnApplicationBaseChange()
        {
            if (selectedConfig != null)
            {
                string basePath = null;

                if (view.ApplicationBase.Text != String.Empty)
                {
                    if (!ValidateDirectoryPath("ApplicationBase", view.ApplicationBase.Text))
                    {
                        return;
                    }

                    basePath = Path.Combine(model.BasePath, view.ApplicationBase.Text);
                    if (PathUtils.SamePath(model.BasePath, basePath))
                    {
                        basePath = null;
                    }
                }

                selectedConfig.BasePath = basePath;

                // TODO: Test what happens if we set it the same as doc base
                //if (index.RelativeBasePath == null)
                //    view.ApplicationBase.Text = string.Empty;
                //else
                //    view.ApplicationBase.Text = index.RelativeBasePath;
            }
        }
Пример #2
0
        private void ApplicationBase_Validated()
        {
            if (_selectedConfig != null)
            {
                string basePath = null;

                if (_view.ApplicationBase.Text != String.Empty)
                {
                    if (!ValidateDirectoryPath("ApplicationBase", _view.ApplicationBase.Text))
                    {
                        return;
                    }

                    basePath = Path.Combine(_model.BasePath, _view.ApplicationBase.Text);
                    if (PathUtils.SamePath(_model.BasePath, basePath))
                    {
                        basePath = null;
                    }
                }

                _selectedConfig.BasePath = basePath;

                // TODO: Test what happens if we set it the same as project base
                //if (index.RelativeBasePath == null)
                //    _view.ApplicationBase.Text = string.Empty;
                //else
                //    _view.ApplicationBase.Text = index.RelativeBasePath;
            }
        }
Пример #3
0
        private void UpdateApplicationBase(string appbase)
        {
            string basePath = null;

            if (appbase != String.Empty)
            {
                basePath = Path.Combine(model.BasePath, appbase);
                if (PathUtils.SamePath(model.BasePath, basePath))
                {
                    basePath = null;
                }
            }

            IProjectConfig selectedConfig = model.Configs[view.ConfigList.SelectedIndex];

            view.ApplicationBase.Text = selectedConfig.BasePath = basePath;

            // TODO: Test what happens if we set it the same as doc base
            //if (index.RelativeBasePath == null)
            //    applicationBaseTextBox.Text = string.Empty;
            //else
            //    applicationBaseTextBox.Text = index.RelativeBasePath;
        }