Beispiel #1
0
 protected override BplProfile LoadModel() {
    var profile = new BplProfile();
    profile.Add(AppDomain.CurrentDomain.Load("Mpcr.Database.Oscar"));
    profile.Add(AppDomain.CurrentDomain.Load("Mpcr.Services.Oscar"));
    profile.Add(AppDomain.CurrentDomain.Load("Oscar.Server.Analyzer"));
    return profile;
 }
Beispiel #2
0
 /// <summary />
 protected override BplProfile LoadModel() {
    var profile = new BplProfile();
    profile.Add(AppDomain.CurrentDomain.Load("Mpcr.Database.Oscar"));
    profile.Add(AppDomain.CurrentDomain.Load("Mpcr.Services.Oscar"));
    profile.Add(AppDomain.CurrentDomain.Load("Mpcr.Messages.AutOS_SW"));
    profile.Add(AppDomain.CurrentDomain.Load("Mpcr.Messages.AutOS_CC"));
    return profile;
 }
Beispiel #3
0
 /// <summary/>
 protected sealed override BplProfile LoadModel() {
    var profile = new BplProfile();
    return profile;
 }
Beispiel #4
0
      /// <summary>Loads the BPL model.</summary>
      internal void LoadBpl() {
         var profile = LoadModel();
         var safeProfile = new BplProfile(ServiceName);
         safeProfile.Add(AppDomain.CurrentDomain.Load("Mpcr.Core"));
         safeProfile.Add(AppDomain.CurrentDomain.Load("Mpcr.Model"));
         safeProfile.Add(AppDomain.CurrentDomain.Load("Mpcr.Services.Oscar"));
         if (profile != null) {
            safeProfile.Add(profile.Types);
         }
         safeProfile.Seal();

         BplLanguage.RuntimeMode = BplRuntimeMode.Batch;
         BplLanguage.Load(safeProfile, BplLoadingOptions.ThreadSafe);
         BplLanguage.LoadTaxonomies(Path.Combine(StartupFolder, "Taxonomies"));
         BplLanguage.TimeZone = TimeZoneInfo.Local.GetUtcOffset(DateTime.Now);

         // strangely, this is the simplest way to auto-adjust for time/DST changes (SystemEvents.TimeChange comes via WM_TIMECHANGED message, so it demands and window proc)
         _timeTimer = new Timer(t => { BplLanguage.TimeZone = TimeZoneInfo.Local.GetUtcOffset(DateTime.Now); }, null, TimeSpan.Zero, TimeSpan.FromMinutes(1));

         if (ServerBehavior.IsServer) {
            ServiceManager.InitializeHandlers();
         }
         if (ServerBehavior.IsClient) {
            ServiceManager.InitializeInvokers();
         }
      }
Beispiel #5
0
      private void _loadModel(string profileName, IEnumerable<string> moduleNames) {
         LoadingPopup.IsOpen = true;

         LeadingVersion = new Version();
         LeadingTimestamp = DateTime.MinValue;
         var profile = new BplProfile(profileName);
         profile.Add(typeof(BplObject).Assembly);
         foreach (var name in moduleNames) {
            var assembly = AppDomain.CurrentDomain.Load(Path.GetFileNameWithoutExtension(name));
            profile.Add(assembly);
            var date = File.GetLastWriteTime(Path.Combine(AssembliesFolder, name));
            if (date > LeadingTimestamp) LeadingTimestamp = date;
            var version = assembly.GetName().Version;
            if (version > LeadingVersion) LeadingVersion = version;

         }
         profile.Seal();
         ViewName = null;

         BplLanguage.Load(profile);
         BplLanguage.LoadTaxonomies(TaxonomiesFolder);

         LoadedClasses = new ReadOnlySet<BplClass>(BplLanguage.Classes);

         _selectedClasses = new HashSet<BplClass>();
         SelectedClasses = new ReadOnlySet<BplClass>(_selectedClasses);

         _hiddenClasses = new HashSet<BplClass>();
         HiddenClasses = new ReadOnlySet<BplClass>(_hiddenClasses);

         _applyClassFilter();
         _onModelLoaded();

         GuiTimer.StartAfterRender(t => {
            try {
               if (File.Exists(SettingsFile)) {
                  var snapshot = DiagramSnapshot.Load(SettingsFile);
                  snapshot.Restore(DiagramViewer);
               }
            } catch { }
         });

         GuiTimer.StartAfterRender(t => _loadDocumentation());
      }