当前位置: 首页>>代码示例>>C#>>正文


C# Instances.Instance类代码示例

本文整理汇总了C#中SIM.Instances.Instance的典型用法代码示例。如果您正苦于以下问题:C# Instance类的具体用法?C# Instance怎么用?C# Instance使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Instance类属于SIM.Instances命名空间,在下文中一共展示了Instance类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnClick

        public void OnClick(Window mainWindow, Instance instance)
        {
            Assert.ArgumentNotNull(mainWindow, "mainWindow");

              var instances = InstanceManager.PartiallyCachedInstances ?? InstanceManager.Instances;
              Assert.IsNotNull(instances, "instances");

              var otherInstances = instances.Where(x => x.ID != instance.ID);
              foreach (var otherInstance in otherInstances)
              {
            if (otherInstance == null)
            {
              continue;
            }

            try
            {
              var processIds = otherInstance.ProcessIds;
              foreach (var processId in processIds)
              {
            var process = Process.GetProcessById(processId);

            Log.Info("Killing process " + processId, this);
            process.Kill();
              }
            }
            catch (Exception ex)
            {
              Log.Warn("An error occurred", this, ex);
            }
              }
        }
开发者ID:Brad-Christie,项目名称:Sitecore-Instance-Manager,代码行数:32,代码来源:KillAllButThisButton.cs

示例2: OnClick

        public void OnClick(Window mainWindow, Instance instance)
        {
            Assert.ArgumentNotNull(mainWindow, "mainWindow");

              var instances = InstanceManager.Instances;
              Assert.IsNotNull(instances, "instances");

              var otherInstances = instances.Where(x => x.ID != instance.ID);
              foreach (var otherInstance in otherInstances)
              {
            try
            {
              if (otherInstance == null)
              {
            continue;
              }

              Log.Info("Recycling instance " + otherInstance, this);
              otherInstance.Recycle();
            }
            catch (Exception ex)
            {
              Log.Warn("An error occurred", this, ex);
            }
              }
        }
开发者ID:alienlab,项目名称:Sitecore-Instance-Manager-Lite,代码行数:26,代码来源:RecycleAllButThisButton.cs

示例3: OnClick

 public void OnClick(Window mainWindow, Instance instance)
 {
     if (EnvironmentHelper.CheckSqlServer())
       {
     WindowHelper.ShowDialog(new DatabasesDialog(), mainWindow);
       }
 }
开发者ID:Sitecore,项目名称:Sitecore-Instance-Manager,代码行数:7,代码来源:DatabaseManagerButton.cs

示例4: OnClick

        public void OnClick(Window mainWindow, Instance instance)
        {
            Analytics.TrackEvent("Refresh");

              using (new ProfileSection("Refresh main window instances", this))
              {
            ProfileSection.Argument("mainWindow", mainWindow);
            ProfileSection.Argument("instance", instance);

            var refreshMode = this.GetMode(mainWindow);
            switch (refreshMode)
            {
              case RefreshMode.Instances:
            MainWindowHelper.RefreshInstances();
            return;
              case RefreshMode.Installer:
            MainWindowHelper.RefreshInstaller();
            return;
              case RefreshMode.Caches:
            MainWindowHelper.RefreshCaches();
            return;
              case RefreshMode.Everything:
            MainWindowHelper.RefreshEverything();
            return;
            }
              }
        }
开发者ID:Sitecore,项目名称:Sitecore-Instance-Manager,代码行数:27,代码来源:RefreshButton.cs

示例5: CopyAgentFiles

    public static void CopyAgentFiles(Instance instance)
    {
      Assert.ArgumentNotNull(instance, "instance");

      string agent = Path.Combine(instance.WebRootPath, AgentHelper.AgentPath);
      FileSystem.FileSystem.Local.Directory.Ensure(agent);

      var files = new[]
      {
        new
        {
          FileName = PublishAgentFiles.PublishFileName, 
          Contents = PublishAgentFiles.PublishContents
        }, 
        new
        {
          FileName = PublishAgentFiles.StatusFileName, 
          Contents = PublishAgentFiles.StatusContents
        }
      };

      foreach (var file in files)
      {
        string targetFilePath = Path.Combine(agent, file.FileName);
        FileSystem.FileSystem.Local.Directory.DeleteIfExists(targetFilePath);
        FileSystem.FileSystem.Local.File.WriteAllText(targetFilePath, file.Contents);
      }
    }
开发者ID:lennartfranke,项目名称:Sitecore-Instance-Manager,代码行数:28,代码来源:PublishAgentHelper.cs

示例6: DoUpdateLicense

 private static void DoUpdateLicense(string licenseFilePath, Instance instance)
 {
     if (instance != null)
       {
     try
     {
       FileSystem.FileSystem.Local.File.Copy(licenseFilePath, instance.LicencePath, true);
     }
     catch (Exception ex)
     {
       Log.Error(ex.Message, typeof(LicenseUpdater), ex);
     }
       }
       else
       {
     foreach (Instance inst in InstanceManager.Instances)
     {
       try
       {
     FileSystem.FileSystem.Local.File.Copy(licenseFilePath, inst.LicencePath, true);
       }
       catch (Exception ex)
       {
     Log.Error(ex.Message, typeof(LicenseUpdater), ex);
       }
     }
       }
 }
开发者ID:alienlab,项目名称:Sitecore-Instance-Manager-Lite,代码行数:28,代码来源:LicenseUpdater.cs

示例7: OnClick

 public void OnClick(Window mainWindow, Instance instance)
 {
     if (FileSystem.FileSystem.Local.Directory.Exists(ProfileManager.Profile.LocalRepository))
       {
     WizardPipelineManager.Start("download8", mainWindow, null, null, MainWindowHelper.RefreshInstaller, WindowsSettings.AppDownloaderSdnUserName.Value, WindowsSettings.AppDownloaderSdnPassword.Value);
       }
 }
开发者ID:Brad-Christie,项目名称:Sitecore-Instance-Manager,代码行数:7,代码来源:Download8Button.cs

示例8: OnClick

        public void OnClick(Window mainWindow, Instance instance)
        {
            Assert.ArgumentNotNull(mainWindow, "mainWindow");

              if (instance == null)
              {
            Run(mainWindow, string.Empty);
            return;
              }

              var ids = (instance.ProcessIds ?? new int[0]).ToArray();
              if (ids.Length == 0)
              {
            WindowHelper.HandleError("No running w3wp processes for this Sitecore instance", false);
            return;
              }

              foreach (var id in ids)
              {
            var defaultValue = id.ToString(CultureInfo.InvariantCulture);
            if (Run(mainWindow, defaultValue))
            {
              return;
            }
              }
        }
开发者ID:Brad-Christie,项目名称:Sitecore-Instance-Manager,代码行数:26,代码来源:ManagedArgsTracerButton.cs

示例9: ClickDetailsWrapper

 public ClickDetailsWrapper(MouseClickInformation clickDetails, Instance instance, EventArgs rawArgs)
 {
     this.ClickDetails = clickDetails;
       this.Instance = instance;
       this.RawArgs = rawArgs;
       this.IsInstanceClick = instance != null;
 }
开发者ID:Zvirja,项目名称:TrayPluginProductivityKit,代码行数:7,代码来源:ClickDetailsWrapper.cs

示例10: GetIconForInstance

        protected virtual Image GetIconForInstance(Instance instance)
        {
            string version = instance.Product.ShortVersion;
              string instanceName = instance.Name;

              if (this.InternalCache.ContainsKey(instanceName))
              {
            return this.InternalCache[instanceName];
              }

              Image resolvedImage = null;
              if (!version.IsNullOrEmpty() && version.Length > 1)
              {
            var shortVersion = version.Substring(0, 2);
            var resolvedIcon = MultisourceResourcesManager.GetIconResource("sc" + shortVersion, null);
            if (resolvedIcon != null)
            {
              resolvedImage = resolvedIcon.ToBitmap();
            }
              }

              if (resolvedImage == null && this.DefaultIcon != null)
              {
            resolvedImage = this.DefaultIcon.ToBitmap();
              }

              this.InternalCache.Add(instanceName, resolvedImage);
              return resolvedImage;
        }
开发者ID:Zvirja,项目名称:TrayPluginProductivityKit,代码行数:29,代码来源:IconsPatcher.cs

示例11: ReinstallArgs

        public ReinstallArgs(Instance instance, SqlConnectionStringBuilder connectionString, string license, string webServerIdentity, bool serverSideRedirect)
        {
            this.ConnectionString = connectionString;
              this.Name = instance.Name;
              this.Bindings = instance.Bindings;
              this.Product = instance.Product;
              this.WebRootPath = instance.WebRootPath;
              this.RootPath = instance.RootPath;
              this.DataFolderPath = instance.DataFolderPath;
              this.DatabasesFolderPath = Path.Combine(this.RootPath, "Databases");
              this.WebServerIdentity = webServerIdentity;
              this.LicenseFilePath = license;
              this.Modules = new Product[0];
              this.IsClassic = instance.IsClassic;
              this.Is32Bit = instance.Is32Bit;
              this.ForceNetFramework4 = instance.IsNetFramework4;
              this.ServerSideRedirect = serverSideRedirect;
              this.TempFolder = Path.Combine(this.RootPath, "Temp");
              this.InstanceDatabases = instance.AttachedDatabases;
              this.instanceName = instance.Name;
              this.StopInstance = instance.Stop;
              this.WebsiteID = instance.ID;

              var executionTimeout = UpdateWebConfigHelper.GetHttpRuntime(instance.GetWebResultConfig()).GetAttribute("executionTimeout");
              this.IncreaseExecutionTimeout = string.IsNullOrEmpty(executionTimeout) || executionTimeout != "600";
        }
开发者ID:Sitecore,项目名称:Sitecore-Instance-Manager,代码行数:26,代码来源:ReinstallArgs.cs

示例12: ProcessInstanceClickInternal

 protected override bool ProcessInstanceClickInternal(Instance instance)
 {
     if (OSShellHelper.ConfirmFileRun("Visual Studio project"))
       {
     return base.ProcessInstanceClickInternal(instance);
       }
       return true;
 }
开发者ID:Zvirja,项目名称:TrayPluginProductivityKit,代码行数:8,代码来源:OpenVisualStudioProjectWithConfirmation.cs

示例13: InstallModulesWizardArgs

 public InstallModulesWizardArgs(Instance instance = null)
 {
     this.Instance = instance;
       if (instance != null)
       {
     this.WebRootPath = instance.WebRootPath;
       }
 }
开发者ID:Brad-Christie,项目名称:Sitecore-Instance-Manager,代码行数:8,代码来源:InstallModulesWizardArgs.cs

示例14: OnClick

 public void OnClick(Window mainWindow, Instance instance)
 {
     if (instance != null)
       {
     var id = MainWindowHelper.GetListItemID(instance.ID);
     WizardPipelineManager.Start("installmodules", mainWindow, null, null, () => MainWindowHelper.MakeInstanceSelected(id), instance);
       }
 }
开发者ID:Brad-Christie,项目名称:Sitecore-Instance-Manager,代码行数:8,代码来源:InstallModulesButton.cs

示例15: OnClick

        public void OnClick(Window mainWindow, Instance instance)
        {
            Assert.ArgumentNotNull(mainWindow, "mainWindow");

              Assert.IsNotNull(instance, "instance");

              InstanceHelperEx.OpenInBrowserAsAdmin(instance, mainWindow, this.VirtualPath, this.Browser, this.Params);
        }
开发者ID:Brad-Christie,项目名称:Sitecore-Instance-Manager,代码行数:8,代码来源:LoginAdminButton.cs


注:本文中的SIM.Instances.Instance类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。