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

C# ConfigData类代码示例

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

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



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

示例1: DoCompilation

        private static void DoCompilation(ConfigData cfg, ref  bool showUsage)
        {
            var showUsage1 = showUsage;
            CompilerEngine.ExecuteInSeparateAppDomain(
                ce =>
                {
                    ce.Configuration = cfg.Configuration;
                    ce.CsProject = cfg.CsProject;
                    ce.OutDir = cfg.OutDir;
                    ce.Referenced.Clear();
                    ce.TranlationHelpers.Clear();
                    ce.ReferencedPhpLibsLocations.Clear();

                    // src and dest can be in different application domain
                    // we need to add item by item
                    ce.Set1(cfg.Referenced.ToArray(),
                        cfg.TranlationHelpers.ToArray(),
                        cfg.ReferencedPhpLibsLocations.Select(a => a.Key + "\n" + a.Value).ToArray()
                        );
                    ce.BinaryOutputDir = cfg.BinaryOutputDir;
                    Debug.Assert(ce.Referenced.Count == cfg.Referenced.Count);
                    Debug.Assert(ce.TranlationHelpers.Count == cfg.TranlationHelpers.Count);
                    Debug.Assert(ce.ReferencedPhpLibsLocations.Count == cfg.ReferencedPhpLibsLocations.Count);
                    //ce.CopyFrom(aa);
                    ce.Check();
                    showUsage1 = false;
                    ce.Compile();
                });
            showUsage = showUsage1;
        }
开发者ID:exaphaser,项目名称:cs2php,代码行数:30,代码来源:Program.cs


示例2: Create

 //-------------------------------------------------------------------
 // Factory function for ConfigData to initialize an array of this class
 //-------------------------------------------------------------------
 public static ConfigData Create()
 {
    ConfigData configData = new ConfigData();
    for (int i = 0; i < 3; i++)
       configData.Games[i] = Buffers.GameData.Create();
    return configData;
 }
开发者ID:shadownight8,项目名称:MarioPort,代码行数:10,代码来源:Mario.cs


示例3: ConfigData

    // Copy constructor of ConfigData class.
    public ConfigData(ConfigData original)
    {
        // Create Frame Marker array and copy over values from original.
        frameMarkers =
            new FrameMarker[QCARUtilities.GlobalVars.MAX_NUM_FRAME_MARKERS];
        for (int i = 0; i < frameMarkers.Length; ++i)
        {
            frameMarkers[i] = original.frameMarkers[i];
        }

        // Create Frame Marker defined array and copy over values from original.
        frameMarkersDefined =
            new bool[QCARUtilities.GlobalVars.MAX_NUM_FRAME_MARKERS];
        for (int i = 0; i < frameMarkersDefined.Length; ++i)
        {
            frameMarkersDefined[i] = original.frameMarkersDefined[i];
        }

        // Create Image Target dictionary from original.
        imageTargets =
            new Dictionary<string, ImageTarget>(original.imageTargets);

        // Create Multi Target dictionary from original.
        multiTargets =
            new Dictionary<string, MultiTarget>(original.multiTargets);
    }
开发者ID:krowk23,项目名称:ice--breaker,代码行数:27,代码来源:ConfigData.cs


示例4: ReadConfig

        /// <summary>
        /// Считывает содержимое конфигурационного файла. Предполагается, что файл точно существует и корректен.
        /// </summary>
        private static void ReadConfig()
        {
            var dsr = new DataContractSerializer(typeof(ConfigData));
             configData = (ConfigData)dsr.ReadObject(new FileStream(ConfigFilePath, FileMode.Open));

             Logger.Print("GTA Folder: " + configData.GTAFolderPath);
        }
开发者ID:dennisyolkin,项目名称:gta_gameworld_renderer,代码行数:10,代码来源:Config.cs


示例5: CopyToRetryRemoteTest

        public void CopyToRetryRemoteTest()
        {
            FileRetryCommand cmd = new FileRetryCommand();
            ConfigData stationConfig = new ConfigData(configStream);
            cmd.Initialize(stationConfig);

            string newID = DateTime.Now.Ticks.ToString();

            string remoteTargetDir = @"\\test1.company.com\C$\Inspector\Test\Delay\Ready\";
            string remoteTargetPath = remoteTargetDir + newID + ".tif";

            // delete existing file
            // NOTE: This is commented out because it had problems getting error 1219 from the UNC connection
            // Workaround: new filename every time.
            //string possibleError;
            //bool useUNC;
            //UNCAccessWithCredentials unc =
            //    Util.ConnectUNC("administrator", "password", remoteTargetDir, out possibleError, out useUNC);
            //Assert.IsNull(possibleError, "Error trying to delete remote test file: " + possibleError);
            //if (File.Exists(remoteTargetPath))
            //{
            //    File.Delete(remoteTargetPath);
            //}
            //if (unc != null) unc.Dispose();

            FileFolderInstance instance = new FileFolderInstance();
            instance.ID = newID;
            instance.FileName = "DOC46711.tif";
            instance.Location = "FileFolderTest/Failed/" + instance.FileName;
            instance.Path = ConfigDataTest.TESTFILEDIR + instance.Location;

            cmd.CopyToRetry(instance);

            Assert.IsTrue(File.Exists(remoteTargetPath));
        }
开发者ID:jblindberg,项目名称:Clouseau,代码行数:35,代码来源:FileRetryCommandTest.cs


示例6: Load

        public static bool Load(out ConfigData cfg)
        {
            bool bSuccess = false;

            cfg = Reset();

            if (File.Exists(ConfigFile))
            {
                StreamReader cfgfilebe = File.OpenText(ConfigFile);
                string[] temp = new string[2];
                while (!cfgfilebe.EndOfStream)
                {
                    temp = cfgfilebe.ReadLine().Split('=');
                    switch (temp[0])
                    {
                        case "smloc": cfg.studiomdl = temp[1]; break;
                        case "gmdir": cfg.gamedir = temp[1]; break;
                        case "autoc": cfg.autoclose = bool.Parse(temp[1]); break;
                        case "qcloc":
                            if (File.Exists(temp[1]))
                            {
                                cfg.qcloc = temp[1];
                            }
                            break;
                        default: break;
                    }
                }
                cfgfilebe.Close();
                bSuccess = true;
            }
            return bSuccess;
        }
开发者ID:Pisti01,项目名称:PistiStudioMDL,代码行数:32,代码来源:SettingsManager.cs


示例7: JoinZone

    //----------------------------------------------------------
    // Public interface methods for UI
    //----------------------------------------------------------
    public void JoinZone()
    {
        // Set connection parameters
        ConfigData cfg = new ConfigData();
        cfg.Host = Host;
        #if !UNITY_WEBGL
        cfg.Port = TcpPort;
        #else
        cfg.Port = WSPort;
        #endif
        cfg.Zone = Zone;

        // Initialize SFS2X client and add listeners
        #if !UNITY_WEBGL
        sfs = new SmartFox();
        #else
        sfs = new SmartFox(UseWebSocket.WS);
        #endif
        cfg.Debug = true;

        // Set ThreadSafeMode explicitly, or Windows Store builds will get a wrong default value (false)
        sfs.ThreadSafeMode = true;

        sfs.AddEventListener(SFSEvent.CONNECTION, OnConnection);
        sfs.AddEventListener(SFSEvent.CONNECTION_LOST, OnConnectionLost);
        sfs.AddEventListener(SFSEvent.LOGIN, OnLogin);
        sfs.AddEventListener(SFSEvent.LOGIN_ERROR, OnLoginError);

        // Connect to SFS2X
        sfs.Connect(cfg);
    }
开发者ID:fmo080308,项目名称:TinyTroop,代码行数:34,代码来源:SmartFoxLogin.cs


示例8: AddVirtualButtons

 // Add Virtual Buttons that are specified in the configuration data.
 public static void AddVirtualButtons(ImageTargetBehaviour it,
     ConfigData.VirtualButton[] vbs)
 {
     for (int i = 0; i < vbs.Length; ++i)
     {
         AddVirtualButton(it, vbs[i]);
     }
 }
开发者ID:jhoe123,项目名称:Yonatan-Project,代码行数:9,代码来源:ImageTargetEditor.cs


示例9: Connect

 public void Connect(ConfigData data)
 {
     Debug.Log ("now connection Zone");
     sfs.ThreadSafeMode = true;
     Debug.Log ("IP : " + data.Host);
     Debug.Log ("Port : " + data.Port);
     sfs.Connect(data);
 }
开发者ID:Chongcharen,项目名称:MadnessFotball,代码行数:8,代码来源:NetworkLobbyConsole.cs


示例10: UpdateParts

    // Updates MultiTarget parts with the values stored in the "prtConfigs"
    // array. Deletes all parts and recreates them.
    public static void UpdateParts(MultiTargetBehaviour mt,
        ConfigData.MultiTargetPart[] prtConfigs)
    {
        Transform childTargets = mt.transform.Find("ChildTargets");

        if (childTargets != null)
        {
            Object.DestroyImmediate(childTargets.gameObject);
        }

        GameObject newObject = new GameObject();
        newObject.name = "ChildTargets";
        newObject.transform.parent = mt.transform;
        newObject.hideFlags = HideFlags.NotEditable;

        newObject.transform.localPosition = Vector3.zero;
        newObject.transform.localRotation = Quaternion.identity;
        newObject.transform.localScale = Vector3.one;

        childTargets = newObject.transform;

        Material maskMaterial =
            (Material)AssetDatabase.LoadAssetAtPath(
                QCARUtilities.GlobalVars.PATH_TO_MASK_MATERIAL,
                typeof(Material));

        int numParts = prtConfigs.Length;
        for (int i = 0; i < numParts; ++i)
        {
            ConfigData.ImageTarget itConfig;

            if (!SceneManager.Instance.GetImageTarget(prtConfigs[i].name, out itConfig) &&
                prtConfigs[i].name != QCARUtilities.GlobalVars.DEFAULT_NAME)
            {
                Debug.LogError("No image target named " + prtConfigs[i].name);
                return;
            }

            Vector2 size = itConfig.size;
            Vector3 scale = new Vector3(size.x * 0.1f, 1, size.y * 0.1f);

            GameObject plane = GameObject.CreatePrimitive(PrimitiveType.Plane);
            plane.name = prtConfigs[i].name;
            plane.transform.parent = childTargets.transform;

            plane.transform.localPosition = prtConfigs[i].translation;
            plane.transform.localRotation = prtConfigs[i].rotation;
            plane.transform.localScale = scale;

            UpdateMaterial(plane);

            plane.hideFlags = HideFlags.NotEditable;

            MaskOutBehaviour script =
                (MaskOutBehaviour)plane.AddComponent(typeof(MaskOutBehaviour));
            script.maskMaterial = maskMaterial;
        }
    }
开发者ID:krowk23,项目名称:ice--breaker,代码行数:60,代码来源:MultiTargetEditor.cs


示例11: Save

 public static void Save(ConfigData cfg)
 {
     StreamWriter sw = new StreamWriter(ConfigFile);
     sw.WriteLine("smloc=" + cfg.studiomdl);
     sw.WriteLine("gmdir=" + cfg.gamedir);
     sw.WriteLine("autoc=" + cfg.autoclose);
     sw.WriteLine("qcloc=" + cfg.qcloc);
     sw.Close();
 }
开发者ID:Pisti01,项目名称:PistiStudioMDL,代码行数:9,代码来源:SettingsManager.cs


示例12: Initialize

        /**
         * initialization using data in ConfigData object.
         * This should be called immediately after the constructor.
         * Each Station subclass should call base.initialize(configData) from its
         * own initialize() class.
         */
        public override void Initialize(ConfigData configData, InstanceMemory memory, Resolver commandResolver)
        {
            base.Initialize(configData, memory, commandResolver); // common initialization

            StationDescription = ("Test Station");

            // for testing, set up StationEntity list
            setTestStationEntities();
        }
开发者ID:jblindberg,项目名称:Clouseau,代码行数:15,代码来源:TestStation.cs


示例13: Remove

        /// <summary>
        /// 刪除指定的組態。
        /// </summary>
        /// <param name="conf"></param>
        public void Remove(ConfigData conf)
        {
            if (Readonly)
                throw new ArgumentException("此類型的組態是唯讀的。");

            conf.Record.EditAction = 3; //刪除
            Provider.SaveConfiguration(new ConfigurationRecord[] { conf.Record });
            Cache.SyncData(conf.Namespace);
        }
开发者ID:ChunTaiChen,项目名称:K12.Data,代码行数:13,代码来源:ConfigurationManager.cs


示例14: CreateConfigData

 public static ConfigData CreateConfigData(object[,] head)
 {
     ConfigData cfgData = new ConfigData();
     if (null == head || cfgData.Init(head) == false)
     {
         return null;
     }
     return cfgData;
 }
开发者ID:zhenghehe2014,项目名称:u3dframework,代码行数:9,代码来源:ConfigData.cs


示例15: Connect

    void Connect()
    {
        ConfigData cfg = new ConfigData();
        cfg.Host = input_ipAddress.text;
        cfg.Port = System.Convert.ToInt32(sfsSetting.m_Port);
        cfg.Zone = sfsSetting.m_zone;
        cfg.Debug = true;

        m_NetworkLobby.Connect (cfg);
    }
开发者ID:Chongcharen,项目名称:MadnessFotball,代码行数:10,代码来源:UILobbyConsole.cs


示例16: ConfigData

    // Copy constructor of ConfigData class.
    public ConfigData(ConfigData original)
    {
        // Create Image Target dictionary from original.
        imageTargets =
            new Dictionary<string, ImageTargetData>(original.imageTargets);

        // Create Multi Target dictionary from original.
        multiTargets =
            new Dictionary<string, MultiTargetData>(original.multiTargets);
    }
开发者ID:arunredmonster,项目名称:app-unity-master,代码行数:11,代码来源:ConfigData.cs


示例17: UpdateAspectRatio

    /// <summary>
    /// Define the ratio between sidelength, top diameter, and bottom diameter.
    /// Geometry and materials are updated according to the new parameters.
    /// </summary>
    public static void UpdateAspectRatio(IEditorCylinderTargetBehaviour ct, ConfigData.CylinderTargetData ctConfig)
    {
        var topRatio = ctConfig.topDiameter/ctConfig.sideLength;
        var bottomRatio = ctConfig.bottomDiameter/ctConfig.sideLength;

        ct.SetAspectRatio(topRatio, bottomRatio);
        UpdateGeometry(ct, 1.0f, topRatio, bottomRatio, ctConfig.hasTopGeometry, ctConfig.hasBottomGeometry);

        //assign materials
        UpdateMaterials(ct, ctConfig.hasBottomGeometry, ctConfig.hasTopGeometry, INSIDE_MATERIAL);
    }
开发者ID:carrizofm2010,项目名称:app012-acuariotribuno,代码行数:15,代码来源:CylinderTargetEditor.cs


示例18: HasConnectionString

 public static bool HasConnectionString(ConfigData cdApp)
 {
     if (!string.IsNullOrEmpty(cdApp["Server"]) &&
         !string.IsNullOrEmpty(cdApp["Database"]) &&
         !string.IsNullOrEmpty(cdApp["User"]) &&
         !string.IsNullOrEmpty(cdApp["Password"])
         )
         return true;
     else
         return false;
 }
开发者ID:KunHsiang,项目名称:ischedulePlus,代码行数:11,代码来源:DataAccess.cs


示例19: SaveConfigData

        public static bool SaveConfigData(ConfigData config)
        {
            if (!File.Exists(CONFIG_FNAME)) return false; // don't do anything if file doesn't exist

            using (FileStream fs = new FileStream(CONFIG_FNAME, FileMode.Create))
            {
                XmlSerializer xs = new XmlSerializer(typeof(ConfigData));
                xs.Serialize(fs, config);
                return true;
            }
        }
开发者ID:gordonc64,项目名称:CellAO-Archived-Obsolete,代码行数:11,代码来源:Config.cs


示例20: ConfigDataManager

    // Private constructor. Class is implemented as a singleton.
    private ConfigDataManager()
    {
        mConfigData = new ConfigData();

        mDoAsyncWrite = false;
        mReadInProgress = false;
        mLockData = false;

        mUpdateTimer = new Timer(20.0);
        mUpdateTimer.Elapsed += new ElapsedEventHandler(TimedUpdate);
        mUpdateTimer.Enabled = true;
    }
开发者ID:krowk23,项目名称:ice--breaker,代码行数:13,代码来源:ConfigDataManager.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# ConfigFile类代码示例发布时间:2022-05-24
下一篇:
C# ConfigCacheSet类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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