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


C# ConfigData类代码示例

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


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


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