Exemple #1
0
		static RuntimeTypeModel GetProtobufModel()
		{
			if (_pbModel == null) {
				_pbModel = TypeModel.Create();
				_pbModel.AllowParseableTypes=true;
				_pbModel.Add(typeof(Font), false).SetSurrogate(typeof(ProtoFont));
				_pbModel.Add(typeof(Color), false).SetSurrogate(typeof(ProtoColor));
				_pbModel.Add(typeof(StringFormat), false).SetSurrogate(typeof(ProtoStringFormat));
				_pbModel.Add(typeof(Point<float>), true).Add("X", "Y");
				_pbModel.Add(typeof(DrawStyle), true).AddSubType(100, typeof(DiagramDrawStyle));
				_pbModel[typeof(BoundingBox<float>)].Add("X1", "X2", "Y1", "Y2");
				_pbModel[typeof(BoundingBox<float>)].UseConstructor = false;
				Debug.WriteLine(_pbModel.GetSchema(typeof(DiagramDocumentCore)));
			}
			return _pbModel;
		}