예제 #1
0
 public SdkPage()
 {
     try
     {
         plcncliCommunication = Package.GetGlobalService(typeof(SPlcncliCommunication)) as IPlcncliCommunication;
         model       = new SDKPageModel(plcncliCommunication);
         viewModel   = new SDKPageViewModel(model);
         PageControl = new SDKPageControl(viewModel);
     }
     catch (Exception e)
     {
         ThreadHelper.ThrowIfNotOnUIThread();
         IVsActivityLog log = Package.GetGlobalService(typeof(SVsActivityLog)) as IVsActivityLog;
         log.LogEntry((uint)__ACTIVITYLOG_ENTRYTYPE.ALE_ERROR, this.ToString(),
                      "An error occurred while creating the sdk page: " + e.Message);
     }
 }
예제 #2
0
 public SDKPageControl(SDKPageViewModel viewModel)
 {
     this.DataContext = viewModel;
     try
     {
         InitializeComponent();
     }
     catch (Exception e)
     {
         ThreadHelper.ThrowIfNotOnUIThread();
         IVsActivityLog log = Package.GetGlobalService(typeof(SVsActivityLog)) as IVsActivityLog;
         if (log == null)
         {
             return;
         }
         log.LogEntry((uint)__ACTIVITYLOG_ENTRYTYPE.ALE_ERROR, this.ToString(),
                      "Component initialization failed: " + e.Message);
     }
 }