• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Instances.Instance类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例5: 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


示例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


示例16: OnClick

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


示例17: CreateAuthFile

        public static string CreateAuthFile(Instance instance, string url = null)
        {
            url = url ?? GenerateAuthUrl();
              var destFileName = Path.Combine(instance.WebRootPath, url.TrimStart('/'));

              CreateFile(destFileName);
              return destFileName;
        }
开发者ID:Sitecore,项目名称:Sitecore-Instance-Manager,代码行数:8,代码来源:CoreInstanceAuth.cs


示例18: OnClick

 public void OnClick(Window mainWindow, Instance instance)
 {
     var result = WindowHelper.ShowDialog<SettingsDialog>(null, mainWindow);
       if (result != null)
       {
     MainWindowHelper.Initialize();
       }
 }
开发者ID:Sitecore,项目名称:Sitecore-Instance-Manager,代码行数:8,代码来源:SettingsButton.cs


示例19: OnClick

 public void OnClick(Window mainWindow, Instance instance)
 {
     WindowHelper.ShowDialog<SettingsDialog>(null, mainWindow);
       if (!LifeManager.IsRestarting)
       {
     MainWindowHelper.Initialize();
       }
 }
开发者ID:Brad-Christie,项目名称:Sitecore-Instance-Manager,代码行数:8,代码来源:SettingsButton.cs


示例20: Browse

 public static void Browse(Instance instance, string virtualPath, bool isFrontEnd, string browser, string[] parameters)
 {
     string url = instance.GetUrl();
       if (!string.IsNullOrEmpty(url))
       {
     url += '/' + virtualPath.TrimStart('/');
     CoreApp.OpenInBrowser(url, isFrontEnd, browser, parameters);
       }
 }
开发者ID:Sitecore,项目名称:Sitecore-Instance-Manager,代码行数:9,代码来源:InstanceHelperEx.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Wizards.WizardArgs类代码示例发布时间:2022-05-26
下一篇:
C# SharedScrUtils.BCVRef类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap