~cszikszoy/do-plugins/fix-confluence

« back to all changes in this revision

Viewing changes to Quote/src/Providers/QuoteProviderFactory.cs

  • Committer: Alex Launi
  • Date: 2009-01-06 07:11:16 UTC
  • mto: (407.1.4 trunk)
  • mto: This revision was merged to the branch mainline in revision 409.
  • Revision ID: alex.launi@gmail.com-20090106071116-62bb3zeds067vk2i
Finish first draft of quoting plugin

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* QuoteProviderFactory.cs 
 
2
 *
 
3
 * GNOME Do is the legal property of its developers. Please refer to the
 
4
 * COPYRIGHT file distributed with this
 
5
 * source distribution.
 
6
 *
 
7
 * This program is free software: you can redistribute it and/or modify
 
8
 * it under the terms of the GNU General Public License as published by
 
9
 * the Free Software Foundation, either version 3 of the License, or
 
10
 * (at your option) any later version.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
 */
 
20
 
 
21
using System;
 
22
 
 
23
namespace Quote
 
24
{
 
25
        
 
26
        public class QuoteProviderFactory
 
27
        {
 
28
                                                
 
29
                public static IQuoteProvider GetProviderFromPreferences()
 
30
                {
 
31
                        object [] args = new object [] {};
 
32
                        return GetProviderFromPreferences (args);               
 
33
                }
 
34
 
 
35
                public static IQuoteProvider GetProviderFromPreferences (string text)
 
36
                {
 
37
                        object [] args = new object [] {text};
 
38
                        return GetProviderFromPreferences (args);               
 
39
                }
 
40
 
 
41
                public static IQuoteProvider GetProviderFromPreferences (string text, string syntax)
 
42
                {
 
43
                        object [] args = new object [] {text, syntax};
 
44
                        return GetProviderFromPreferences (args);
 
45
                }
 
46
                                
 
47
                public static IQuoteProvider GetProviderFromPreferences (object [] args)
 
48
                {       
 
49
                        Type providerType = typeof (Bubash);
 
50
                        IQuoteProvider provider = (IQuoteProvider) System.Activator.CreateInstance (providerType, args);
 
51
                        
 
52
                        return provider;
 
53
                }
 
54
        }
 
55
}