Exemple #1
0
 void GetPreviouslyOpenedTypeLibraries()
 {
     foreach (string typeLib in PreviouslyOpenedTypeLibraries)
     {
         List.Add(PreviouslyOpenedTypeLibrary.ConvertFromString(typeLib));
     }
 }
		public void Remove(PreviouslyOpenedTypeLibrary typeLib)
		{
			if (List.Contains(typeLib)) {
				List.Remove(typeLib);
				UpdateProperties();
			}
		}
Exemple #3
0
 public void Remove(PreviouslyOpenedTypeLibrary typeLib)
 {
     if (List.Contains(typeLib))
     {
         List.Remove(typeLib);
         UpdateProperties();
     }
 }
Exemple #4
0
 void UpdateProperties()
 {
     string[] items = new string[List.Count];
     for (int i = 0; i < Count; ++i)
     {
         PreviouslyOpenedTypeLibrary typeLib = (PreviouslyOpenedTypeLibrary)List[i];
         items[i] = typeLib.ConvertToString();
     }
     PreviouslyOpenedTypeLibraries = items;
 }
Exemple #5
0
 int IndexOf(string fileName)
 {
     for (int i = 0; i < Count; ++i)
     {
         PreviouslyOpenedTypeLibrary typeLib = (PreviouslyOpenedTypeLibrary)List[i];
         if (typeLib.FileName == fileName)
         {
             return(i);
         }
     }
     return(-1);
 }
Exemple #6
0
        // Restore the typelibs/controls that were previously loaded
        public static void RestoreComEnvironment()
        {
            if (_typelibs.Count == 0)
            {
                return;
            }
            ProgressDialog progressDialog = new ProgressDialog();

            progressDialog.Setup("Loading Remembered ActiveX Files",
                                 "Please wait while I load the previously " +
                                 "opened ActiveX files.",
                                 _typelibs.Count,
                                 ProgressDialog.HAS_PROGRESS_TEXT,
                                 ProgressDialog.FINAL);
            progressDialog.ShowIfNotDone();
            TraceUtil.WriteLineInfo(null, DateTime.Now + " ActiveX Restore start ");
            try {
                for (int i = _typelibs.Count - 1; i >= 0; --i)
                {
                    PreviouslyOpenedTypeLibrary typeLib = _typelibs[i];
                    try {
                        TraceUtil.WriteLineInfo(null, DateTime.Now + " restore assy: " + typeLib.FileName);
                        progressDialog.UpdateProgressText(typeLib.FileName);
                        Guid guid = new Guid(typeLib.Guid);
                        TypeLibrary.RestoreTypeLib(typeLib.FileName, guid, typeLib.Version);
                        TraceUtil.WriteLineInfo(null, DateTime.Now + " loaded assy: " + typeLib.FileName);
                        progressDialog.UpdateProgress(1);
                    } catch (Exception ex) {
                        TraceUtil.WriteLineWarning(null,
                                                   "Assemblies - deleting bad assemblies entry: "
                                                   + typeLib.FileName + " " + ex);
                        _typelibs.Remove(typeLib);
                        progressDialog.UpdateProgress(1);
                    }
                }
                // This depends on having all of the assemblies restored
                TraceUtil.WriteLineInfo(null, DateTime.Now + " ActiveX Restore end ");
            } catch (Exception ex) {
                TraceUtil.WriteLineError(null, "Unexpected exception "
                                         + "restoring assemblies: " + ex);
            }
            progressDialog.Finished();
            if (ComponentInspectorProperties.AddRunningComObjects)
            {
                AddRunningObjs();
            }
            FavoriteTypeLibNode.Expand();
        }
Exemple #7
0
 public void Add(PreviouslyOpenedTypeLibrary typeLib)
 {
     List.Add(typeLib);
     UpdateProperties();
 }
		public void Add(PreviouslyOpenedTypeLibrary typeLib)
		{
			List.Add(typeLib);
			UpdateProperties();
		}