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

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

            OpenWithDialog       = new OpenWithDialog();
            OpenFileAssociations = new List <OpenFileAssociation>();
        }
Ejemplo n.º 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);
        }