PKStudio.Helpers.EditorsFormsController.ShowFeatureEditorByGuid C# (CSharp) Method

ShowFeatureEditorByGuid() protected method

protected ShowFeatureEditorByGuid ( string guid ) : IEventComponent
guid string
return IEventComponent
        protected IEventComponent ShowFeatureEditorByGuid(string guid)
        {
            bool exist = false;
            foreach (DockContent item in DockPanel.Contents)
            {
                if (item.GetType() == typeof(FeatureEditor))
                {
                    FeatureEditor editor = (FeatureEditor)item;
                    if (editor.Feature.Guid == guid)
                    {
                        editor.Show();
                        exist = true;
                    }
                }
            }

            if (!exist)
            {
                FeatureWrapper feat = PK.Wrapper.FindFeature(guid);
                if (feat != null)
                {
                    FE = new FeatureEditor();
                    FE.OpenContainingFolderEvent += new EventHandler<Forms.BaseForms.PathEventArgs>(OpenContainingFolderEvent);
                    FE.SetFeat(feat);
                    FE.Show(DockPanel, DockState.Document);
                    return FE;
                }
            }
            return null;
        }