static PackageSettings() { Active = new PackageSettings { UserId = SettingReader.Get("UserId", 1), }; }
///////////////////////////////////////////////////////////////////////////// // Overridden Package Implementation #region Package Members /// <summary> /// Initialization of the package; this method is called right after the package is sited, so this is the place /// where you can put all the initialization code that rely on services provided by VisualStudio. /// </summary> protected override void Initialize() { Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", ToString())); base.Initialize(); // Add our command handlers for menu (commands must exist in the .vsct file) OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService; if (null != mcs) { // Create the command for the menu item. CommandID menuCommandID = new CommandID(GuidList.guidObjectExporter_CmdSet, (int)PkgCmdIDList.cmdidExportObjects); var menuItem = new OleMenuCommand(MenuItemCallback, menuCommandID); menuItem.BeforeQueryStatus += menuItem_BeforeQueryStatus; mcs.AddCommand(menuItem); } //Initialize Object Exporter settings for use with Aspects (can't pass any objects into constructor) _packageSettings = (PackageSettings)GetDialogPage(typeof(PackageSettings)); GlobalPackageSettings.Initialize(_packageSettings); //Add user information for exception handling with raygun UserInfo info = new UserInfo() { VisualStudioVersion = _dte2.Version }; Raygun.Initialize(info); }
//TODO: can remove PackageSettings and use GlobalPackageSettings public FormSelectObjects(DTE2 dte2, PackageSettings settings) { _dte2 = dte2; _settings = settings; InitializeComponent(); LoadLocals(); TypeRetriever retriever = new TypeRetriever(dte2); List <IRuleSet> ruleSets = new List <IRuleSet>(); if (settings.IgnoreDynamicallyAddedProperties) { ruleSets.Add(new PropertyInClassRuleSet(retriever)); } bool excludePrivates = radCheckBoxExcludePrivate.Checked; if (excludePrivates) { ruleSets.Add(new AccessiblePropertiesRuleSet(retriever)); } _ruleSetValidator = new RuleSetValidator(ruleSets); }
///////////////////////////////////////////////////////////////////////////// // Overridden Package Implementation #region Package Members /// <summary> /// Initialization of the package; this method is called right after the package is sited, so this is the place /// where you can put all the initialization code that rely on services provided by VisualStudio. /// </summary> protected override System.Threading.Tasks.Task InitializeAsync(CancellationToken cancellationToken, IProgress <ServiceProgressData> progress) { // Add our command handlers for menu (commands must exist in the .vsct file) OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService; if (null != mcs) { // Create the command for the menu item. CommandID menuCommandID = new CommandID(GuidList.guidObjectExporter_CmdSet, (int)PkgCmdIDList.cmdidExportObjects); var menuItem = new OleMenuCommand(MenuItemCallback, menuCommandID); menuItem.BeforeQueryStatus += menuItem_BeforeQueryStatus; mcs.AddCommand(menuItem); } //Initialize Object Exporter settings for use with Aspects (can't pass any objects into constructor) _packageSettings = (PackageSettings)GetDialogPage(typeof(PackageSettings)); GlobalPackageSettings.Initialize(_packageSettings); //Add user information for exception handling with raygun UserInfo info = new UserInfo() { VisualStudioVersion = _dte2.Version }; Raygun.Initialize(info); return(base.InitializeAsync(cancellationToken, progress)); }
internal DocumentPackageSettingsBuilder(PackageSettings apiPackageSettings) { enableInPerson = apiPackageSettings.Ceremony.InPerson; enableOptOut = apiPackageSettings.Ceremony.OptOutButton; enableDecline = apiPackageSettings.Ceremony.DeclineButton; hideWatermark = apiPackageSettings.Ceremony.HideWatermark; hideCaptureText = apiPackageSettings.Ceremony.HideCaptureText; foreach (string reason in apiPackageSettings.Ceremony.OptOutReasons) { optOutReasons.Add(reason); } maxAuthAttempts = apiPackageSettings.Ceremony.MaxAuthFailsAllowed; if (apiPackageSettings.Ceremony.DocumentToolbarOptions != null) { showDocumentToolbarDownloadButton = apiPackageSettings.Ceremony.DocumentToolbarOptions.DownloadButton; } if (apiPackageSettings.Ceremony.Events != null && apiPackageSettings.Ceremony.Events.Complete != null) { showDialogOnComplete = apiPackageSettings.Ceremony.Events.Complete.Dialog; } if (apiPackageSettings.Ceremony.HandOver != null) { linkHref = apiPackageSettings.Ceremony.HandOver.Href; linkText = apiPackageSettings.Ceremony.HandOver.Text; linkTooltip = apiPackageSettings.Ceremony.HandOver.Title; } }
private void SaveSettings() { try { PackageSettings settings = new PackageSettings(); settings.PackageId = PanelSecurity.PackageId; settings.SettingsName = SettingsName; // set properties if (ddlOverride.SelectedIndex == 1) { // gather settings from the control // if overriden ctlSettings.SaveSettings(settings); } int result = ES.Services.Packages.UpdatePackageSettings(settings); if (result < 0) { ShowResultMessage(result); return; } ReturnBack(); } catch (Exception ex) { ShowErrorMessage("PACKAGE_SETTINGS_UPDATE", ex); return; } }
private static Organization PopulateOrganization(int packageId, string organizationId, string addressListsContainer) { Organization org = new Organization(); org.OrganizationId = organizationId; org.AddressList = string.Format("CN={0} Address List,CN=All Address Lists,{1}", organizationId, addressListsContainer); org.GlobalAddressList = string.Format("CN={0} Global Address List,CN=All Global Address Lists,{1}", organizationId, addressListsContainer); org.OfflineAddressBook = string.Format("CN={0} Offline Address Book,CN=Offline Address Lists,{1}", organizationId, addressListsContainer); org.Database = GetDatabaseName(); org.DistinguishedName = ADUtils.RemoveADPrefix(Global.OrgDirectoryEntry.Path); org.SecurityGroup = string.Format("CN={0},{1}", organizationId, org.DistinguishedName); PackageContext cntx = PackageController.GetPackageContext(packageId); // organization limits /* * org.IssueWarningKB = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue; * if (org.IssueWarningKB > 0) org.IssueWarningKB *= 1024; * org.ProhibitSendKB = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue; * if (org.ProhibitSendKB > 0) org.ProhibitSendKB *= 1024; * org.ProhibitSendReceiveKB = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue; * if (org.ProhibitSendReceiveKB > 0) org.ProhibitSendReceiveKB *= 1024; */ PackageSettings settings = PackageController.GetPackageSettings(packageId, PackageSettings.EXCHANGE_SERVER); org.KeepDeletedItemsDays = Utils.ParseInt(settings["KeepDeletedItemsDays"], 14); return(org); }
public static void Initialize(PackageSettings settings) { DepthSolverTimeOut = settings.DepthSolverTimeOut; DepthSolverCutOff = settings.DepthSolverCutoff; IgnoreDynamicallyAddedProperties = settings.IgnoreDynamicallyAddedProperties; ErrorReportingEnabled = settings.ErrorReportingEnabled; }
public static List <PackageSettings> GetProjectsToPack(this ICakeContext context) { var solutionRootDirectory = GetRootPath(); var projectsToPack = Directory.GetDirectories(solutionRootDirectory, "*CakeDemo.*", SearchOption.TopDirectoryOnly); var outPutFolder = new DirectoryInfo(Invariant($"{solutionRootDirectory}/packed-for-deploy")).FullName; List <PackageSettings> packageSettings = new List <PackageSettings>(); Directory.CreateDirectory(outPutFolder); foreach (var project in projectsToPack) { if (project.Contains("MyCustomExtensions") || project.Contains("Tests")) { continue; } var projectSettings = new PackageSettings { Id = GetLastSegment(project), Version = "1.0.0.1", Description = Invariant($"The {GetLastSegment(project)} deployment package, built on {DateTime.Now}."), Author = "Strange Issues Department", FilesSource = new DirectoryInfo(Invariant($"{project}/bin")).FullName, OutputDirectory = outPutFolder, Overwrite = true }; packageSettings.Add(projectSettings); } return(packageSettings); }
public static List <PackageSettings> SetProjectsToPack(this ICakeContext context) { var solutionRootDirectory = GetRootPath(); var apiProjects = Directory.GetDirectories(solutionRootDirectory, "*.Api", SearchOption.AllDirectories); var webProjects = Directory.GetDirectories(solutionRootDirectory, "*.Web", SearchOption.AllDirectories).Where(x => !x.Contains(".dotnet")); var projectsToPack = new List <string>(); var outPutFolder = new DirectoryInfo(Invariant($"{solutionRootDirectory}/{NugetPackOutputFolder}")).FullName; List <PackageSettings> packageSettings = new List <PackageSettings>(); Directory.CreateDirectory(outPutFolder); projectsToPack.AddRange(apiProjects); projectsToPack.AddRange(webProjects); foreach (var project in projectsToPack) { var projectSettings = new PackageSettings { Id = GetLastSegment(project), Version = GetProjectVersion(), Description = Invariant($"The {GetLastSegment(project)} deployment package, built on {DateTime.Now}."), Author = "Strange Issues Department", FilesSource = new DirectoryInfo(Invariant($"{project}/bin")).FullName, OutputDirectory = new DirectoryInfo(Invariant($"{solutionRootDirectory}/{NugetPackOutputFolder}")).FullName, Overwrite = true }; packageSettings.Add(projectSettings); } return(packageSettings); }
private void CreateRegistrarDomain(int packageId) { // create command arguments CommandParams args = PrepeareAccountParams(); // ensure user settings are ok & copy them EnsureUserSettings(args); // get package info PackageSettings nsSettings = PackageController.GetPackageSettings( packageId, PackageSettings.NAME_SERVERS ); // read service cycle ServiceLifeCycle lifeCycle = ServiceController.GetServiceLifeCycle( ServiceInfo.SpaceId, ServiceInfo.ServiceId ); // copy domain name related settings args[CommandParams.NAME_SERVERS] = nsSettings[PackageSettings.NAME_SERVERS]; args[CommandParams.DOMAIN_NAME] = Domain; args[CommandParams.DOMAIN_TLD] = TLD; args[CommandParams.YEARS] = lifeCycle.CycleLength.ToString(); // call registrar's API RegisterDomainResult rdResult = Registrar.RegisterDomain(args); // save registrar's order number ServiceSettings[REGISTRAR_ORDER_ID] = rdResult[RegisterDomainResult.ORDER_NUMBER]; ServiceSettings[REGISTRAR] = Registrar.RegistrarName; }
public static void Initialize(PackageSettings settings) { DepthSolverTimeOut = settings.DepthSolverTimeOut; DepthSolverCutOff = settings.DepthSolverCutoff; IgnoreDynamicallyAddedProperties = settings.IgnoreDynamicallyAddedProperties; ErrorReportingEnabled = settings.ErrorReportingEnabled; IgnoreEntityFrameworkProxyTypes = settings.IgnoreEntityFrameworkProxyTypes; }
public void PackageCreateApplySerializeTest() { // create temp directories to be used during patching Path tempDirectory = Utility.GetTempDirectory(); Directory.CreateDirectory(tempDirectory); Path tempSourceCopyDirectory = Utility.GetTempDirectory(); Directory.CreateDirectory(tempSourceCopyDirectory); try { // create a new repo var repo = new Repository(); repo.Name = "Test Repo Name"; repo.Description = "Test Repo Description"; // generate package content Path sourceContentPath = Path.Combine(Environment.CurrentDirectory + "\\", "content\\source\\"); Path targetContentPath = Path.Combine(Environment.CurrentDirectory + "\\", "content\\target\\"); var settings = new PackageSettings(partSize: 40); // test multipart logic var package = new Package(repo, sourceContentPath, targetContentPath, tempDirectory, settings); package.Name = "Initial Update"; // update the source snapshot info package.SourceSnapshot.Name = "Test Original Name"; package.SourceSnapshot.Version = new Version("1.0.0.0"); // update the target snapshot info package.TargetSnapshot.Name = "Test Updated Name"; package.TargetSnapshot.Version = new Version("1.1.0.0"); // bind the new package to the repo repo.Packages.Add(package); // test serialization string json = repo.Serialize(); Repository testRepo = Repository.Deserialize(json); string json2 = testRepo.Serialize(); Assert.AreEqual(json, json2); // copy source directory to temp directory to patch against new Microsoft.VisualBasic.Devices.Computer().FileSystem.CopyDirectory(sourceContentPath, tempSourceCopyDirectory, true); // run the actions targeting the temp package directory package.Apply(Path.Combine(tempDirectory, package.Id + "\\"), tempSourceCopyDirectory); // find method tests (not comprehensive) Assert.AreEqual(repo.FindSnapshotFromDirectory(sourceContentPath), package.SourceSnapshot); Assert.AreEqual(repo.FindSnapshotFromDirectory(targetContentPath), package.TargetSnapshot); } finally { // clean up temp directories Directory.Delete(tempDirectory, true); Directory.Delete(tempSourceCopyDirectory, true); } }
private void BindSettings() { // load user settings PackageSettings settings = ES.Services.Packages.GetPackageSettings(PanelSecurity.PackageId, SettingsName); ddlOverride.SelectedIndex = (settings.PackageId == PanelSecurity.PackageId) ? 1 : 0; ToggleControls(); // bind settings ctlSettings.BindSettings(settings); }
public PackageSettings toAPIPackageSettings() { if (apiSettings != null) { return(apiSettings); } PackageSettings result = new PackageSettings(); return(result); }
static CompositionContainer CreateVisualStudioCompositionContainer(ExportProvider defaultExportProvider) { var compositionContainer = CreateCompositionContainer(defaultExportProvider); var gitHubServiceProvider = compositionContainer.GetExportedValue <IGitHubServiceProvider>(); var packageSettings = new PackageSettings(gitHubServiceProvider); var usageTracker = UsageTrackerFactory.CreateUsageTracker(compositionContainer, packageSettings); compositionContainer.ComposeExportedValue(usageTracker); return(compositionContainer); }
private void TestValue(ushort value) { var settingsFalse = new PackageSettings(value, false); var settingsBackFalse = new PackageSettings(settingsFalse.Settings); Assert.AreEqual(value, settingsBackFalse.Lenght); Assert.IsFalse(settingsBackFalse.HasMore); var settingsTrue = new PackageSettings(value, true); var settingsBackTrue = new PackageSettings(settingsTrue.Settings); Assert.AreEqual(value, settingsBackTrue.Lenght); Assert.IsTrue(settingsBackTrue.HasMore); }
internal DocumentPackageSettingsBuilder(PackageSettings apiPackageSettings) { enableInPerson = apiPackageSettings.Ceremony.InPerson; enableOptOut = apiPackageSettings.Ceremony.OptOutButton; enableDecline = apiPackageSettings.Ceremony.DeclineButton; hideWatermark = apiPackageSettings.Ceremony.HideWatermark; hideCaptureText = apiPackageSettings.Ceremony.HideCaptureText; enableFirstAffidavit = !apiPackageSettings.Ceremony.DisableFirstInPersonAffidavit; enableSecondAffidavit = !apiPackageSettings.Ceremony.DisableSecondInPersonAffidavit; showOwnerInPersonDropDown = !apiPackageSettings.Ceremony.HidePackageOwnerInPerson; showLanguageDropDown = !apiPackageSettings.Ceremony.HideLanguageDropdown; disableDeclineOther = apiPackageSettings.Ceremony.DisableDeclineOther; disableOptOutOther = apiPackageSettings.Ceremony.DisableOptOutOther; enforceCaptureSignature = apiPackageSettings.Ceremony.EnforceCaptureSignature; ada = apiPackageSettings.Ceremony.Ada; foreach (string declineReason in apiPackageSettings.Ceremony.DeclineReasons) { declineReasons.Add(declineReason); } foreach (string optOutReason in apiPackageSettings.Ceremony.OptOutReasons) { optOutReasons.Add(optOutReason); } maxAuthAttempts = apiPackageSettings.Ceremony.MaxAuthFailsAllowed; maxAttachmentFiles = apiPackageSettings.Ceremony.MaxAttachmentFiles; if (apiPackageSettings.Ceremony.DocumentToolbarOptions != null) { showDocumentToolbarDownloadButton = apiPackageSettings.Ceremony.DocumentToolbarOptions.DownloadButton; } if (apiPackageSettings.Ceremony.Events != null && apiPackageSettings.Ceremony.Events.Complete != null) { showDialogOnComplete = apiPackageSettings.Ceremony.Events.Complete.Dialog; } if (apiPackageSettings.Ceremony.HandOver != null) { linkHref = apiPackageSettings.Ceremony.HandOver.Href; linkText = apiPackageSettings.Ceremony.HandOver.Text; linkTooltip = apiPackageSettings.Ceremony.HandOver.Title; linkAutoRedirect = apiPackageSettings.Ceremony.HandOver.AutoRedirect; linkParameters = apiPackageSettings.Ceremony.HandOver.Parameters; } }
protected void ddlOverride_SelectedIndexChanged(object sender, EventArgs e) { if (ddlOverride.SelectedIndex == 0) // use host settings { // delete current settings PackageSettings settings = new PackageSettings(); settings.PackageId = PanelSecurity.PackageId; settings.SettingsName = SettingsName; ES.Services.Packages.UpdatePackageSettings(settings); // rebind settings BindSettings(); } else { ToggleControls(); } }
/// <summary> /// Builds a Unity package from a list of directories. /// </summary> /// <param name="settings">Description of the UnityPackage to build.</param> public static void BuildPackage(PackageSettings settings) { // make sure the product folder exists System.IO.Directory.CreateDirectory(BUILD_DIRECTORY_W_SLASH); // Ensure any recently changed / newly created assets are known by Unity. AssetDatabase.Refresh(); // and finally... build it! string[] dirUnityPath = new string[settings.Directories.Length]; for (int it = 0; it != settings.Directories.Length; ++it) { dirUnityPath[it] = ASSET_DIRECTORY_W_SLASH + settings.Directories[it]; } AssetDatabase.ExportPackage(dirUnityPath, BUILD_DIRECTORY_W_SLASH + settings.PackageName + ".unitypackage", ExportPackageOptions.Recurse); }
protected void Page_Load(object sender, EventArgs e) { // Remove DNS items if current Hosting plan does not allow it if (!PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId).Groups.ContainsKey(ResourceGroups.Dns)) { RemoveActionItem(DomainActionTypes.EnableDns); RemoveActionItem(DomainActionTypes.DisableDns); } // Remove Instant Alias items if current Hosting plan does not allow it PackageSettings packageSettings = ES.Services.Packages.GetPackageSettings(PanelSecurity.PackageId, PackageSettings.INSTANT_ALIAS); if (packageSettings == null || String.IsNullOrEmpty(packageSettings["InstantAlias"])) { RemoveActionItem(DomainActionTypes.CreateInstantAlias); RemoveActionItem(DomainActionTypes.DeleteInstantAlias); } // hide control if no actions allowed if (ActionsList.Items.Count <= 1) { Visible = false; } }
static ServerManager() { PackageSetting = new PackageSettings(); PackageSetting.PrefixString = "**_"; //todo: 改为配置 PackageSetting.LengthString = "4"; PackageSetting.Encoding = Encoding.UTF8; PackageSetting.BufferSize = 102400; PackageSetting.MaxConnectionNumber = 120; Events = new ServerEvents(); #region 设置绑定事件 // 如果程序运行中Tcp服务重启, 调用Bind(Events)方法重新绑定之前绑定过的事件, 待优化... Events.ClientConnectedEventChanged += OnConnectedEventRegisterChanged; Events.ClientDisconnectedEventChanged += OnDisconnectedEventRegisterChanged; Events.MessageSendEventChanged += OnSendEventRegisterChanged; Events.MessageReceivedEventChanged += OnReceivedEventRegisterChanged; #endregion DefaultPackageDealer.PackageSetting = PackageSetting; }
public void SaveSettings(PackageSettings settings) { settings["SharedSslSites"] = domainsList.Value; }
public void SaveSettings(PackageSettings settings) { settings["ChildSpacesFolder"] = txtSpacesFolder.Text.Trim(); }
private void BindControls() { // get domain type DomainType type = GetDomainType(Request["DomainType"]); // enable domain/sub-domain fields // load package context if (type == DomainType.Domain || type == DomainType.DomainPointer) { // domains DomainName.IsSubDomain = false; } else { // sub-domains DomainName.IsSubDomain = true; // fill sub-domains if (!IsPostBack) { if (type == DomainType.SubDomain) { BindUserDomains(); } else { BindResellerDomains(); } } } if ((type == DomainType.DomainPointer || (type == DomainType.Domain)) && !IsPostBack) { // bind web sites WebSitesList.DataSource = ES.Services.WebServers.GetWebSites(PanelSecurity.PackageId, false); WebSitesList.DataBind(); } if ((type == DomainType.DomainPointer || (type == DomainType.Domain)) && !IsPostBack) { // bind mail domains MailDomainsList.DataSource = ES.Services.MailServers.GetMailDomains(PanelSecurity.PackageId, false); MailDomainsList.DataBind(); } PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); // create web site option CreateSolidCP.Visible = (type == DomainType.Domain || type == DomainType.SubDomain) && cntx.Groups.ContainsKey(ResourceGroups.Web); if (PointWebSite.Checked) { CreateWebSite.Checked = false; CreateWebSite.Enabled = false; } else { CreateWebSite.Enabled = true; CreateWebSite.Checked &= CreateSolidCP.Visible; } // point Web site PointSolidCP.Visible = (type == DomainType.DomainPointer || (type == DomainType.Domain)) && cntx.Groups.ContainsKey(ResourceGroups.Web) && WebSitesList.Items.Count > 0; WebSitesList.Enabled = PointWebSite.Checked; // point mail domain PointMailDomainPanel.Visible = (type == DomainType.DomainPointer || (type == DomainType.Domain)) && cntx.Groups.ContainsKey(ResourceGroups.Mail) && MailDomainsList.Items.Count > 0; MailDomainsList.Enabled = PointMailDomain.Checked; // DNS option EnableDnsPanel.Visible = cntx.Groups.ContainsKey(ResourceGroups.Dns); EnableDns.Checked &= EnableDnsPanel.Visible; // Preview Domain // check if Preview Domain was setup bool instantAliasAllowed = false; PackageSettings settings = ES.Services.Packages.GetPackageSettings(PanelSecurity.PackageId, PackageSettings.INSTANT_ALIAS); instantAliasAllowed = (settings != null && !String.IsNullOrEmpty(settings["PreviewDomain"])); PreviewDomainPanel.Visible = instantAliasAllowed && (type != DomainType.DomainPointer) /*&& EnableDnsPanel.Visible*/; CreatePreviewDomain.Checked &= PreviewDomainPanel.Visible; // allow sub-domains AllowSubDomainsPanel.Visible = (type == DomainType.Domain) && PanelSecurity.EffectiveUser.Role != UserRole.User; if (IsPostBack) { CheckForCorrectIdnDomainUsage(DomainName.Text); } }
public DocumentPackageSettingsConverter(PackageSettings settings) { apiSettings = settings; }
private void BindDomain() { try { // load domain DomainInfo domain = ES.Services.Servers.GetDomain(PanelRequest.DomainID); if (domain == null) { RedirectToBrowsePage(); } // load package context PackageContext cntx = PackagesHelper.GetCachedPackageContext(domain.PackageId); DomainName.Text = domain.DomainName; bool webEnabled = cntx.Groups.ContainsKey(ResourceGroups.Web); bool mailEnabled = cntx.Groups.ContainsKey(ResourceGroups.Mail); bool dnsEnabled = cntx.Groups.ContainsKey(ResourceGroups.Dns); // web site if (webEnabled && domain.WebSiteId > 0) { SolidCP.Visible = true; WebSiteAliasPanel.Visible = true; WebSiteName.Text = domain.WebSiteName; WebSiteParkedPanel.Visible = (String.Compare(domain.WebSiteName, domain.DomainName, true) == 0); WebSitePointedPanel.Visible = !WebSiteParkedPanel.Visible; BrowseWebSite.NavigateUrl = "http://" + domain.DomainName; } // mail domain if (mailEnabled && domain.MailDomainId > 0) { MailDomainPanel.Visible = true; MailDomainAliasPanel.Visible = true; MailDomainName.Text = domain.MailDomainName; MailEnabledPanel.Visible = (String.Compare(domain.MailDomainName, domain.DomainName, true) == 0); PointMailDomainPanel.Visible = !MailEnabledPanel.Visible; } // DNS if (dnsEnabled) { DnsPanel.Visible = true; DnsEnabledPanel.Visible = (domain.ZoneItemId > 0); DnsDisabledPanel.Visible = !DnsEnabledPanel.Visible; // dns editor EditDnsRecords.Visible = (cntx.Quotas.ContainsKey(Quotas.DNS_EDITOR) && cntx.Quotas[Quotas.DNS_EDITOR].QuotaAllocatedValue != 0) || PanelSecurity.LoggedUser.Role == UserRole.Administrator; //DNS Export ExportDnsRecords.Visible = (cntx.Quotas.ContainsKey(Quotas.DNS_EDITOR) && cntx.Quotas[Quotas.DNS_EDITOR].QuotaAllocatedValue != 0) || PanelSecurity.LoggedUser.Role == UserRole.Administrator; //DNS Import ImportDnsRecords.Visible = (cntx.Quotas.ContainsKey(Quotas.DNS_EDITOR) && cntx.Quotas[Quotas.DNS_EDITOR].QuotaAllocatedValue != 0) || PanelSecurity.LoggedUser.Role == UserRole.Administrator; } // Preview Domain PackageSettings settings = ES.Services.Packages.GetPackageSettings(PanelSecurity.PackageId, PackageSettings.INSTANT_ALIAS); bool instantAliasAllowed = !String.IsNullOrEmpty(domain.PreviewDomainName); bool instantAliasExists = (domain.PreviewDomainId > 0) && (settings != null && !String.IsNullOrEmpty(settings["PreviewDomain"])); if (instantAliasAllowed && !domain.IsDomainPointer && !domain.IsPreviewDomain) { PreviewDomainPanel.Visible = true; PreviewDomainEnabled.Visible = instantAliasExists; PreviewDomainDisabled.Visible = !instantAliasExists; // load Preview Domain DomainInfo instantAlias = ES.Services.Servers.GetDomain(domain.PreviewDomainId); WebSiteAliasPanel.Visible = false; if (instantAlias != null) { DomainInfo[] Domains = ES.Services.Servers.GetDomainsByDomainId(domain.PreviewDomainId); foreach (DomainInfo d in Domains) { if (d.WebSiteId > 0) { WebSiteAliasPanel.Visible = true; } } MailDomainAliasPanel.Visible = (instantAlias.MailDomainId > 0); } // Preview Domain PreviewDomainName.Text = domain.PreviewDomainName; // web site alias WebSiteAlias.Text = WebSiteAlias.NavigateUrl = "http://" + domain.PreviewDomainName; // mail domain alias MailDomainAlias.Text = "@" + domain.PreviewDomainName; } // resellers AllowSubDomains.Checked = domain.HostingAllowed; if (PanelSecurity.EffectiveUser.Role != UserRole.User && !(domain.IsDomainPointer || domain.IsSubDomain || domain.IsPreviewDomain)) { ResellersPanel.Visible = true; } if (!(domain.IsDomainPointer || domain.IsSubDomain || domain.IsPreviewDomain)) { UserInfo user = UsersHelper.GetUser(PanelSecurity.EffectiveUserId); if (user != null) { if (user.Role == UserRole.User) { btnDelete.Enabled = !Utils.CheckQouta(Quotas.OS_NOTALLOWTENANTCREATEDOMAINS, cntx); } } } } catch (Exception ex) { ShowErrorMessage("DOMAIN_GET_DOMAIN", ex); return; } }
public PackageSettings toAPIPackageSettings() { if (sdkSettings == null) { return(apiSettings); } CeremonySettings ceremonySettings = new CeremonySettings(); ceremonySettings.InPerson = sdkSettings.EnableInPerson; ceremonySettings.OptOutButton = sdkSettings.EnableOptOut; ceremonySettings.DeclineButton = sdkSettings.EnableDecline; ceremonySettings.HideWatermark = sdkSettings.HideWatermark; ceremonySettings.HideCaptureText = sdkSettings.HideCaptureText; ceremonySettings.DeclineReasons = sdkSettings.DeclineReasons; ceremonySettings.OptOutReasons = sdkSettings.OptOutReasons; ceremonySettings.MaxAuthFailsAllowed = sdkSettings.MaxAuthAttempts; ceremonySettings.DisableDeclineOther = sdkSettings.DisableDeclineOther; ceremonySettings.DisableOptOutOther = sdkSettings.DisableOptOutOther; ceremonySettings.EnforceCaptureSignature = sdkSettings.EnforceCaptureSignature; ceremonySettings.Ada = sdkSettings.Ada; if (sdkSettings.EnableFirstAffidavit.HasValue) { ceremonySettings.DisableFirstInPersonAffidavit = !sdkSettings.EnableFirstAffidavit; } if (sdkSettings.EnableSecondAffidavit.HasValue) { ceremonySettings.DisableSecondInPersonAffidavit = !sdkSettings.EnableSecondAffidavit; } if (sdkSettings.ShowLanguageDropDown.HasValue) { ceremonySettings.HideLanguageDropdown = !sdkSettings.ShowLanguageDropDown; } if (sdkSettings.ShowOwnerInPersonDropDown.HasValue) { ceremonySettings.HidePackageOwnerInPerson = !sdkSettings.ShowOwnerInPersonDropDown; } if (sdkSettings.LinkHref != null) { Link link = new Link(); link.Href = sdkSettings.LinkHref; link.Text = sdkSettings.LinkText == null ? sdkSettings.LinkHref : sdkSettings.LinkText; link.Title = sdkSettings.LinkTooltip == null ? sdkSettings.LinkHref : sdkSettings.LinkTooltip; ceremonySettings.HandOver = link; } if (sdkSettings.ShowDialogOnComplete.HasValue) { CeremonyEvents ceremonyEvents = new CeremonyEvents(); CeremonyEventComplete ceremonyEventComplete = new CeremonyEventComplete(); ceremonyEventComplete.Dialog = sdkSettings.ShowDialogOnComplete; ceremonyEvents.Complete = ceremonyEventComplete; ceremonySettings.Events = ceremonyEvents; } if (sdkSettings.ShowDownloadButton.HasValue) { DocumentToolbarOptions documentToolbarOptions = new DocumentToolbarOptions(); documentToolbarOptions.DownloadButton = sdkSettings.ShowDownloadButton; ceremonySettings.DocumentToolbarOptions = documentToolbarOptions; } if (sdkSettings.CeremonyLayoutSettings != null) { ceremonySettings.Layout = new CeremonyLayoutSettingsConverter(sdkSettings.CeremonyLayoutSettings).ToAPILayoutOptions(); } PackageSettings result = new PackageSettings(); result.Ceremony = ceremonySettings; return(result); }
/// <inheritdoc /> /// <summary> /// Initialization of the package; this method is called right after the package is sited, so this is the place /// where you can put all the initialization code that rely on services provided by VisualStudio. /// </summary> protected override void Initialize() { base.Initialize(); _dte = (DTE)GetService(typeof(SDTE)); _dteEvents = _dte.Events.DTEEvents; _dteEvents.OnStartupComplete += _dteEvents_OnStartupComplete; BridgeVsExtension bridge = new BridgeVsExtension(_dte); bool isLinqBridgeVsConfigured = PackageConfigurator.IsBridgeVsConfigured(_dte.Version); // Add our command handlers for menu(commands must exist in the.vsct file) OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService; if (null == mcs) { return; } // Create the command for the menu item. CommandID enableCommand = new CommandID(GuidList.GuidBridgeVsExtensionCmdSet, (int)PkgCmdIdList.CmdIdEnableBridge); OleMenuCommand menuItemEnable = new OleMenuCommand((s, e) => bridge.Execute(CommandAction.Enable), enableCommand); menuItemEnable.BeforeQueryStatus += (s, e) => bridge.UpdateCommand(menuItemEnable, CommandAction.Enable); CommandID disableCommand = new CommandID(GuidList.GuidBridgeVsExtensionCmdSet, (int)PkgCmdIdList.CmdIdDisableBridge); OleMenuCommand menuItemDisable = new OleMenuCommand((s, e) => bridge.Execute(CommandAction.Disable), disableCommand); menuItemDisable.BeforeQueryStatus += (s, e) => bridge.UpdateCommand(menuItemDisable, CommandAction.Disable); CommandID gettingStarted = new CommandID(GuidList.GuidBridgeVsExtensionCmdSet, (int)PkgCmdIdList.CmdIdGettingStarted); OleMenuCommand menuItemGettingStarted = new OleMenuCommand((s, e) => System.Diagnostics.Process.Start("https://github.com/codingadventures/LINQBridgeVs#getting-started"), gettingStarted); CommandID sendFeedback = new CommandID(GuidList.GuidBridgeVsExtensionCmdSet, (int)PkgCmdIdList.CmdIdFeedback); OleMenuCommand menuItemSendFeedback = new OleMenuCommand((s, e) => System.Diagnostics.Process.Start("https://github.com/codingadventures/LINQBridgeVs/issues"), sendFeedback); mcs.AddCommand(menuItemEnable); mcs.AddCommand(menuItemDisable); mcs.AddCommand(menuItemGettingStarted); mcs.AddCommand(menuItemSendFeedback); //Initialize Object Exporter settings _packageSettings = (PackageSettings)GetDialogPage(typeof(PackageSettings)); try { //if first time user if (isLinqBridgeVsConfigured) { return; } if (!IsElevated) { // ReSharper disable once ConditionIsAlwaysTrueOrFalse if (Application.ResourceAssembly == null) { // ReSharper disable once HeuristicUnreachableCode Application.ResourceAssembly = typeof(Welcome).Assembly; } _welcomePage = new Welcome(_dte); } else { _installationResult = PackageConfigurator.Install(_dte.Version, _dte.Edition); } } catch (Exception e) { _error = new Error(); _error.Body = $"{e.Message} %0A {e.StackTrace}"; _error.Title = "Error during installation. 1.4.6"; Exception innerException = e.InnerException; while (innerException != null) { _error.Body += $"%0A {innerException.Message} {innerException.StackTrace}"; innerException = innerException.InnerException; } _error.Body = _error.Body.Replace(Environment.NewLine, "%0A"); } }
/// <summary> /// Builds a Unity package from a list of directories. /// </summary> /// <param name="settings">Description of the UnityPackage to build.</param> public static void BuildPackage(PackageSettings settings) { // make sure the product folder exists System.IO.Directory.CreateDirectory(BUILD_DIRECTORY_W_SLASH); // Ensure any recently changed / newly created assets are known by Unity. AssetDatabase.Refresh(); // and finally... build it! string[] dirUnityPath = new string[settings.Directories.Length]; for (int it = 0; it != settings.Directories.Length; ++it) { dirUnityPath[it] = ASSET_DIRECTORY_W_SLASH + settings.Directories[it]; } AssetDatabase.ExportPackage(dirUnityPath, BUILD_DIRECTORY_W_SLASH + settings.PackageName + ".unitypackage", ExportPackageOptions.Recurse); }
public void BindSettings(PackageSettings settings) { domainsList.Value = settings["SharedSslSites"]; }
internal PackageSettings toAPIPackageSettings() { CeremonySettings ceremonySettings = new CeremonySettings(); if (enableInPerson != null) { ceremonySettings.InPerson = enableInPerson.Value; } if (enableOptOut != null) { ceremonySettings.OptOutButton = enableOptOut.Value; } if (enableDecline != null) { ceremonySettings.DeclineButton = enableDecline.Value; } if (expandLeftMenu != null) { ceremonySettings.LeftMenuExpand = expandLeftMenu.Value; } if (disableOptOutOther != null) { ceremonySettings.DisableOptOutOther = disableOptOutOther.Value; } if (disableDeclineOther != null) { ceremonySettings.DisableDeclineOther = disableDeclineOther.Value; } if (hideWatermark != null) { ceremonySettings.HideWatermark = hideWatermark.Value; } if (hideCaptureText != null) { ceremonySettings.HideCaptureText = hideCaptureText.Value; } if (enableFirstAffidavit != null) { ceremonySettings.DisableFirstInPersonAffidavit = !enableFirstAffidavit.Value; } if (enableSecondAffidavit != null) { ceremonySettings.DisableSecondInPersonAffidavit = !enableSecondAffidavit.Value; } if (showOwnerInPersonDropDown != null) { ceremonySettings.HidePackageOwnerInPerson = !showOwnerInPersonDropDown.Value; } if (showLanguageDropDown != null) { ceremonySettings.HideLanguageDropdown = !showLanguageDropDown.Value; } if (enforceCaptureSignature != null) { ceremonySettings.EnforceCaptureSignature = enforceCaptureSignature.Value; } if (ada != null) { ceremonySettings.Ada = ada.Value; } if (fontSize != null) { ceremonySettings.FontSize = fontSize.Value; } if (defaultTimeBasedExpiry != null) { ceremonySettings.DefaultTimeBasedExpiry = defaultTimeBasedExpiry.Value; } if (remainingDays != null) { ceremonySettings.RemainingDays = remainingDays.Value; } if (showNseHelp != null) { ceremonySettings.ShowNseHelp = showNseHelp.Value; } if (showNseOverview != null) { ceremonySettings.ShowNseOverview = showNseOverview.Value; } foreach (string declineReason in declineReasons) { ceremonySettings.DeclineReasons.Add(declineReason); } foreach (string optOutReason in optOutReasons) { ceremonySettings.OptOutReasons.Add(optOutReason); } if (maxAuthAttempts != null) { ceremonySettings.MaxAuthFailsAllowed = maxAuthAttempts.Value; } if (maxAttachmentFiles != null) { ceremonySettings.MaxAttachmentFiles = maxAttachmentFiles.Value; } if (linkHref != null) { Link link = new Link(); link.Href = linkHref; link.Text = (linkText == null ? linkHref : linkText); link.Title = (linkTooltip == null ? linkHref : linkTooltip); ceremonySettings.HandOver = link; } if (showDialogOnComplete != null) { CeremonyEvents ceremonyEvents = new CeremonyEvents(); CeremonyEventComplete ceremonyEventComplete = new CeremonyEventComplete(); if (showDialogOnComplete != null) { ceremonyEventComplete.Dialog = showDialogOnComplete.Value; } ceremonyEvents.Complete = ceremonyEventComplete; ceremonySettings.Events = ceremonyEvents; } if (showDownloadButton != null) { DocumentToolbarOptions documentToolbarOptions = new DocumentToolbarOptions(); if (showDownloadButton != null) { documentToolbarOptions.DownloadButton = showDownloadButton.Value; } ceremonySettings.DocumentToolbarOptions = documentToolbarOptions; } if (ceremonyLayoutSettings != null) { ceremonySettings.Layout = new CeremonyLayoutSettingsConverter(ceremonyLayoutSettings).ToAPILayoutOptions(); } PackageSettings result = new PackageSettings(); result.Ceremony = ceremonySettings; return(result); }