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


C# PBXDictionary类代码示例

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


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

示例1: XCProject

    public XCProject(string filePath) : this()
    {
        if (!System.IO.Directory.Exists(filePath))
        {
            Debug.LogWarning("Path does not exists.");
            return;
        }

        if (filePath.EndsWith(".xcodeproj"))
        {
            this.projectRootPath = Path.GetDirectoryName(filePath);
            this.filePath = filePath;
        }
        else
        {
            string[] projects = System.IO.Directory.GetDirectories(filePath, "*.xcodeproj");
            if (projects.Length == 0)
            {
                Debug.LogWarning("Error: missing xcodeproj file");
                return;
            }

            this.projectRootPath = filePath;
            this.filePath = projects[0];
        }

        projectFileInfo = new FileInfo(Path.Combine(this.filePath, "project.pbxproj"));
        StreamReader sr = projectFileInfo.OpenText();
        string contents = sr.ReadToEnd();
        sr.Close();

        PBXParser parser = new PBXParser();
        _datastore = parser.Decode(contents);
        if (_datastore == null)
        {
            throw new System.Exception("Project file not found at file path " + filePath);
        }

        if (!_datastore.ContainsKey("objects"))
        {
            Debug.Log("Errore " + _datastore.Count);
            return;
        }

        _objects = (PBXDictionary) _datastore["objects"];
        modified = false;

        _rootObjectKey = (string) _datastore["rootObject"];
        if (!string.IsNullOrEmpty(_rootObjectKey))
        {
            _project = new PBXProject(_rootObjectKey, (PBXDictionary) _objects[_rootObjectKey]);
            _rootGroup = new PBXGroup(_rootObjectKey, (PBXDictionary) _objects[_project.mainGroupID]);
        }
        else
        {
            Debug.LogWarning("Error: project has no root object");
            _project = null;
            _rootGroup = null;
        }
    }
开发者ID:jose-castillo,项目名称:SoundPuzzle,代码行数:60,代码来源:XCProject.cs

示例2: PBXObject

 public PBXObject()
 {
     _data = new PBXDictionary();
     _data[ISA_KEY] = this.GetType().Name;
     _guid = GenerateGuid();
     internalNewlines = false;
 }
开发者ID:jose-castillo,项目名称:SoundPuzzle,代码行数:7,代码来源:PBXObject.cs

示例3: Encode

		public string Encode( PBXDictionary pbxData, bool readable = false )
		{
			StringBuilder builder = new StringBuilder( PBX_HEADER_TOKEN, BUILDER_CAPACITY );
			bool success = SerializeValue( pbxData, builder, readable );

			return ( success ? builder.ToString() : null );
		}
开发者ID:ashishsfb,项目名称:Save-The-Kitty,代码行数:7,代码来源:PBXParser.cs

示例4: PBXBuildFile

    public PBXBuildFile(string guid, PBXDictionary dictionary) : base(guid, dictionary)
    {
        if (!this.data.ContainsKey(SETTINGS_KEY))
        {
            return;
        }
        object settingsObj = this.data[SETTINGS_KEY];

        if (!(settingsObj is PBXDictionary))
        {
            return;
        }
        PBXDictionary settingsDict = (PBXDictionary) settingsObj;
        settingsDict.internalNewlines = false;

        if (!settingsDict.ContainsKey(ATTRIBUTES_KEY))
        {
            return;
        }
        object attributesObj = settingsDict[ATTRIBUTES_KEY];

        if (!(attributesObj is PBXList))
        {
            return;
        }

        PBXList attributesCast = (PBXList) attributesObj;
        attributesCast.internalNewlines = false;
    }
开发者ID:jose-castillo,项目名称:SoundPuzzle,代码行数:29,代码来源:PBXBuildFile.cs

示例5: SetWeakLink

		public void SetWeakLink( bool weak)
		{
			PBXDictionary settings = null;
			PBXList attributes = null;

			if (_data.ContainsKey (SETTINGS_KEY)) {
				settings = _data[SETTINGS_KEY] as PBXDictionary;
				if (settings.ContainsKey(ATTRIBUTES_KEY)) {
					attributes = settings[ATTRIBUTES_KEY] as PBXList;
				}
			}

			if (weak) {
				if (settings == null) {
					settings = new PBXDictionary();
					settings.internalNewlines = false;
					_data.Add(SETTINGS_KEY, settings);
				}

				if (attributes == null) {
					attributes = new PBXList();
					attributes.internalNewlines = false;
					attributes.Add(WEAK_VALUE);
					settings.Add(ATTRIBUTES_KEY, attributes);
				}
			}
			else {
				if(attributes != null  && attributes.Contains(WEAK_VALUE)) {
					attributes.Remove(WEAK_VALUE);
				}
			}
		}
开发者ID:DefyGames,项目名称:FyberUnityDemo,代码行数:32,代码来源:FyberPBXBuildFile.cs

示例6: SetWeakLink

    public bool SetWeakLink(bool weak = false)
    {
        PBXDictionary settings = null;
        PBXList attributes = null;

        if (!_data.ContainsKey(SETTINGS_KEY))
        {
            if (weak)
            {
                attributes = new PBXList();
                attributes.internalNewlines = false;
                attributes.Add(WEAK_VALUE);

                settings = new PBXDictionary();
                settings.Add(ATTRIBUTES_KEY, attributes);
                settings.internalNewlines = false;

                this.Add(SETTINGS_KEY, settings);
            }
            return true;
        }

        settings = _data[SETTINGS_KEY] as PBXDictionary;
        settings.internalNewlines = false;
        if (!settings.ContainsKey(ATTRIBUTES_KEY))
        {
            if (weak)
            {
                attributes = new PBXList();
                attributes.internalNewlines = false;
                attributes.Add(WEAK_VALUE);
                settings.Add(ATTRIBUTES_KEY, attributes);
                return true;
            }
            else
            {
                return false;
            }
        }
        else
        {
            attributes = settings[ATTRIBUTES_KEY] as PBXList;
        }

        attributes.internalNewlines = false;
        if (weak)
        {
            attributes.Add(WEAK_VALUE);
        }
        else
        {
            attributes.Remove(WEAK_VALUE);
        }

        settings.Add(ATTRIBUTES_KEY, attributes);
        this.Add(SETTINGS_KEY, settings);

        return true;
    }
开发者ID:jose-castillo,项目名称:SoundPuzzle,代码行数:59,代码来源:PBXBuildFile.cs

示例7: PBXObject

		public PBXObject( string guid, PBXDictionary dictionary ) : this( guid )
		{
			if( !dictionary.ContainsKey( ISA_KEY ) || ((string)dictionary[ ISA_KEY ]).CompareTo( this.GetType().Name ) != 0 )
				Debug.LogError( "PBXDictionary is not a valid ISA object" );
			
			foreach( KeyValuePair<string, object> item in dictionary ) {
				_data[ item.Key ] = item.Value;
			}
		}
开发者ID:ashishsfb,项目名称:Save-The-Kitty,代码行数:9,代码来源:PBXObject.cs

示例8: Encode

    public string Encode(PBXDictionary pbxData)
    {
        indent = 0;

        StringBuilder builder = new StringBuilder(PBX_HEADER_TOKEN, BUILDER_CAPACITY);
        bool success = SerializeValue(pbxData, builder);

        return (success ? builder.ToString() : null);
    }
开发者ID:jose-castillo,项目名称:SoundPuzzle,代码行数:9,代码来源:PBXParser.cs

示例9: XCProject

        public XCProject( string filePath )
            : this()
        {
            if( !System.IO.Directory.Exists( filePath ) ) {
                Debug.LogWarning( "XCode project path does not exist: " + filePath );
                return;
            }

            if( filePath.EndsWith( ".xcodeproj" ) ) {
                Debug.Log( "Opening project " + filePath );
                this.projectRootPath = Path.GetDirectoryName( filePath );
                this.filePath = filePath;
            } else {
                Debug.Log( "Looking for xcodeproj files in " + filePath );
                string[] projects = System.IO.Directory.GetDirectories( filePath, "*.xcodeproj" );
                if( projects.Length == 0 ) {
                    Debug.LogWarning( "Error: missing xcodeproj file" );
                    return;
                }

                this.projectRootPath = filePath;
                //if the path is relative to the project, we need to make it absolute
                if (!System.IO.Path.IsPathRooted(projectRootPath))
                    projectRootPath = Application.dataPath.Replace("Assets", "") + projectRootPath;
                //Debug.Log ("projectRootPath adjusted to " + projectRootPath);
                this.filePath = projects[ 0 ];
            }

            projectFileInfo = new FileInfo( Path.Combine( this.filePath, "project.pbxproj" ) );
            string contents = projectFileInfo.OpenText().ReadToEnd();

            PBXParser parser = new PBXParser();
            _datastore = parser.Decode( contents );
            if( _datastore == null ) {
                throw new System.Exception( "Project file not found at file path " + filePath );
            }

            if( !_datastore.ContainsKey( "objects" ) ) {
                Debug.Log( "Errore " + _datastore.Count );
                return;
            }

            _objects = (PBXDictionary)_datastore["objects"];
            modified = false;

            _rootObjectKey = (string)_datastore["rootObject"];
            if( !string.IsNullOrEmpty( _rootObjectKey ) ) {
                _project = new PBXProject( _rootObjectKey, (PBXDictionary)_objects[ _rootObjectKey ] );
                _rootGroup = new PBXGroup( _rootObjectKey, (PBXDictionary)_objects[ _project.mainGroupID ] );
            }
            else {
                Debug.LogWarning( "error: project has no root object" );
                _project = null;
                _rootGroup = null;
            }
        }
开发者ID:gmosdk,项目名称:unity,代码行数:56,代码来源:XCProject.cs

示例10: AddCodeSignOnCopy

        //CodeSignOnCopy
        public bool AddCodeSignOnCopy()
        {
            if( !_data.ContainsKey( SETTINGS_KEY ) )
                _data[ SETTINGS_KEY ] = new PBXDictionary();

            var settings = _data[ SETTINGS_KEY ] as PBXDictionary;
            if( !settings.ContainsKey( ATTRIBUTES_KEY ) ) {
                var attributes = new PBXList();
                attributes.Add( "CodeSignOnCopy" );
                attributes.Add( "RemoveHeadersOnCopy" );
                settings.Add( ATTRIBUTES_KEY, attributes );
            }
            else {
                var attributes = settings[ ATTRIBUTES_KEY ] as PBXList;
                attributes.Add( "CodeSignOnCopy" );
                attributes.Add( "RemoveHeadersOnCopy" );
            }
            return true;
        }
开发者ID:ChenKaiJung,项目名称:XCodeEditor-for-Unity,代码行数:20,代码来源:PBXBuildFile.cs

示例11: AddCompilerFlag

		public bool AddCompilerFlag( string flag )
		{
			if( !_data.ContainsKey( SETTINGS_KEY ) )
				_data[ SETTINGS_KEY ] = new PBXDictionary();
			
			if( !((PBXDictionary)_data[ SETTINGS_KEY ]).ContainsKey( COMPILER_FLAGS_KEY ) ) {
				((PBXDictionary)_data[ SETTINGS_KEY ]).Add( COMPILER_FLAGS_KEY, flag );
				return true;
			}
			
			string[] flags = ((string)((PBXDictionary)_data[ SETTINGS_KEY ])[ COMPILER_FLAGS_KEY ]).Split( ' ' );
			foreach( string item in flags ) {
				if( item.CompareTo( flag ) == 0 )
					return false;
			}
			
			((PBXDictionary)_data[ SETTINGS_KEY ])[ COMPILER_FLAGS_KEY ] = ( string.Join( " ", flags ) + " " + flag );
			return true;
		}
开发者ID:ashishsfb,项目名称:Save-The-Kitty,代码行数:19,代码来源:PBXBuildFile.cs

示例12: AddCompilerFlag

        public bool AddCompilerFlag( string flag )
        {
            if( !_data.ContainsKey( SETTINGS_KEY ) )
                _data[ SETTINGS_KEY ] = new PBXDictionary();

            if( !((PBXDictionary)_data[ SETTINGS_KEY ]).ContainsKey( COMPILER_FLAGS_KEY ) ) {
                ((PBXDictionary)_data[ SETTINGS_KEY ]).Add( COMPILER_FLAGS_KEY, flag );
                return true;
            }

            string[] flags = ((string)((PBXDictionary)_data[ SETTINGS_KEY ])[ COMPILER_FLAGS_KEY ]).Split( ' ' );
            foreach( string item in flags ) {
                if( item.CompareTo( flag ) == 0 )
                    return false;
            }

            ((PBXDictionary)_data[ SETTINGS_KEY ])[ COMPILER_FLAGS_KEY ] = ( string.Join( " ", flags ) + " " + flag );
            return true;

            //		def add_compiler_flag(self, flag):
            //        k_settings = 'settings'
            //        k_attributes = 'COMPILER_FLAGS'
            //
            //        if not self.has_key(k_settings):
            //            self[k_settings] = PBXDict()
            //
            //        if not self[k_settings].has_key(k_attributes):
            //            self[k_settings][k_attributes] = flag
            //            return True
            //
            //        flags = self[k_settings][k_attributes].split(' ')
            //
            //        if flag in flags:
            //            return False
            //
            //        flags.append(flag)
            //
            //        self[k_settings][k_attributes] = ' '.join(flags)
        }
开发者ID:npnf-inc,项目名称:game-funny-studio,代码行数:39,代码来源:CPBXBuildFile.cs

示例13: PBXVariantGroup

 public PBXVariantGroup(string guid, PBXDictionary dictionary) : base(guid, dictionary)
 {
     internalNewlines = true;
 }
开发者ID:jose-castillo,项目名称:SoundPuzzle,代码行数:4,代码来源:PBXObject.cs

示例14: PBXContainerItemProxy

 public PBXContainerItemProxy(string guid, PBXDictionary dictionary) : base(guid, dictionary)
 {
     internalNewlines = true;
 }
开发者ID:jose-castillo,项目名称:SoundPuzzle,代码行数:4,代码来源:PBXObject.cs

示例15: PBXReferenceProxy

 public PBXReferenceProxy(string guid, PBXDictionary dictionary) : base(guid, dictionary)
 {
     internalNewlines = true;
 }
开发者ID:jose-castillo,项目名称:SoundPuzzle,代码行数:4,代码来源:PBXObject.cs


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