示例#1
0
		private void OnCreate()
		{
			var createMPTEventArg = new CreateGKMPTEventArg();
			ServiceFactory.Events.GetEvent<CreateGKMPTEvent>().Publish(createMPTEventArg);
			if (createMPTEventArg.MPT != null)
				GKPlanExtension.Instance.RewriteItem(IElementMPT, createMPTEventArg.MPT);
			if (!createMPTEventArg.Cancel)
				Close(true);
		}
		void OnCreateNew()
		{
			var createGKMPTEventArg = new CreateGKMPTEventArg();
			ServiceFactory.Events.GetEvent<CreateGKMPTEvent>().Publish(createGKMPTEventArg);
			if (createGKMPTEventArg.MPT != null)
			{
				SourceMPTs.Add(createGKMPTEventArg.MPT);
				SelectedSourceMPT = SourceMPTs.FirstOrDefault(x => x == createGKMPTEventArg.MPT);
			}
		}