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


C# Setting类代码示例

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


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

示例1: getUserSpecificSettings

        public static void getUserSpecificSettings(String currentUser)
        {
            var iso = IsolatedStorageSettings.ApplicationSettings;

            // check to see if this user exists
            if (!iso.Contains(currentUser + "SaveOriginal"))
            {
                saveOriginal = new Setting<bool>(currentUser + "SaveOriginal", true);
                locationService = new Setting<bool>(currentUser + "LocationService", true);

                twitterAuth = new Setting<bool>(currentUser + "TwitterAuth", false);
                twitterDefault = new Setting<bool>(currentUser + "TwitterDefault", false);
            }
            else
            {
                saveOriginal = new Setting<bool>(currentUser +
                    "SaveOriginal", Convert.ToBoolean(IsolatedStorageSettings.ApplicationSettings[currentUser + "SaveOriginal"]));
                locationService = new Setting<bool>(currentUser +
                    "LocationService", Convert.ToBoolean(IsolatedStorageSettings.ApplicationSettings[currentUser + "LocationService"]));

                twitterAuth = new Setting<bool>(currentUser +
                    "TwitterAuth", Convert.ToBoolean(IsolatedStorageSettings.ApplicationSettings[currentUser + "TwitterAuth"]));
                twitterDefault = new Setting<bool>(currentUser +
                    "TwitterDefault", Convert.ToBoolean(IsolatedStorageSettings.ApplicationSettings[currentUser + "TwitterDefault"]));
            }
        }
开发者ID:purdue-cs-groups,项目名称:cs307-project01,代码行数:26,代码来源:Settings.cs

示例2: StrataOnTunnel

        // tunnelX, tunnelZ is the coordinate of tunnel crown
        // h is the height of tunnel
        //
        public static List<Result> StrataOnTunnel(double tunnelX, double tunnelZ, double h,
            IView profileView, string stLayerID, Setting setting)
        {
            IGraphicsLayer gLayerSt = profileView.getLayer(stLayerID);
            if (gLayerSt == null)
                return null;

            List<Result> results = new List<Result>();

            Project prj = Globals.project;
            Domain geology = prj.getDomain(DomainType.Geology);
            DGObjectsCollection stratum = geology.getObjects("Stratum");
            var stratumList = stratum.merge();
            foreach (DGObject obj in stratumList)
            {
                Stratum strata = obj as Stratum;
                IGraphicCollection gc = gLayerSt.getGraphics(strata);

                if (gc == null)
                    continue;

                Result result = StratumOnTunnel(tunnelX, tunnelZ, h, gc, profileView.spatialReference);
                if (result != null)
                {
                    result.StratumObj = gLayerSt.getObject(gc[0]);
                    if (result.Depth > 0 || setting.AllStrata)
                        results.Add(result);
                }
            }
            return results;
        }
开发者ID:iS3-Project,项目名称:iS3,代码行数:34,代码来源:StratumMappingUtility.cs

示例3: DeleteSetting

 public bool DeleteSetting(Setting setting)
 {
     if (setting == null) return false;
     _unitOfWork.SettingRepository.Delete(setting);
     _unitOfWork.Save();
     return true;
 }
开发者ID:edgecomputing,项目名称:cats-hub-module,代码行数:7,代码来源:SettingService.cs

示例4: Unicode

 /// <summary>
 /// 유니코드의 한글 범위를 조합합니다.
 /// </summary>
 /// <param name="setting">설정값을 받습니다.</param>
 public Unicode(Setting setting)
 {
     for (int i = 0; i != setting.CharLength; i++)
     {
         result.Append((char)random.Next(_UNICODE_RANGE_MIN, _UNICODE_RANGE_MAX + 1));
     }
 }
开发者ID:steamb23,项目名称:Namescape,代码行数:11,代码来源:Unicode.cs

示例5: OnSettingsChanged

 private void OnSettingsChanged(object sender, Setting setting)
 {
     if (setting.Name == GlobalSettingNames.CaretOpacityName)
     {
         UpdateCaretOpacity();
     }
 }
开发者ID:otf,项目名称:VsVim,代码行数:7,代码来源:BlockCaretController.cs

示例6: addSetting

        public static bool addSetting(Setting setting, string connString)
        {
            #region code
            bool rs = false;
            using (SqlConnection conn = new SqlConnection(connString))
            {
                try
                {
                    conn.Open();
                    using (SqlCommand cmd = conn.CreateCommand())
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.CommandText = "sony_sp_add_setting";
                        cmd.Parameters.AddWithValue("@name", setting.Name);
                        cmd.Parameters.AddWithValue("@value", setting.Value);
                        SqlParameter returnVal = new SqlParameter("@returnVal", SqlDbType.Int);
                        returnVal.Direction = ParameterDirection.Output;
                        cmd.Parameters.Add(returnVal);

                        cmd.ExecuteNonQuery();
                        rs = ((int)cmd.Parameters["@returnVal"].Value != 0);
                    }
                }
                catch (Exception ex)
                {
                    return false;
                }
            }
            return rs;
            #endregion
        }
开发者ID:ndl0986,项目名称:rebuild-site,代码行数:31,代码来源:SettingServices.cs

示例7: SettingParseInvalidTypeException

 /// <summary>
 /// Constructs a new InvalidSettingTypeException.
 /// </summary>
 public SettingParseInvalidTypeException (Setting setting, Type parsedType)
     : base (
         String.Format ("Expecting setting type: {0}, doesn't match setting: {1}", parsedType.FullName, setting))
 {
     _setting = setting;
     _parsedType = parsedType;
 }
开发者ID:aqueduct,项目名称:Aqueduct.SitecoreLib,代码行数:10,代码来源:SettingParseInvalidTypeException.cs

示例8: GetInstance

 public static Setting GetInstance()
 {
     if (null == Instance) {
         Instance = new Setting();
     }
     return Instance;
 }
开发者ID:OrangeZhang,项目名称:MyScripts,代码行数:7,代码来源:Setting.cs

示例9: GetSetting

 public static object GetSetting(Setting setting)
 {
     if (IsolatedStorageSettings.ApplicationSettings.Contains(setting.Key()))
         return IsolatedStorageSettings.ApplicationSettings[setting.Key()];
     else
         return DefaultValue(setting);
 }
开发者ID:hmehart,项目名称:Notepad,代码行数:7,代码来源:SettingsUtils.cs

示例10: LoadUserAgnetSetting

 public void LoadUserAgnetSetting(Setting.Setting.UserAgentStruct userAgent)
 {
     checkBox_IsRandom.Checked = userAgent.IsRandom;
     foreach (var i in userAgent.UserAgentList)
     {
         //不显示Custom值
         if (i.Key == "Custom") continue;
         comboBox_UserAgentList.Items.Add(i);
     }
     //显示选中项
     if (userAgent.Selected.Key == "Custom")
     {
         //作为自定义内容显示在comboBox_UserAgentList.Text
         comboBox_UserAgentList.Text = userAgent.Selected.Value;
     }
     else
     {
         //从现有的items中选择
         foreach (object i in comboBox_UserAgentList.Items)
         {
             if (((KeyValuePair<string,string>)i).Key == userAgent.Selected.Key)
             {
                 comboBox_UserAgentList.SelectedItem = i;
             }
             break;
         }
     }
 }
开发者ID:GHubgenius,项目名称:Altman,代码行数:28,代码来源:ControlUserAgentSetting.cs

示例11: BurnStatus

 public BurnStatus( Character person, Setting setting)
     : base(person)
 {
     duration = setting.duration;
     damage = setting.damage;
     maxOverlay = setting.maxOverlay;
 }
开发者ID:HetongWang,项目名称:dark-conqueror,代码行数:7,代码来源:BurnStatus.cs

示例12: SaveSetting

        public void SaveSetting(Setting setting)
        {
            if(GetSetting() == null && setting.Id == 0)
                _dataContext.Settings.Add(setting);

            _dataContext.SaveChanges();
        }
开发者ID:stack72,项目名称:GiveCamp-London,代码行数:7,代码来源:SettingRepository.cs

示例13: Insert

 public void Insert(Setting setting)
 {
     if (storage.Settings.Where(x => x.Key == setting.Key).Count() > 0)
         storage.Settings.Where(x => x.Key == setting.Key).First().Value = setting.Value;
     else storage.Settings.Add(setting);
     storage.SaveChanges();
 }
开发者ID:KamalRathnayake,项目名称:K-Plus-Shortcut-Gadget,代码行数:7,代码来源:BinaryRepositories.cs

示例14: BooleanButton

 public BooleanButton(Menu.MenuSettings ms, string text, Setting<bool> setting = null)
     : base(ms)
 {
     this.text = text;
     this.isEnabled = setting == null || setting.Value;
     this.setting = setting;
 }
开发者ID:benjy3gg,项目名称:PoeHud,代码行数:7,代码来源:BooleanButton.cs

示例15: Set

 public static void Set(Setting setting, string value)
 {
     var settingName = setting.ToString();
     var bytes = Encoding.UTF8.GetBytes(value);
     var encryptedBytes = ProtectedData.Protect(bytes, null);
     IsolatedStorageSettings.ApplicationSettings[settingName] = encryptedBytes;
 }
开发者ID:jasonamyers,项目名称:Apps,代码行数:7,代码来源:Settings.cs


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