~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to samples/ComponentInspector/ComponentInspector.Core/Src/ObjectBrowser/PreviouslyOpenedTypeLibrary.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// <file>
 
2
//     <copyright see="prj:///doc/copyright.txt"/>
 
3
//     <license see="prj:///doc/license.txt"/>
 
4
//     <owner name="Oakland Software Incorporated" email="general@oaklandsoftware.com"/>
 
5
//     <version>$Revision$</version>
 
6
// </file>
 
7
 
 
8
using System;
 
9
 
 
10
namespace NoGoop.ObjBrowser
 
11
{
 
12
        /// <summary>
 
13
        /// Stores the information about a type library that was opened the last 
 
14
        /// time the ComponentInspector was run.
 
15
        /// </summary>
 
16
        public class PreviouslyOpenedTypeLibrary
 
17
        {
 
18
                string fileName = String.Empty;
 
19
                string guid = String.Empty;
 
20
                string version = String.Empty;
 
21
                
 
22
                public PreviouslyOpenedTypeLibrary(string fileName, string guid, string version)
 
23
                {
 
24
                        this.fileName = fileName;
 
25
                        if (guid != null) {
 
26
                                this.guid = guid;
 
27
                        }
 
28
                        if (version != null) {
 
29
                                this.version = version;
 
30
                        }
 
31
                }
 
32
                
 
33
                /// <summary>
 
34
                /// Converts from a string saved in the properties file.
 
35
                /// </summary>
 
36
                public static PreviouslyOpenedTypeLibrary ConvertFromString(string s)
 
37
                {
 
38
                        string[] parts = s.Split('|');
 
39
                        return new PreviouslyOpenedTypeLibrary(parts[0], parts[1], parts[2]);
 
40
                }
 
41
                
 
42
                /// <summary>
 
43
                /// Turns a PreviouslyOpenedLibrary class into a string that can be
 
44
                /// saved in the properties file.
 
45
                /// </summary>
 
46
                public string ConvertToString()
 
47
                {
 
48
                        return String.Concat(fileName, "|", guid, "|", version);
 
49
                }
 
50
                
 
51
                public string FileName {
 
52
                        get {
 
53
                                return fileName;
 
54
                        }
 
55
                }
 
56
                
 
57
                public string Version {
 
58
                        get {
 
59
                                return version;
 
60
                        }
 
61
                }
 
62
                
 
63
                public string Guid {
 
64
                        get {
 
65
                                return guid;
 
66
                        }
 
67
                }
 
68
        }
 
69
}