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


C# Settings类代码示例

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


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

示例1: CalcCells2

 public static H3.Cell[] CalcCells2( Sphere[] mirrors, H3.Cell[] cells, Settings settings )
 {
     HashSet<Vector3D> completedCellIds = new HashSet<Vector3D>( cells.Select( c => c.ID ).ToArray() );
     List<H3.Cell> completedCells = new List<H3.Cell>( cells );
     ReflectCellsRecursive2( mirrors, cells, settings, completedCells, completedCellIds );
     return completedCells.ToArray();
 }
开发者ID:roice3,项目名称:Honeycombs,代码行数:7,代码来源:Recurse.cs

示例2: TestEmail

    string TestEmail(Settings settings)
    {
        string email = settings.Email;
        string smtpServer = settings.SmtpServer;
        string smtpServerPort = settings.SmtpServerPort.ToString();
        string smtpUserName = settings.SmtpUserName;
        string smtpPassword = settings.SmtpPassword;
        string enableSsl = settings.EnableSsl.ToString();

        var mail = new MailMessage
        {
            From = new MailAddress(email, smtpUserName),
            Subject = string.Format("Test mail from {0}", smtpUserName),
            IsBodyHtml = true
        };
        mail.To.Add(mail.From);
        var body = new StringBuilder();
        body.Append("<div style=\"font: 11px verdana, arial\">");
        body.Append("Success");
        if (HttpContext.Current != null)
        {
            body.Append(
                "<br /><br />_______________________________________________________________________________<br /><br />");
            body.AppendFormat("<strong>IP address:</strong> {0}<br />", Utils.GetClientIP());
            body.AppendFormat("<strong>User-agent:</strong> {0}", HttpContext.Current.Request.UserAgent);
        }

        body.Append("</div>");
        mail.Body = body.ToString();

        return Utils.SendMailMessage(mail, smtpServer, smtpServerPort, smtpUserName, smtpPassword, enableSsl.ToString());
    }
开发者ID:aelagawy,项目名称:BlogEngine.NET,代码行数:32,代码来源:SettingsController.cs

示例3: Editor

        private bool vueMode = false; // false = ortho, true = orbite

        #endregion Fields

        #region Constructors

        internal Editor(EditorController _controller)
        {
            InitializeComponent();
            controller = _controller;

            // Ne pas enlever Forms : c'est pour éviter l'ambiguïté.
            KeyDown += controller.KeyPressed;
            KeyUp += controller.KeyUnPressed;
            GamePanel.MouseDown += new Forms.MouseEventHandler(controller.MouseButtonDown);
            GamePanel.MouseUp += new Forms.MouseEventHandler(controller.MouseButtonUp);
            GamePanel.MouseEnter += new EventHandler(GamePanel_MouseEnter);
            GamePanel.MouseLeave -= new EventHandler(GamePanel_MouseExit);
            GamePanel.MouseWheel += new Forms.MouseEventHandler(controller.RouletteSouris);
            GamePanel.MouseMove += new Forms.MouseEventHandler(controller.MouseMove);
            /// Resize on resize only
            Application.Current.MainWindow.SizeChanged += new SizeChangedEventHandler(ResizeGamePanel);

            settings = (new ConfigPanelData()).LoadSettings();
            profiles = (new ConfigPanelData()).LoadProfiles();

            var defaultProfile = profiles.Where(x => settings != null && x.CompareTo(settings.DefaultProfile) == 0);

            if (defaultProfile.Count() > 0)
            {
                selectedProfile = defaultProfile.First();
                controller.ChangeProfile(selectedProfile);
            }
            else
            {
                selectedProfile = profiles[0];
                controller.ChangeProfile(selectedProfile);
            }
        }
开发者ID:ArchSirius,项目名称:inf2990,代码行数:39,代码来源:Editor.xaml.cs

示例4: Start

        public void Start()
        {
            Settings settings = null;

            var infobase = _manager.Infobases.FirstOrDefault(val => val.IsAutorun);
            if (infobase == null)
            {
                Activity.FlipScreen(Resource.Layout.Infobases);

                using (var tv = Activity.FindViewById<TextView>(Resource.Id.infobasesCaption))
                using (var btn = Activity.FindViewById<Button>(Resource.Id.buttonCustomerCode))
                {
                    tv.Text = D.INFOBASES;
                    btn.Text = D.ENTER_CUSTOMER_CODE;
                    btn.Click += OpenCustomerCodeMenu;
                }

                LoadList();
            }
            else
            {
                settings = new Settings(_prefs, Activity.Resources.Configuration.Locale.Language, infobase);
            }

            if (settings != null)
                _resultCallback(settings);
        }
开发者ID:Fedorm,项目名称:core-master,代码行数:27,代码来源:Infobases.cs

示例5: SettingsForm

        bool tray; // булевая переменная для закрития из трея

        #endregion Fields

        #region Constructors

        public SettingsForm()
        {
            InitializeComponent();
            tray = true;
            Lock = new locker();
            s = new Settings();
        }
开发者ID:DeadHipo,项目名称:Photo-Lock,代码行数:13,代码来源:settingsForm.cs

示例6: Delete

 internal static void Delete(IEnumerable<Container> storages, Settings settings)
 {
     foreach (var storage in storages)
     {
         settings.Endpoint.Delete(storage.Identity);
     }
 }
开发者ID:bazer,项目名称:Modl,代码行数:7,代码来源:Materializer.cs

示例7: ConnectionsViewModel

 public ConnectionsViewModel(Settings settings)
     : base()
 {
     _settings = settings;
     foreach (Connection connection in _settings.GetConnections())
     {
         ConnectionViewModel model = new ConnectionViewModel(connection);
         this.Add(model);
         model.PropertyChanged += _itemChanged;
     }
     this.CollectionChanged += (s, e) =>
         {
             ConnectionViewModel connection;
             switch (e.Action)
             {
                 case NotifyCollectionChangedAction.Add:
                     connection = (ConnectionViewModel)e.NewItems[0];
                     connection.PropertyChanged += _itemChanged;
                     _settings.AddConnection(connection.Connection);
                     break;
                 case NotifyCollectionChangedAction.Remove:
                     connection = (ConnectionViewModel)e.OldItems[0];
                     connection.PropertyChanged -= _itemChanged;
                     _settings.RemoveConnection(connection.Connection);
                     break;
             }
         };
 }
开发者ID:snowy-owll,项目名称:Pinger,代码行数:28,代码来源:ConnectionsViewModel.cs

示例8: ShouldTakePasswordFromServerUri

 public void ShouldTakePasswordFromServerUri()
 {
     var settings = new Settings(new Uri("http://user1:[email protected]:4242"), "testdb");
     Assert.Equal("user1", settings.Credentials.UserName);
     Assert.Equal("passw0rd", settings.Credentials.Password);
     Assert.Equal("http://example.com:4242/", settings.ServerUri.ToString());
 }
开发者ID:artikh,项目名称:CouchDude,代码行数:7,代码来源:SettingsTests.cs

示例9: UpgradeOrInstall

        const int WM_USER = 0x0400; //http://msdn.microsoft.com/en-us/library/windows/desktop/ms644931(v=vs.85).aspx

        public async Task UpgradeOrInstall(IAbsoluteDirectoryPath destination, Settings settings,
            params IAbsoluteFilePath[] files) {
            var theShell = GetTheShell(destination, files);
            if (theShell.Exists)
                await Uninstall(destination, settings, files).ConfigureAwait(false);
            await Install(destination, settings, files).ConfigureAwait(false);
        }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:9,代码来源:ExplorerExtensionInstaller.cs

示例10: TryBuild

        public bool TryBuild()
        {
            // Ensure at least one argument for the path
            if (Args.Count == 0 ||
                Args.First().TrimStart().StartsWith("-"))
            {
                return false;
            }

            var settings = Args.Joined(" ")
                .Split(
                    new[] { " -" },
                    StringSplitOptions.RemoveEmptyEntries);

            RulePath = settings.First().Trim();
            Settings = new Settings();

            var restSettings = settings.Skip(1);
            foreach (var item in restSettings)
            {
                var separatorIndex = item.IndexOf(" ");
                var key = item.Substring(0, separatorIndex).Trim();
                var value = item.Substring(separatorIndex + 1).Trim();
                Settings[key] = value;
            }


            return true;
        }
开发者ID:ngkolev,项目名称:Skeptic.NET,代码行数:29,代码来源:SettingsBuilder.cs

示例11: RubyCodeGenerator

        /// <summary>
        /// Initializes a new instance of the class RubyCodeGenerator.
        /// </summary>
        /// <param name="settings">The settings.</param>
        public RubyCodeGenerator(Settings settings) : base(settings)
        {
            CodeNamer = new RubyCodeNamer();
            this.packageVersion = Settings.PackageVersion;
            this.packageName = Settings.PackageName;

            if (Settings.CustomSettings.ContainsKey("Name"))
            {
                this.sdkName = Settings.CustomSettings["Name"].ToString();
            }

            if (sdkName == null)
            {
                this.sdkName = Path.GetFileNameWithoutExtension(Settings.Input);
            }

            if (sdkName == null)
            {
                sdkName = "client";
            }

            this.sdkName = RubyCodeNamer.UnderscoreCase(CodeNamer.RubyRemoveInvalidCharacters(this.sdkName));
            this.sdkPath = this.packageName ?? this.sdkName;
            this.modelsPath = Path.Combine(this.sdkPath, "models");

            // AutoRest generated code for Ruby and Azure.Ruby generator will live inside "generated" sub-folder
            settings.OutputDirectory = Path.Combine(settings.OutputDirectory, GeneratedFolderName);
        }
开发者ID:tdjastrzebski,项目名称:autorest,代码行数:32,代码来源:RubyCodeGenerator.cs

示例12: AsyncEffectRenderer

		internal AsyncEffectRenderer (Settings settings)
		{
			if (settings.ThreadCount < 1)
				settings.ThreadCount = 1;
			
			if (settings.TileWidth < 1)
				throw new ArgumentException ("EffectRenderSettings.TileWidth");
			
			if (settings.TileHeight < 1)
				throw new ArgumentException ("EffectRenderSettings.TileHeight");			
			
			if (settings.UpdateMillis <= 0)
				settings.UpdateMillis = 100;
			
			effect = null;
			source_surface = null;
			dest_surface = null;
			this.settings = settings;
			
			is_rendering = false;
			render_id = 0;
			updated_lock = new object ();
			is_updated = false;
			render_exceptions = new List<Exception> ();	
			
			timer_tick_id = 0;
		}		
开发者ID:jobernolte,项目名称:Pinta,代码行数:27,代码来源:AsyncEffectRenderer.cs

示例13: EnemyRotationHandler

 public EnemyRotationHandler(
     EnemyModel model,
     Settings settings)
 {
     _settings = settings;
     _model = model;
 }
开发者ID:Soren025,项目名称:Zenject,代码行数:7,代码来源:EnemyRotationHandler.cs

示例14: MainForm

        public MainForm()
        {
            library = Library.Load();
            if (library == null)
            {
                library = new Library();
                library.Save();
            }
            library.Changed += library_LibraryChanged;

            settings = Settings.Load(SettingsPath) ?? new Settings();

            musicPlayer.OpenCompleted += equalizerSettings_ShouldSet;
            musicPlayer.OpenCompleted += musicPlayer_ShouldPlay;
            musicPlayer.DeviceVolume = settings.DeviceVolume;

            equalizerSettings = EqualizerSettings.Load(EqualizerPath);
            if (equalizerSettings == null)
            {
                equalizerSettings = new EqualizerSettings();
                equalizerSettings.Save(EqualizerPath);
            }
            equalizerSettings.ValueChanged += equalizerSettings_ShouldSet;

            SetUpGlobalHotkeys();

            lfmHandler = new LastfmHandler();
            if (settings.ScrobblingEnabled)
                lfmHandler.ResumeSessionAsync();

            InitializeComponent();
            SetControlReferences();
        }
开发者ID:koaset,项目名称:KoPlayer,代码行数:33,代码来源:MainForm.cs

示例15: GiveawaysWindow

        public GiveawaysWindow(IExtension sender)
        {
            InitializeComponent();

            ini = new Settings(sender, "Settings.ini", "[Default]");

            UI.CenterSpacer(GiveawayTypeLabel, GiveawayTypeSpacer);
            UI.CenterSpacer(GiveawaySettingsLabel, GiveawaySettingsSpacer, false, true);
            UI.CenterSpacer(GiveawayBansLabel, GiveawayBansSpacer);
            UI.CenterSpacer(GiveawayUsersLabel, GiveawayUsersSpacer);

            Panel panel = new Panel();
            panel.Size = new Size(1, 1);
            panel.Location = new Point(GiveawayTypeSpacer.Location.X + GiveawayTypeSpacer.Size.Width - 1, GiveawayTypeSpacer.Location.Y + 9);
            Controls.Add(panel);
            panel.BringToFront();
            panel = new Panel();
            panel.Size = new Size(1, 1);
            panel.Location = new Point(GiveawayBansSpacer.Location.X + GiveawayBansSpacer.Size.Width - 1, GiveawayBansSpacer.Location.Y + 9);
            Controls.Add(panel);
            panel.BringToFront();
            /*panel.BackColor = Color.Black;
            panel.Size = new Size(Giveaway_AddPresent.Size.Width + Giveaway_RemovePresent.Size.Width, 1);
            panel.Location = new Point(Giveaway_AddPresent.Location.X, Giveaway_AddPresent.Location.Y + 1);
            Controls.Add(panel);
            panel.BringToFront();*/
        }
开发者ID:carriercomm,项目名称:ModBot,代码行数:27,代码来源:GiveawaysWindow.cs


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