diff --git a/Bcfier.Revit/Data/RevitView.cs b/Bcfier.Revit/Data/RevitView.cs index 5c0eefb9..ca7f0f17 100644 --- a/Bcfier.Revit/Data/RevitView.cs +++ b/Bcfier.Revit/Data/RevitView.cs @@ -143,7 +143,7 @@ public static VisualizationInfo GenerateViewpoint(UIDocument uidoc) } //COMPONENTS PART string versionName = doc.Application.VersionName; - v.Components = new List(); + v.Components = new Components(); var visibleElems = new FilteredElementCollector(doc, doc.ActiveView.Id) .WhereElementIsNotElementType() @@ -157,49 +157,49 @@ public static VisualizationInfo GenerateViewpoint(UIDocument uidoc) var selectedElems = uidoc.Selection.GetElementIds(); - + //TODO: FIX visibility/selection //include only hidden elements and selected in the BCF - if (visibleElems.Count() > hiddenElems.Count()) - { - foreach (var elem in hiddenElems) - { - v.Components.Add(new Component - { - OriginatingSystem = versionName, - IfcGuid = IfcGuid.ToIfcGuid(ExportUtils.GetExportId(doc, elem.Id)), - Visible = false, - Selected = false, - AuthoringToolId = elem.Id.IntegerValue.ToString() - }); - } - foreach (var elem in selectedElems) - { - v.Components.Add(new Component - { - OriginatingSystem = versionName, - IfcGuid = IfcGuid.ToIfcGuid(ExportUtils.GetExportId(doc, elem)), - Visible = true, - Selected = true, - AuthoringToolId = elem.IntegerValue.ToString() - }); - } - } + //if (visibleElems.Count() > hiddenElems.Count()) + //{ + // foreach (var elem in hiddenElems) + // { + // v.Components.Add(new Component + // { + // OriginatingSystem = versionName, + // IfcGuid = IfcGuid.ToIfcGuid(ExportUtils.GetExportId(doc, elem.Id)), + // Visible = false, + // Selected = false, + // AuthoringToolId = elem.Id.IntegerValue.ToString() + // }); + // } + // foreach (var elem in selectedElems) + // { + // v.Components.Add(new Component + // { + // OriginatingSystem = versionName, + // IfcGuid = IfcGuid.ToIfcGuid(ExportUtils.GetExportId(doc, elem)), + // Visible = true, + // Selected = true, + // AuthoringToolId = elem.IntegerValue.ToString() + // }); + // } + //} //include only visible elements //all the others are hidden - else - { - foreach (var elem in visibleElems) - { - v.Components.Add(new Component - { - OriginatingSystem = versionName, - IfcGuid = IfcGuid.ToIfcGuid(ExportUtils.GetExportId(doc, elem)), - Visible = true, - Selected = selectedElems.Contains(elem), - AuthoringToolId = elem.IntegerValue.ToString() - }); - } - } + //else + //{ + // foreach (var elem in visibleElems) + // { + // v.Components.Add(new Component + // { + // OriginatingSystem = versionName, + // IfcGuid = IfcGuid.ToIfcGuid(ExportUtils.GetExportId(doc, elem)), + // Visible = true, + // Selected = selectedElems.Contains(elem), + // AuthoringToolId = elem.IntegerValue.ToString() + // }); + // } + //} return v; } diff --git a/Bcfier.Revit/Entry/ExtEvntOpenView.cs b/Bcfier.Revit/Entry/ExtEvntOpenView.cs index 0bf45176..faf673a3 100644 --- a/Bcfier.Revit/Entry/ExtEvntOpenView.cs +++ b/Bcfier.Revit/Entry/ExtEvntOpenView.cs @@ -43,7 +43,6 @@ public void Execute(UIApplication app) var cameraViewPoint = RevitUtils.GetRevitXYZ(v.OrthogonalCamera.CameraViewPoint); var orient3D = RevitUtils.ConvertBasePoint(doc, cameraViewPoint, cameraDirection, cameraUpVector, true); - View3D orthoView = null; //if active view is 3d ortho use it if (doc.ActiveView.ViewType == ViewType.ThreeD) @@ -175,52 +174,53 @@ public void Execute(UIApplication app) else return; + //TODO: FIX visibility/selection opening a view //select/hide elements - if (v.Components != null && v.Components.Any()) - { - var elementsToSelect = new List(); - var elementsToHide = new List(); - var elementsToShow = new List(); - - //Assuming that - var visibleElems = new FilteredElementCollector(doc, doc.ActiveView.Id) - .WhereElementIsNotElementType() - .WhereElementIsViewIndependent() - .ToElementIds() - .Where(e => doc.GetElement(e).CanBeHidden(doc.ActiveView)); //might affect performance, but it's necessary - - foreach (var e in visibleElems) - { - //elements to select - var guid = IfcGuid.ToIfcGuid(ExportUtils.GetExportId(doc, e)); - if (v.Components.Any(x => x.IfcGuid == guid && x.Selected)) - elementsToSelect.Add(e); - - //elements to hide - if (v.Components.Any(x => x.IfcGuid == guid && !x.Visible)) - elementsToHide.Add(e); - - //elements to show //could be optional - if (v.Components.Any(x => x.IfcGuid == guid && x.Visible)) - elementsToShow.Add(e); - } - - using (var trans = new Transaction(uidoc.Document)) - { - if (trans.Start("Show/Hide and select elements") == TransactionStatus.Started) - { - if (elementsToHide.Any()) - doc.ActiveView.HideElementsTemporary(elementsToHide); - //there are no items to hide, therefore hide everything and just show the visible ones - else if (elementsToShow.Any()) - doc.ActiveView.IsolateElementsTemporary(elementsToShow); - - if (elementsToSelect.Any()) - uidoc.Selection.SetElementIds(elementsToSelect); - } - trans.Commit(); - } - } + //if (v.Components != null && v.Components.Any()) + //{ + // var elementsToSelect = new List(); + // var elementsToHide = new List(); + // var elementsToShow = new List(); + + // //Assuming that + // var visibleElems = new FilteredElementCollector(doc, doc.ActiveView.Id) + // .WhereElementIsNotElementType() + // .WhereElementIsViewIndependent() + // .ToElementIds() + // .Where(e => doc.GetElement(e).CanBeHidden(doc.ActiveView)); //might affect performance, but it's necessary + + // foreach (var e in visibleElems) + // { + // //elements to select + // var guid = IfcGuid.ToIfcGuid(ExportUtils.GetExportId(doc, e)); + // if (v.Components.Any(x => x.IfcGuid == guid && x.Selected)) + // elementsToSelect.Add(e); + + // //elements to hide + // if (v.Components.Any(x => x.IfcGuid == guid && !x.Visible)) + // elementsToHide.Add(e); + + // //elements to show //could be optional + // if (v.Components.Any(x => x.IfcGuid == guid && x.Visible)) + // elementsToShow.Add(e); + // } + + // using (var trans = new Transaction(uidoc.Document)) + // { + // if (trans.Start("Show/Hide and select elements") == TransactionStatus.Started) + // { + // if (elementsToHide.Any()) + // doc.ActiveView.HideElementsTemporary(elementsToHide); + // //there are no items to hide, therefore hide everything and just show the visible ones + // else if (elementsToShow.Any()) + // doc.ActiveView.IsolateElementsTemporary(elementsToShow); + + // if (elementsToSelect.Any()) + // uidoc.Selection.SetElementIds(elementsToSelect); + // } + // trans.Commit(); + // } + //} uidoc.RefreshActiveView(); diff --git a/Bcfier.Revit/RevitWindow.xaml.cs b/Bcfier.Revit/RevitWindow.xaml.cs index 824c9726..33a240d0 100755 --- a/Bcfier.Revit/RevitWindow.xaml.cs +++ b/Bcfier.Revit/RevitWindow.xaml.cs @@ -67,6 +67,13 @@ private void OnOpenView(object sender, ExecutedRoutedEventArgs e) return; UIDocument uidoc = uiapp.ActiveUIDocument; + if (uidoc.ActiveView.ViewType == ViewType.Schedule) + { + MessageBox.Show("BCFier can't take snapshots of schedules.", + "Warning!", MessageBoxButton.OK, MessageBoxImage.Warning); + return; + } + if (uidoc.ActiveView.ViewType == ViewType.ThreeD) { var view3D = (View3D)uidoc.ActiveView; @@ -116,11 +123,11 @@ private void OnAddView(object sender, ExecutedRoutedEventArgs e) //get filename UIDocument uidoc = uiapp.ActiveUIDocument; - if(uidoc.Document.Title!=null) + if (uidoc.Document.Title != null) issue.Header[0].Filename = uidoc.Document.Title; else issue.Header[0].Filename = "Unknown"; - + Bcfier.SelectedBcf().HasBeenSaved = false; } @@ -133,7 +140,7 @@ private void OnAddView(object sender, ExecutedRoutedEventArgs e) #endregion #region private methods - + /// /// passing event to the user control /// @@ -153,6 +160,6 @@ private void RevitWindow_OnLoaded(object sender, RoutedEventArgs e) StatHat.Post.EzCounter(@"hello@teocomi.com", "BCFierRevitStart", 1); }); } - + } } \ No newline at end of file diff --git a/Bcfier/Bcf/Bcf2/Markup.cs b/Bcfier/Bcf/Bcf2/Markup.cs index 2b65822f..907ae844 100644 --- a/Bcfier/Bcf/Bcf2/Markup.cs +++ b/Bcfier/Bcf/Bcf2/Markup.cs @@ -1,29 +1,16 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.5485 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; using System.ComponentModel; using System.Linq; +using Bcfier.Data; using System.Xml.Serialization; -// -// This source code was auto-generated by xsd, Version=2.0.50727.3038. -// - namespace Bcfier.Bcf.Bcf2 { /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -114,29 +101,30 @@ public ObservableCollection ViewComments } } - [System.Xml.Serialization.XmlIgnoreAttribute()] - public string LastCommentStatus - { - get - { - if (Comment == null || !Comment.Any()) - return ""; - - return Comment.LastOrDefault().Status; - } - } - - [System.Xml.Serialization.XmlIgnoreAttribute()] - public string LastCommentVerbalStatus - { - get - { - if (Comment == null || !Comment.Any()) - return ""; - - return Comment.LastOrDefault().VerbalStatus; - } - } + ////this might need to change + //[System.Xml.Serialization.XmlIgnoreAttribute()] + //public string LastCommentStatus + //{ + // get + // { + // if (Comment == null || !Comment.Any()) + // return ""; + + // return Comment.LastOrDefault().Status; + // } + //} + ////this might need to change + //[System.Xml.Serialization.XmlIgnoreAttribute()] + //public string LastCommentVerbalStatus + //{ + // get + // { + // if (Comment == null || !Comment.Any()) + // return ""; + + // return Comment.LastOrDefault().VerbalStatus; + // } + //} //parameterless constructor needed public Markup() @@ -155,7 +143,7 @@ public Markup(DateTime created) public void RegisterEvents() { if (Viewpoints != null) - Viewpoints.CollectionChanged += delegate(object sender, NotifyCollectionChangedEventArgs args) { NotifyPropertyChanged("ViewComments"); }; + Viewpoints.CollectionChanged += delegate (object sender, NotifyCollectionChangedEventArgs args) { NotifyPropertyChanged("ViewComments"); }; if (Comment != null) Comment.CollectionChanged += CommentOnCollectionChanged; } @@ -163,12 +151,9 @@ public void RegisterEvents() private void CommentOnCollectionChanged(object sender, NotifyCollectionChangedEventArgs notifyCollectionChangedEventArgs) { NotifyPropertyChanged("ViewComments"); - NotifyPropertyChanged("LastCommentStatus"); - NotifyPropertyChanged("LastCommentVerbalStatus"); + //NotifyPropertyChanged("LastCommentStatus"); + //NotifyPropertyChanged("LastCommentVerbalStatus"); } - - - [field: NonSerialized] public event PropertyChangedEventHandler PropertyChanged; private void NotifyPropertyChanged(String info) @@ -181,7 +166,7 @@ private void NotifyPropertyChanged(String info) } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -267,7 +252,7 @@ public bool isExternal } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -278,6 +263,10 @@ public partial class ViewPoint : INotifyPropertyChanged private string snapshotField; + private int indexField; + + private bool indexFieldSpecified; + private string guidField; /// @@ -296,6 +285,22 @@ public string Snapshot set { this.snapshotField = value; } } + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public int Index + { + get { return this.indexField; } + set { this.indexField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IndexSpecified + { + get { return this.indexFieldSpecified; } + set { this.indexFieldSpecified = value; } + } + /// [System.Xml.Serialization.XmlAttributeAttribute()] public string Guid @@ -334,16 +339,16 @@ private void NotifyPropertyChanged(String info) } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class Comment { - private string verbalStatusField; + //private string verbalStatusField; - private string statusField; + //private string statusField; private System.DateTime dateField; @@ -351,11 +356,11 @@ public partial class Comment private string comment1Field; - private CommentTopic topicField; + //private CommentTopic topicField; private CommentViewpoint viewpointField; - private CommentReplyToComment replyToCommentField; + //private CommentReplyToComment replyToCommentField; private System.DateTime modifiedDateField; @@ -367,24 +372,24 @@ public partial class Comment public Comment() { - this.statusField = "Unknown"; + //this.statusField = "Unknown"; } - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string VerbalStatus - { - get { return this.verbalStatusField; } - set { this.verbalStatusField = value; } - } + // /// + // [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + // public string VerbalStatus + // { + // get { return this.verbalStatusField; } + // set { this.verbalStatusField = value; } + // } - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string Status - { - get { return this.statusField; } - set { this.statusField = value; } - } + // /// + // [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + // public string Status + // { + // get { return this.statusField; } + // set { this.statusField = value; } + // } /// [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] @@ -410,13 +415,13 @@ public string Comment1 set { this.comment1Field = value; } } - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public CommentTopic Topic - { - get { return this.topicField; } - set { this.topicField = value; } - } + // /// + // [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + // public CommentTopic Topic + // { + // get { return this.topicField; } + // set { this.topicField = value; } + // } /// [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] @@ -426,13 +431,13 @@ public CommentViewpoint Viewpoint set { this.viewpointField = value; } } - /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public CommentReplyToComment ReplyToComment - { - get { return this.replyToCommentField; } - set { this.replyToCommentField = value; } - } + // /// + // [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + // public CommentReplyToComment ReplyToComment + // { + // get { return this.replyToCommentField; } + // set { this.replyToCommentField = value; } + // } /// [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] @@ -467,28 +472,28 @@ public string Guid } } - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)] - public partial class CommentTopic - { - - private string guidField; - - /// - [System.Xml.Serialization.XmlAttributeAttribute()] - public string Guid - { - get { return this.guidField; } - set { this.guidField = value; } - } - } + // /// + // [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] + // [System.SerializableAttribute()] + // [System.Diagnostics.DebuggerStepThroughAttribute()] + // [System.ComponentModel.DesignerCategoryAttribute("code")] + // [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)] + // public partial class CommentTopic + // { + + // private string guidField; + + // /// + // [System.Xml.Serialization.XmlAttributeAttribute()] + // public string Guid + // { + // get { return this.guidField; } + // set { this.guidField = value; } + // } + // } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -507,28 +512,28 @@ public string Guid } } - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)] - public partial class CommentReplyToComment - { - - private string guidField; - - /// - [System.Xml.Serialization.XmlAttributeAttribute()] - public string Guid - { - get { return this.guidField; } - set { this.guidField = value; } - } - } + // /// + // [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] + // [System.SerializableAttribute()] + // [System.Diagnostics.DebuggerStepThroughAttribute()] + // [System.ComponentModel.DesignerCategoryAttribute("code")] + // [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)] + // public partial class CommentReplyToComment + // { + + // private string guidField; + + // /// + // [System.Xml.Serialization.XmlAttributeAttribute()] + // public string Guid + // { + // get { return this.guidField; } + // set { this.guidField = value; } + // } + // } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -583,26 +588,28 @@ public bool isExternal } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class Topic { - private string referenceLinkField; + private string[] referenceLinkField; private string titleField; private string priorityField; - private string indexField; + private int indexField; + + private bool indexFieldSpecified; private string[] labelsField; private System.DateTime creationDateField; - private bool creationDateFieldSpecified; + //private bool creationDateFieldSpecified; private string creationAuthorField; @@ -612,8 +619,14 @@ public partial class Topic private string modifiedAuthorField; + private System.DateTime dueDateField; + + private bool dueDateFieldSpecified; + private string assignedToField; + private string stageField; + private string descriptionField; private BimSnippet bimSnippetField; @@ -626,11 +639,15 @@ public partial class Topic private string topicTypeField; + private ObservableCollection topicTypesCollection; + private string topicStatusField; + private ObservableCollection topicStatusesCollection; + /// [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] - public string ReferenceLink + public string[] ReferenceLink { get { return this.referenceLinkField; } set { this.referenceLinkField = value; } @@ -653,12 +670,31 @@ public string Priority } /// - [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified, - DataType = "integer")] - public string Index + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public int Index { - get { return this.indexField; } - set { this.indexField = value; } + get + { + return this.indexField; + } + set + { + this.indexField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool IndexSpecified + { + get + { + return this.indexFieldSpecified; + } + set + { + this.indexFieldSpecified = value; + } } /// @@ -677,13 +713,13 @@ public System.DateTime CreationDate set { this.creationDateField = value; } } - /// - [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool CreationDateSpecified - { - get { return this.creationDateFieldSpecified; } - set { this.creationDateFieldSpecified = value; } - } + // /// + // [System.Xml.Serialization.XmlIgnoreAttribute()] + // public bool CreationDateSpecified + // { + // get { return this.creationDateFieldSpecified; } + // set { this.creationDateFieldSpecified = value; } + // } /// [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] @@ -717,6 +753,34 @@ public string ModifiedAuthor set { this.modifiedAuthorField = value; } } + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public System.DateTime DueDate + { + get + { + return this.dueDateField; + } + set + { + this.dueDateField = value; + } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DueDateSpecified + { + get + { + return this.dueDateFieldSpecified; + } + set + { + this.dueDateFieldSpecified = value; + } + } + /// [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] public string AssignedTo @@ -725,6 +789,20 @@ public string AssignedTo set { this.assignedToField = value; } } + /// + [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] + public string Stage + { + get + { + return this.stageField; + } + set + { + this.stageField = value; + } + } + /// [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] public string Description @@ -782,16 +860,44 @@ public string TopicStatus set { this.topicStatusField = value; } } + [System.Xml.Serialization.XmlIgnoreAttribute()] + public ObservableCollection TopicTypesCollection + { + get { return topicTypesCollection; } + set { this.topicTypesCollection = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public ObservableCollection TopicStatusesCollection + { + get { return topicStatusesCollection; } + set { this.topicStatusesCollection = value; } + } + public Topic() { Guid = System.Guid.NewGuid().ToString(); CreationDate = DateTime.Now; ModifiedDate = CreationDate; + + TopicStatusesCollection = new ObservableCollection(); + TopicTypesCollection = new ObservableCollection(); + foreach (var status in Globals.AvailStatuses) + { + TopicStatusesCollection.Add(status); + } + foreach (var type in Globals.AvailTypes) + { + TopicTypesCollection.Add(type); + } + + } } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -847,7 +953,7 @@ public bool isExternal } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] diff --git a/Bcfier/Bcf/Bcf2/Project.cs b/Bcfier/Bcf/Bcf2/Project.cs index 413b234f..09c2ab3d 100755 --- a/Bcfier/Bcf/Bcf2/Project.cs +++ b/Bcfier/Bcf/Bcf2/Project.cs @@ -1,24 +1,10 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.5485 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -using System.Xml.Serialization; - -// -// This source code was auto-generated by xsd, Version=2.0.50727.3038. -// +using System.Xml.Serialization; namespace Bcfier.Bcf.Bcf2 { /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -50,7 +36,7 @@ public string ExtensionSchema } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] diff --git a/Bcfier/Bcf/Bcf2/Version.cs b/Bcfier/Bcf/Bcf2/Version.cs index a42059c4..d5b4d0ee 100644 --- a/Bcfier/Bcf/Bcf2/Version.cs +++ b/Bcfier/Bcf/Bcf2/Version.cs @@ -1,24 +1,10 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.5485 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -using System.Xml.Serialization; - -// -// This source code was auto-generated by xsd, Version=2.0.50727.3038. -// +using System.Xml.Serialization; namespace Bcfier.Bcf.Bcf2 { /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] diff --git a/Bcfier/Bcf/Bcf2/Visinfo.cs b/Bcfier/Bcf/Bcf2/Visinfo.cs index e570ca11..8c4d1a62 100644 --- a/Bcfier/Bcf/Bcf2/Visinfo.cs +++ b/Bcfier/Bcf/Bcf2/Visinfo.cs @@ -1,25 +1,11 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.5485 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -using System.Collections.Generic; +using System.Collections.Generic; using System.Xml.Serialization; -// -// This source code was auto-generated by xsd, Version=2.0.50727.3038. -// - namespace Bcfier.Bcf.Bcf2 { /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -28,23 +14,25 @@ namespace Bcfier.Bcf.Bcf2 public partial class VisualizationInfo { - private List componentsField; + private Components componentsField; private OrthogonalCamera orthogonalCameraField; private PerspectiveCamera perspectiveCameraField; - private SheetCamera sheetCameraField; //custom BCFier field + //Not part of BCF schema, added to support 2D views + private SheetCamera sheetCameraField; private Line[] linesField; private ClippingPlane[] clippingPlanesField; - private VisualizationInfoBitmaps[] bitmapsField; + private VisualizationInfoBitmap[] bitmapField; + + private string guidField; /// - [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable = false)] - public List Components + public Components Components { get { return this.componentsField; } set { this.componentsField = value; } @@ -64,6 +52,7 @@ public PerspectiveCamera PerspectiveCamera set { this.perspectiveCameraField = value; } } + public SheetCamera SheetCamera { get { return this.sheetCameraField; } @@ -87,99 +76,146 @@ public ClippingPlane[] ClippingPlanes } /// - [System.Xml.Serialization.XmlElementAttribute("Bitmaps")] - public VisualizationInfoBitmaps[] Bitmaps + [System.Xml.Serialization.XmlElementAttribute("Bitmap")] + public VisualizationInfoBitmap[] Bitmap { - get { return this.bitmapsField; } - set { this.bitmapsField = value; } + get + { + return this.bitmapField; + } + set + { + this.bitmapField = value; + } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public string Guid + { + get { return this.guidField; } + set { this.guidField = value; } } } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class Component + public partial class Components { - private string originatingSystemField; - - private string authoringToolIdField; + private ViewSetupHints viewSetupHintsField; - private string ifcGuidField; + private Component[] selectionField; - private bool selectedField; + private ComponentVisibility visibilityField; - private bool selectedFieldSpecified; + private ComponentColoringColor[] coloringField; - private bool visibleField; + /// + public ViewSetupHints ViewSetupHints + { + get { return this.viewSetupHintsField; } + set { this.viewSetupHintsField = value; } + } - private byte[] colorField; + /// + [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable = false)] + public Component[] Selection + { + get { return this.selectionField; } + set { this.selectionField = value; } + } - public Component() + /// + public ComponentVisibility Visibility { - this.visibleField = true; + get { return this.visibilityField; } + set { this.visibilityField = value; } } /// - public string OriginatingSystem + [System.Xml.Serialization.XmlArrayItemAttribute("Color", IsNullable = false)] + public ComponentColoringColor[] Coloring { - get { return this.originatingSystemField; } - set { this.originatingSystemField = value; } + get { return this.coloringField; } + set { this.coloringField = value; } } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ViewSetupHints + { + + private bool spacesVisibleField; + + private bool spacesVisibleFieldSpecified; + + private bool spaceBoundariesVisibleField; + + private bool spaceBoundariesVisibleFieldSpecified; + + private bool openingsVisibleField; + + private bool openingsVisibleFieldSpecified; /// - public string AuthoringToolId + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool SpacesVisible { - get { return this.authoringToolIdField; } - set { this.authoringToolIdField = value; } + get { return this.spacesVisibleField; } + set { this.spacesVisibleField = value; } } /// - [System.Xml.Serialization.XmlAttributeAttribute(DataType = "normalizedString")] - public string IfcGuid + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool SpacesVisibleSpecified { - get { return this.ifcGuidField; } - set { this.ifcGuidField = value; } + get { return this.spacesVisibleFieldSpecified; } + set { this.spacesVisibleFieldSpecified = value; } } /// [System.Xml.Serialization.XmlAttributeAttribute()] - public bool Selected + public bool SpaceBoundariesVisible { - get { return this.selectedField; } - set { this.selectedField = value; } + get { return this.spaceBoundariesVisibleField; } + set { this.spaceBoundariesVisibleField = value; } } /// [System.Xml.Serialization.XmlIgnoreAttribute()] - public bool SelectedSpecified + public bool SpaceBoundariesVisibleSpecified { - get { return this.selectedFieldSpecified; } - set { this.selectedFieldSpecified = value; } + get { return this.spaceBoundariesVisibleFieldSpecified; } + set { this.spaceBoundariesVisibleFieldSpecified = value; } } /// [System.Xml.Serialization.XmlAttributeAttribute()] - [System.ComponentModel.DefaultValueAttribute(true)] - public bool Visible + public bool OpeningsVisible { - get { return this.visibleField; } - set { this.visibleField = value; } + get { return this.openingsVisibleField; } + set { this.openingsVisibleField = value; } } /// - [System.Xml.Serialization.XmlAttributeAttribute(DataType = "hexBinary")] - public byte[] Color + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool OpeningsVisibleSpecified { - get { return this.colorField; } - set { this.colorField = value; } + get { return this.openingsVisibleFieldSpecified; } + set { this.openingsVisibleFieldSpecified = value; } } } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -206,7 +242,7 @@ public Direction Direction } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -242,7 +278,7 @@ public double Z } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -278,7 +314,7 @@ public double Z } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -305,7 +341,7 @@ public Point EndPoint } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -320,13 +356,6 @@ public partial class PerspectiveCamera private double fieldOfViewField; - public PerspectiveCamera() - { - CameraDirection = new Direction(); - CameraUpVector = new Direction(); - CameraViewPoint = new Point(); - } - /// public Point CameraViewPoint { @@ -357,7 +386,7 @@ public double FieldOfView } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] @@ -372,13 +401,6 @@ public partial class OrthogonalCamera private double viewToWorldScaleField; - public OrthogonalCamera() - { - CameraDirection = new Direction(); - CameraUpVector = new Direction(); - CameraViewPoint = new Point(); - } - /// public Point CameraViewPoint { @@ -407,94 +429,176 @@ public double ViewToWorldScale set { this.viewToWorldScaleField = value; } } } - - - - /// - /// Custom BCFier field to support 2D views in Revit - /// EXPERIMENTAL - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.33440")] - [System.SerializableAttribute()] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SheetCamera - { - - private Point topLeft; - - private Point bottomRight; - - private int sheetID; - - private string sheetName; - - public SheetCamera() - { - TopLeft = new Point(); - BottomRight = new Point(); - } - - /// - public Point TopLeft - { - get - { - return this.topLeft; - } - set - { - this.topLeft = value; - } - } - - /// - public Point BottomRight - { - get - { - return this.bottomRight; - } - set - { - this.bottomRight = value; - } - } - - /// - public int SheetID - { - get - { - return this.sheetID; - } - set - { - this.sheetID = value; - } - } - - /// - public string SheetName - { - get - { - return this.sheetName; - } - set - { - this.sheetName = value; - } - } + + + + /// + /// Custom BCFier field to support 2D views in Revit + /// EXPERIMENTAL + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.0.30319.33440")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SheetCamera + { + + private Point topLeft; + + private Point bottomRight; + + private int sheetID; + + private string sheetName; + + public SheetCamera() + { + TopLeft = new Point(); + BottomRight = new Point(); } + /// + public Point TopLeft + { + get { return this.topLeft; } + set { this.topLeft = value; } + } + + /// + public Point BottomRight + { + get { return this.bottomRight; } + set { this.bottomRight = value; } + } + + /// + public int SheetID + { + get { return this.sheetID; } + set { this.sheetID = value; } + } + + /// + public string SheetName + { + get { return this.sheetName; } + set { this.sheetName = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ComponentVisibility + { + + private Component[] exceptionsField; + + private bool defaultVisibilityField; + + private bool defaultVisibilityFieldSpecified; + + /// + [System.Xml.Serialization.XmlArrayItemAttribute(IsNullable = false)] + public Component[] Exceptions + { + get { return this.exceptionsField; } + set { this.exceptionsField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute()] + public bool DefaultVisibility + { + get { return this.defaultVisibilityField; } + set { this.defaultVisibilityField = value; } + } + + /// + [System.Xml.Serialization.XmlIgnoreAttribute()] + public bool DefaultVisibilitySpecified + { + get { return this.defaultVisibilityFieldSpecified; } + set { this.defaultVisibilityFieldSpecified = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Component + { + + private string originatingSystemField; + + private string authoringToolIdField; + + private string ifcGuidField; + + /// + public string OriginatingSystem + { + get { return this.originatingSystemField; } + set { this.originatingSystemField = value; } + } + + /// + public string AuthoringToolId + { + get { return this.authoringToolIdField; } + set { this.authoringToolIdField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute(DataType = "normalizedString")] + public string IfcGuid + { + get { return this.ifcGuidField; } + set { this.ifcGuidField = value; } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] + [System.SerializableAttribute()] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)] + public partial class ComponentColoringColor + { + + private Component[] componentField; + + private string colorField; + + /// + [System.Xml.Serialization.XmlElementAttribute("Component")] + public Component[] Component + { + get { return this.componentField; } + set { this.componentField = value; } + } + + /// + [System.Xml.Serialization.XmlAttributeAttribute(DataType = "normalizedString")] + public string Color + { + get { return this.colorField; } + set { this.colorField = value; } + } + } + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true)] - public partial class VisualizationInfoBitmaps + public partial class VisualizationInfoBitmap { private BitmapFormat bitmapField; @@ -553,7 +657,7 @@ public double Height } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "4.6.1586.0")] [System.SerializableAttribute()] public enum BitmapFormat { @@ -564,4 +668,5 @@ public enum BitmapFormat /// JPG, } + } diff --git a/Bcfier/Bcf/BcfContainer.cs b/Bcfier/Bcf/BcfContainer.cs index ecef861d..ce211a49 100755 --- a/Bcfier/Bcf/BcfContainer.cs +++ b/Bcfier/Bcf/BcfContainer.cs @@ -10,6 +10,7 @@ using System.Xml.Serialization; using Bcfier.Bcf.Bcf2; using Bcfier.Data.Utils; +using Bcfier.Data; namespace Bcfier.Bcf { @@ -100,6 +101,15 @@ private void BcfOpened(BcfFile newbcf) SelectedReportIndex = BcfFiles.Count - 1; if (newbcf.Issues.Any()) newbcf.SelectedIssue = newbcf.Issues.First(); + + foreach (var issue in newbcf.Issues) + { + if (!Globals.OpenStatuses.Contains(issue.Topic.TopicStatus)) + Globals.OpenStatuses.Add(issue.Topic.TopicStatus); + + if (!Globals.OpenTypes.Contains(issue.Topic.TopicType)) + Globals.OpenTypes.Add(issue.Topic.TopicType); + } } } @@ -117,6 +127,60 @@ public void CloseFile(BcfFile bcf) } + /// + /// Removes all old statuses and types from the collection and adds the new ones, except for the selected one + /// This avoids having blank fields in case an existing value is removed + /// could probably be optimized + /// + public void UpdateDropdowns() + { + try + { + Globals.SetStatuses(UserSettings.Get("Stauses")); + Globals.SetTypes(UserSettings.Get("Types")); + + foreach (var bcf in BcfFiles) + { + foreach (var issue in bcf.Issues) + { + var oldStatus = issue.Topic.TopicStatus; + var oldType = issue.Topic.TopicType; + + //status + for (int i = issue.Topic.TopicStatusesCollection.Count - 1; i >= 0; i--) + { + if(issue.Topic.TopicStatusesCollection [i]!= oldStatus) + issue.Topic.TopicStatusesCollection.RemoveAt(i); + } + foreach (var status in Globals.AvailStatuses) + { + if (status != oldStatus || !issue.Topic.TopicStatusesCollection.Contains(status)) + issue.Topic.TopicStatusesCollection.Add(status); + } + //type + for (int i = issue.Topic.TopicTypesCollection.Count - 1; i >= 0; i--) + { + if (issue.Topic.TopicTypesCollection[i] != oldType) + issue.Topic.TopicTypesCollection.RemoveAt(i); + } + foreach (var type in Globals.AvailTypes) + { + if (type != oldType || !issue.Topic.TopicTypesCollection.Contains(type)) + issue.Topic.TopicTypesCollection.Add(type); + } + } + } + + } + + catch { + //suppress error + }; + + } + + + #region private methods /// @@ -283,7 +347,7 @@ private static bool SaveBcfFile(BcfFile bcffile) ExtensionSchema = "" }; - var bcfVersion = new Bcf2.Version { VersionId = "2.0", DetailedVersion = "2.0" }; + var bcfVersion = new Bcf2.Version { VersionId = "2.1", DetailedVersion = "2.1" }; var serializerP = new XmlSerializer(typeof(ProjectExtension)); Stream writerP = new FileStream(Path.Combine(bcffile.TempPath, "project.bcfp"), FileMode.Create); @@ -297,19 +361,31 @@ private static bool SaveBcfFile(BcfFile bcffile) var serializerV = new XmlSerializer(typeof(VisualizationInfo)); var serializerM = new XmlSerializer(typeof(Markup)); - + + var i = 0; foreach (var issue in bcffile.Issues) { + //set topic index + issue.Topic.Index = i; + issue.Topic.IndexSpecified = true; + i++; - // Serialize the object, and close the TextWriter + // serialize the object, and close the TextWriter string issuePath = Path.Combine(bcffile.TempPath, issue.Topic.Guid); if (!Directory.Exists(issuePath)) Directory.CreateDirectory(issuePath); + //set viewpoint index + for (var l = 0; l < issue.Viewpoints.Count; l++) + { + issue.Viewpoints[l].Index = l; + issue.Viewpoints[l].IndexSpecified = true; + } + //BCF 1 compatibility - //there needs to be a view whose viewpoint and snapshot are named as follows and not with a guid - //uniqueness is still guarenteed by the guid field - if (issue.Viewpoints.Any() && (issue.Viewpoints.Count == 1 || issue.Viewpoints.All(o => o.Viewpoint != "viewpoint.bcfv"))) + //there needs to be a view whose viewpoint and snapshot are named as follows and not with a guid + //uniqueness is still guarenteed by the guid field + if (issue.Viewpoints.Any() && (issue.Viewpoints.Count == 1 || issue.Viewpoints.All(o => o.Viewpoint != "viewpoint.bcfv"))) { if (File.Exists(Path.Combine(issuePath, issue.Viewpoints[0].Viewpoint))) File.Delete(Path.Combine(issuePath, issue.Viewpoints[0].Viewpoint)); @@ -360,6 +436,7 @@ private static bool SaveBcfFile(BcfFile bcffile) } return true; } + /// /// Prompts a the user to select where to save the bcfzip /// diff --git a/Bcfier/Bcfier.csproj b/Bcfier/Bcfier.csproj index 4377e43d..c1bc1ff6 100644 --- a/Bcfier/Bcfier.csproj +++ b/Bcfier/Bcfier.csproj @@ -101,9 +101,14 @@ MinimumRecommendedRules.ruleset + + ..\packages\gong-wpf-dragdrop.1.1.0\lib\net45\GongSolutions.Wpf.DragDrop.dll + True + - - ..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll + + ..\packages\RestSharp.105.2.3\lib\net45\RestSharp.dll + True @@ -140,13 +145,13 @@ + - diff --git a/Bcfier/Data/Globals.cs b/Bcfier/Data/Globals.cs new file mode 100644 index 00000000..52e693ec --- /dev/null +++ b/Bcfier/Data/Globals.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Bcfier.Data +{ + public static class Globals + { + public static List OpenStatuses = new List(); + public static List OpenTypes = new List(); + + private static IEnumerable availStatuses = new List(); + private static IEnumerable availTypes = new List(); + + //join with the list of statuses from other open BCFs + public static IEnumerable AvailStatuses + { + get { return availStatuses.Union(OpenStatuses); } + } + + public static void SetStatuses(string statusString) + { + availStatuses = new List(statusString.Split(new char[] { ',' }).Select(o => o.Trim())); + } + + //join with the list of types from other open BCFs + public static IEnumerable AvailTypes + { + get { return availTypes.Union(OpenTypes); } + } + + public static void SetTypes(string statusTypes) + { + availTypes = new List(statusTypes.Split(new char[] { ',' }).Select(o => o.Trim())); + } + } +} diff --git a/Bcfier/Data/Utils/Globals.cs b/Bcfier/Data/Utils/Globals.cs deleted file mode 100644 index 086c2da5..00000000 --- a/Bcfier/Data/Utils/Globals.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Bcfier.Data.Utils -{ - public static class Globals - { - private static IEnumerable availStatuses = new List(); - //custom comment statuses, available from any part of the application - public static IEnumerable AvailStatuses - { - get { return availStatuses; } - } - - public static void SetStatuses(string statusString) - { - availStatuses = new List(statusString.Split(new char[] { ',' }).Select(o => o.Trim())); - } - - } -} diff --git a/Bcfier/SampleBcfFile.xaml b/Bcfier/SampleBcfFile.xaml index f8e12321..194cecf5 100644 --- a/Bcfier/SampleBcfFile.xaml +++ b/Bcfier/SampleBcfFile.xaml @@ -1,19 +1,28 @@  + xmlns:bcf2="clr-namespace:Bcfier.Bcf.Bcf2" + xmlns:system="clr-namespace:System;assembly=mscorlib"> - + + + Issue + Problem + Solution + + + Date="2015-01-13T12:08:26Z"> @@ -21,8 +30,7 @@ + Date="2015-01-13T12:08:26Z"> @@ -30,9 +38,7 @@ + Date="2015-02-13T12:08:26Z"/> - + + Date="2015-02-13T12:08:26Z"/> @@ -132,7 +130,7 @@ FontStyle="Italic" Content="{Binding Date, Converter={StaticResource DateConverter}, ConverterParameter='relative'}" ToolTip="{Binding Date, Converter={StaticResource DateConverter}}" /> - - public partial class ComponentsList : Window + /// + /// Interaction logic for Components.xaml + /// + public partial class ComponentsList : Window + { + public ComponentsList(Components components) { - public ComponentsList(IEnumerable components) - { - InitializeComponent(); + InitializeComponent(); + //TODO: properly display components info + componentsList.ItemsSource = components.Selection; - componentsList.ItemsSource = components; - - } } + } } diff --git a/Bcfier/Windows/Settings.xaml b/Bcfier/Windows/Settings.xaml index 3d61aef8..5c05e6aa 100644 --- a/Bcfier/Windows/Settings.xaml +++ b/Bcfier/Windows/Settings.xaml @@ -20,6 +20,7 @@ + @@ -27,6 +28,7 @@ + @@ -55,7 +57,7 @@ Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" - Content="Statuses:" /> + Content="Topic Statuses:" /> @@ -74,13 +76,36 @@ Height="50" Margin="5" Placeholder="Open, Closed, In Progress, Resolved" /> - + + + + Height="50" + Margin="5" + Placeholder="Architecture, Structure, Mechanical, Electrical" /> + + @@ -195,7 +229,7 @@