Exemple #1
0
 protected override OpenEditorCallback UISelectOpenEditorCallback(
     string path)
 {
     return(OpenWithDialog.ShowDialog(Owner) == DialogResult.OK
         ? OpenWithDialog.OpenEditorCallback
         : null);
 }
Exemple #2
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                OpenFileDialog.Dispose();
                OpenWithDialog.Dispose();
            }

            base.Dispose(disposing);
        }
Exemple #3
0
        public OpenFileHelper()
            : base()
        {
            OpenFileDialog = new OpenFileDialog
            {
                Multiselect = true,
            };

            OpenWithDialog       = new OpenWithDialog();
            OpenFileAssociations = new List <OpenFileAssociation>();
        }
Exemple #4
0
        public void AddOpenFileAssociation(OpenFileAssociation association)
        {
            if (association is null)
            {
                throw new ArgumentNullException(nameof(association));
            }

            OpenFileAssociations.Add(association);
            OpenWithDialog.AddAssociation(association);
            AddAssociation(
                association.Extension,
                association.OpenEditorCallback);
        }