Added logic to remember the status of the TreeView

Added specific file location for ErrorLog
Added logic to refresh ContentParts when Items added or deleted (Error 68)
This commit is contained in:
Rich 2010-11-17 17:30:08 +00:00
parent 74082c3038
commit c5f5e692c8
5 changed files with 39 additions and 4 deletions

View File

@ -9,7 +9,8 @@
</configSections> </configSections>
<log4net> <log4net>
<appender name="LogFileAppender" type="log4net.Appender.FileAppender"> <appender name="LogFileAppender" type="log4net.Appender.FileAppender">
<param name="File" value="Proms2010ErrorLog.txt" /> <!--<param name="File" value="${USERPROFILE}/My Documents/Proms2010ErrorLog.txt" />-->
<param name="File" value="${APPDATA}/Volian/Proms2010/ErrorLog.txt" />
<param name="AppendToFile" value="true" /> <param name="AppendToFile" value="true" />
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
<!--<param name="Header" value="[Header]\r\n" />--> <!--<param name="Header" value="[Header]\r\n" />-->
@ -62,7 +63,7 @@
</logger> </logger>
</log4net> </log4net>
<appSettings> <appSettings>
<add key ="OperatingMode" value ="Debug"/> <add key="OperatingMode" value="Debug" />
<add key="CslaAuthentication" value="Windows" /> <add key="CslaAuthentication" value="Windows" />
<!-- <!--
<add key="CslaDataPortalProxy" <add key="CslaDataPortalProxy"
@ -114,6 +115,9 @@
<setting name="AutoPopUpAnnotations" serializeAs="String"> <setting name="AutoPopUpAnnotations" serializeAs="String">
<value>True</value> <value>True</value>
</setting> </setting>
<setting name="TreeviewExpanded" serializeAs="String">
<value>False</value>
</setting>
</VEPROMS.Properties.Settings> </VEPROMS.Properties.Settings>
<UISampleNetBar1.Properties.Settings> <UISampleNetBar1.Properties.Settings>
<setting name="ShowDefaultFolderProp" serializeAs="String"> <setting name="ShowDefaultFolderProp" serializeAs="String">

View File

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
// Runtime Version:2.0.50727.1433 // Runtime Version:2.0.50727.4206
// //
// Changes to this file may cause incorrect behavior and will be lost if // Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. // the code is regenerated.
@ -195,5 +195,17 @@ namespace VEPROMS.Properties {
this["AutoPopUpAnnotations"] = value; this["AutoPopUpAnnotations"] = value;
} }
} }
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool TreeviewExpanded {
get {
return ((bool)(this["TreeviewExpanded"]));
}
set {
this["TreeviewExpanded"] = value;
}
}
} }
} }

View File

@ -47,5 +47,8 @@
<Setting Name="AutoPopUpAnnotations" Type="System.Boolean" Scope="User"> <Setting Name="AutoPopUpAnnotations" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value> <Value Profile="(Default)">True</Value>
</Setting> </Setting>
<Setting Name="TreeviewExpanded" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@ -226,9 +226,15 @@ namespace VEPROMS
if (Settings.Default["Location"] != null) this.Location = Settings.Default.Location; if (Settings.Default["Location"] != null) this.Location = Settings.Default.Location;
if (Settings.Default["Size"] != null) this.Size = Settings.Default.Size; if (Settings.Default["Size"] != null) this.Size = Settings.Default.Size;
if (Settings.Default["WindowState"] != null) this.WindowState = Settings.Default.WindowState; if (Settings.Default["WindowState"] != null) this.WindowState = Settings.Default.WindowState;
epProcedures.Expanded = Settings.Default.TreeviewExpanded;
_MyMRIList = MostRecentItemList.GetMRILst((System.Collections.Specialized.StringCollection)(Properties.Settings.Default["MRIList"])); _MyMRIList = MostRecentItemList.GetMRILst((System.Collections.Specialized.StringCollection)(Properties.Settings.Default["MRIList"]));
_MyMRIList.AfterRemove += new ItemInfoEvent(_MyMRIList_AfterRemove); _MyMRIList.AfterRemove += new ItemInfoEvent(_MyMRIList_AfterRemove);
SetupMRU(); SetupMRU();
if (epProcedures.Expanded && _MyMRIList.Count > 0)
{
tv.AdjustTree(_MyMRIList[0].MyItemInfo.MyProcedure);
tv.SelectedNode.Expand();
}
displaySearch1.SetupAnnotationSearch(ctrlAnnotationDetails, tc); displaySearch1.SetupAnnotationSearch(ctrlAnnotationDetails, tc);
ctrlAnnotationDetails.SetupAnnotations(displaySearch1); ctrlAnnotationDetails.SetupAnnotations(displaySearch1);
SetupButtons(); SetupButtons();
@ -287,6 +293,7 @@ namespace VEPROMS
private void SaveMRU() private void SaveMRU()
{ {
Properties.Settings.Default.MRIList = _MyMRIList.ToSettings(); Properties.Settings.Default.MRIList = _MyMRIList.ToSettings();
Properties.Settings.Default.TreeviewExpanded = epProcedures.Expanded;
Properties.Settings.Default.Save(); Properties.Settings.Default.Save();
} }
#endregion #endregion

View File

@ -183,7 +183,11 @@ namespace VEPROMS.CSLA.Library
internal void OnDeleted(object sender) internal void OnDeleted(object sender)
{ {
if (Deleted != null) Deleted(sender); if (Deleted != null) Deleted(sender);
if (MyParent != null) MyParent.OnChildrenDeleted(sender); if (MyParent != null)
{
MyParent.OnChildrenDeleted(sender);
MyParent.MyContent.RefreshContentParts();
}
} }
public event ItemInfoEvent ChildrenDeleted; public event ItemInfoEvent ChildrenDeleted;
internal void OnChildrenDeleted(object sender) internal void OnChildrenDeleted(object sender)
@ -202,6 +206,8 @@ namespace VEPROMS.CSLA.Library
internal void OnNewSiblingAfter(object sender, ItemInfoInsertEventArgs args) internal void OnNewSiblingAfter(object sender, ItemInfoInsertEventArgs args)
{ {
if (NewSiblingAfter != null) NewSiblingAfter(sender,args); if (NewSiblingAfter != null) NewSiblingAfter(sender,args);
if (MyParent != null)
MyParent.MyContent.RefreshContentParts();
} }
internal void OnNewSiblingAfter(ItemInfoInsertEventArgs args) internal void OnNewSiblingAfter(ItemInfoInsertEventArgs args)
{ {
@ -219,6 +225,8 @@ namespace VEPROMS.CSLA.Library
internal void OnNewSiblingBefore(object sender, ItemInfoInsertEventArgs args) internal void OnNewSiblingBefore(object sender, ItemInfoInsertEventArgs args)
{ {
if (NewSiblingBefore != null) NewSiblingBefore(sender,args); if (NewSiblingBefore != null) NewSiblingBefore(sender,args);
if (MyParent != null)
MyParent.MyContent.RefreshContentParts();
} }
internal void OnNewSiblingBefore(ItemInfoInsertEventArgs args) internal void OnNewSiblingBefore(ItemInfoInsertEventArgs args)
{ {
@ -236,6 +244,7 @@ namespace VEPROMS.CSLA.Library
internal void OnNewChild(object sender, ItemInfoInsertEventArgs args) internal void OnNewChild(object sender, ItemInfoInsertEventArgs args)
{ {
if (NewChild != null) NewChild(sender, args); if (NewChild != null) NewChild(sender, args);
MyContent.RefreshContentParts();
} }
internal void OnNewChild(ItemInfoInsertEventArgs args) internal void OnNewChild(ItemInfoInsertEventArgs args)
{ {