mirror of
https://github.com/jeremytammik/RevitSdkSamples.git
synced 2026-08-06 05:01:35 +00:00
deleted 2024 directoriess removed in 2025
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -1,24 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
# SharpDevelop 4.2.0.8783
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GetTimeElapsed_CSharp", "GetTimeElapsed_CSharp\GetTimeElapsed_CSharp.csproj", "{998BE5CB-BDF4-479E-9893-CED9C3302444}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
RevitVSTA|Any CPU = RevitVSTA|Any CPU
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{998BE5CB-BDF4-479E-9893-CED9C3302444}.RevitVSTA|Any CPU.ActiveCfg = RevitVSTA|Any CPU
|
||||
{998BE5CB-BDF4-479E-9893-CED9C3302444}.RevitVSTA|Any CPU.Build.0 = RevitVSTA|Any CPU
|
||||
{998BE5CB-BDF4-479E-9893-CED9C3302444}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{998BE5CB-BDF4-479E-9893-CED9C3302444}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{998BE5CB-BDF4-479E-9893-CED9C3302444}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{998BE5CB-BDF4-479E-9893-CED9C3302444}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
-141
@@ -1,141 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PropertyGroup>
|
||||
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
None
|
||||
</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
</PropertyGroup>
|
||||
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!-- This section defines project-level properties.
|
||||
|
||||
Project Type Guids - Must include {A860303F-1F3F-4691-B57E-529FC101A107};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} for a C# VSTA project.
|
||||
Configuration - Specifies whether the default configuration is Release or Debug.
|
||||
Platform - Specifies what CPU the output of this project can run on.
|
||||
ProductVersion - The version of Visual Studio.
|
||||
SchemaVersion - The project file schema version.
|
||||
OutputType - Must be "Library" for VSTA.
|
||||
AppDesignerFolder - The folder for application properties.
|
||||
RootNamespace - In C#, this specifies the namespace given to new files.
|
||||
In Visual Basic, all objects are wrapped in this namespace at runtime.
|
||||
AssemblyName - Name of the output assembly.
|
||||
TargetFrameworkVersion - The version of the .NET Framework this project targets.
|
||||
-->
|
||||
<PropertyGroup>
|
||||
<ProjectTypeGuids>{A860303F-1F3F-4691-B57E-529FC101A107};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">RevitVSTA</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>GetTimeElapsed_CSharp</RootNamespace>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<ProjectGuid>{998BE5CB-BDF4-479E-9893-CED9C3302444}</ProjectGuid>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
</PropertyGroup>
|
||||
<!-- This section defines properties that are set when the "RevitVSTA" configuration is
|
||||
selected.
|
||||
|
||||
DebugType - If full enables a debugger to be attached to a running program.
|
||||
If pdbonly allows source code debugging when the program is started in the debugger but will only
|
||||
display assembler when the running program is attached to the debugger.
|
||||
If none debugging is disabled.
|
||||
DebugSymbols - If true, create symbols (.pdb). If false, do not create symbols.
|
||||
Optimize - If true, optimize the build output. If false, do not optimize.
|
||||
OutputPath - Output path of the project relative to the project file.
|
||||
EnableUnmanagedDebugging - If true, starting the debugger will attach both managed and unmanaged debuggers.
|
||||
DefineConstants - Constants defined for the preprocessor.
|
||||
Warning Level - Warning level for the compiler.
|
||||
-->
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'RevitVSTA|AnyCPU' ">
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
|
||||
<Optimize>True</Optimize>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<DebugType>None</DebugType>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<OutputPath>..\..\Addin\</OutputPath>
|
||||
<AssemblyName>GetTimeElapsed_CSharp</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<!-- This sections specifies references for the project. -->
|
||||
<ItemGroup>
|
||||
<Reference Include="RevitAPIUI, Version=2011.0.0.0, Culture=neutral, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\RevitAPIUI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.AddIn">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="RevitAPI">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\RevitAPI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<!-- This section defines the user source files that are part of the
|
||||
project.
|
||||
|
||||
Compile - Specifies a source file to compile.
|
||||
EmbeddedResource - Specifies a .resx file for embedded resources.
|
||||
None - Specifies a file that is not to be passed to the compiler (for instance,
|
||||
a text file or XML file).
|
||||
-->
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="ThisApplication.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ThisApplication.designer.cs">
|
||||
<DependentUpon>ThisApplication.cs</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<!-- Include the build rules for a C# project.-->
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<!-- This section defines VSTA properties that describe the host-changable project properties. -->
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{A860303F-1F3F-4691-B57E-529FC101A107}">
|
||||
<ProjectProperties HostName="VSTAHostName" HostPackage="{C1B21C64-9E6F-4923-A89D-9F958503C1CE}" ApplicationType="usd" Language="cs" TemplatesPath="" />
|
||||
<Host Name="Architecture2010" GeneratedCodeNamespace="GetTimeElapsed_CSharp">
|
||||
<HostItem Name="ThisApplication" Code="ThisApplication.cs" CanonicalName="ThisApplication" DisplayName="ThisApplication" Blueprint="ThisApplication.Designer.xml" GeneratedCode="ThisApplication.designer.cs" />
|
||||
</Host>
|
||||
<ProjectClient>
|
||||
<HostIdentifier>MEP2011</HostIdentifier>
|
||||
<InProcHost>{f2d1070d-feff-4610-9403-9476ff28253d}</InProcHost>
|
||||
</ProjectClient>
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
//
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
//
|
||||
[assembly: AssemblyTitle("GetTimeElapsed_CSharp")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Autodesk, Inc.")]
|
||||
[assembly: AssemblyProduct("GetTimeElapsed_CSharp")]
|
||||
[assembly: AssemblyCopyright("Copyright @ Autodesk, Inc. 2008")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
//
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
-75
@@ -1,75 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
[assembly: global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "GetTimeElapsed_CSharp.Properties.Resources.get_ResourceManager():System.Resources.Resou" +
|
||||
"rceManager")]
|
||||
[assembly: global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "GetTimeElapsed_CSharp.Properties.Resources.get_Culture():System.Globalization.CultureIn" +
|
||||
"fo")]
|
||||
[assembly: global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "GetTimeElapsed_CSharp.Properties.Resources.set_Culture(System.Globalization.CultureInfo" +
|
||||
"):Void")]
|
||||
|
||||
namespace GetTimeElapsed_CSharp.Properties
|
||||
{
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GetTimeElapsed_CSharp.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-120
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
SDK/Macro Samples/GetTimeElapsed_CSharp/Source/GetTimeElapsed_CSharp/Properties/Settings.Designer.cs
Generated
-31
@@ -1,31 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
[assembly: global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Scope = "member", Target = "GetTimeElapsed_CSharp.Properties.Settings.get_Default():GetTimeElapsed_CSharp.Properties.Sett" +
|
||||
"ings")]
|
||||
|
||||
namespace GetTimeElapsed_CSharp.Properties
|
||||
{
|
||||
|
||||
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
private static Settings defaultInstance = new Settings();
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
-142
@@ -1,142 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Autodesk;
|
||||
using Autodesk.Revit;
|
||||
using Autodesk.Revit.DB;
|
||||
using Autodesk.Revit.DB.Events;
|
||||
using Autodesk.Revit.UI;
|
||||
using Autodesk.Revit.UI.Events;
|
||||
|
||||
namespace GetTimeElapsed_CSharp
|
||||
{
|
||||
[Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)]
|
||||
[Autodesk.Revit.DB.Macros.AddInId("B8A5B512-EBA0-4A38-8F6C-E2254840C978")]
|
||||
public partial class ThisApplication
|
||||
{
|
||||
Dictionary<Document, DateTime> m_dicLastSaved = new Dictionary<Document, DateTime>();
|
||||
|
||||
private void Module_Startup(object sender, EventArgs e)
|
||||
{
|
||||
InitializeDicLastSaved();
|
||||
this.Application.DocumentSaved += new EventHandler<DocumentSavedEventArgs>(ThisApplication_DocumentSaved);
|
||||
this.Application.DocumentOpened += new EventHandler<DocumentOpenedEventArgs>(ThisApplication_DocumentOpened);
|
||||
this.Application.DocumentCreated += new EventHandler<DocumentCreatedEventArgs>(ThisApplication_DocumentCreated);
|
||||
this.Application.DocumentClosing += new EventHandler<DocumentClosingEventArgs>(ThisApplication_DocumentClosing);
|
||||
}
|
||||
|
||||
private void Module_Shutdown(object sender, EventArgs e)
|
||||
{
|
||||
this.Application.DocumentSaved -= new EventHandler<DocumentSavedEventArgs>(ThisApplication_DocumentSaved);
|
||||
this.Application.DocumentOpened -= new EventHandler<DocumentOpenedEventArgs>(ThisApplication_DocumentOpened);
|
||||
this.Application.DocumentCreated -= new EventHandler<DocumentCreatedEventArgs>(ThisApplication_DocumentCreated);
|
||||
this.Application.DocumentClosing -= new EventHandler<DocumentClosingEventArgs>(ThisApplication_DocumentClosing);
|
||||
}
|
||||
|
||||
#region Revit Macros generated code
|
||||
private void InternalStartup()
|
||||
{
|
||||
this.Startup += new System.EventHandler(Module_Startup);
|
||||
this.Shutdown += new System.EventHandler(Module_Shutdown);
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Initialize
|
||||
/// </summary>
|
||||
private void InitializeDicLastSaved()
|
||||
{
|
||||
foreach (Document document in this.Application.Documents)
|
||||
{
|
||||
m_dicLastSaved.Add(document, DateTime.MaxValue);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DocumentCreated event, add the created document into m_dicLastSaved
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="args">DocumentCreatedEventArgs</param>
|
||||
void ThisApplication_DocumentCreated(object sender, DocumentCreatedEventArgs args)
|
||||
{
|
||||
m_dicLastSaved.Add(args.Document, DateTime.MaxValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DocumentClosing event, remove the closing document from m_dicLastSaved
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="args">DocumentClosingEventArgs</param>
|
||||
void ThisApplication_DocumentClosing(object sender, DocumentClosingEventArgs args)
|
||||
{
|
||||
m_dicLastSaved.Remove(args.Document);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DocumentOpened event, add the opened document into m_dicLastSaved
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="args">DocumentOpenedEventArgs</param>
|
||||
void ThisApplication_DocumentOpened(object sender, DocumentOpenedEventArgs args)
|
||||
{
|
||||
m_dicLastSaved.Add(args.Document, DateTime.MaxValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DocumentSaved event, record the current DataTime for the saved document
|
||||
/// </summary>
|
||||
/// <param name="sender">sender</param>
|
||||
/// <param name="args">DocumentSavedEventArgs</param>
|
||||
void ThisApplication_DocumentSaved(object sender , DocumentSavedEventArgs args)
|
||||
{
|
||||
this.m_dicLastSaved[args.Document] = DateTime.Now;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// FormatTimeSpan
|
||||
/// </summary>
|
||||
/// <param name="elapse">TimeSpan</param>
|
||||
/// <returns>the string of TimeSpan</returns>
|
||||
private String FormatTimeSpan(TimeSpan elapse)
|
||||
{
|
||||
String elapseStr = elapse.ToString();
|
||||
int lastIndexOfDot = elapseStr.LastIndexOf('.');
|
||||
return elapseStr.Substring(0, lastIndexOfDot);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// GetTimeElapsedSinceLastSave
|
||||
/// </summary>
|
||||
public void GetTimeElapsedSinceLastSave()
|
||||
{
|
||||
String text = String.Format("{0,-30}{1,-30}",
|
||||
"Document Full Name",
|
||||
"Elapse Time Since Last Save(day.hh:mm:ss)")
|
||||
+ "\n";
|
||||
foreach (KeyValuePair<Document, DateTime> pair in m_dicLastSaved)
|
||||
{
|
||||
String strElapsed = String.Empty;
|
||||
if (pair.Value == DateTime.MaxValue)
|
||||
{
|
||||
strElapsed = "Never";
|
||||
}
|
||||
else
|
||||
{
|
||||
strElapsed = FormatTimeSpan(DateTime.Now - pair.Value);
|
||||
}
|
||||
|
||||
String fileName = System.IO.Path.GetFileName(pair.Key.PathName);
|
||||
if (String.IsNullOrEmpty(fileName))
|
||||
{
|
||||
fileName = "*New*";
|
||||
}
|
||||
|
||||
text += String.Format("{0,-30}{1,-30}", fileName, strElapsed) + "\n";
|
||||
}
|
||||
|
||||
System.Windows.Forms.MessageBox.Show(text, "Macro GetTimeElapsedSinceLastSave");
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
-79
@@ -1,79 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:2.0.50727.3603
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace GetTimeElapsed_CSharp {
|
||||
|
||||
|
||||
///
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Applications.ProgrammingModel.dll", "9.0.0.0")]
|
||||
public sealed partial class ThisApplication : Autodesk.Revit.UI.Macros.ApplicationEntryPoint {
|
||||
|
||||
public event System.EventHandler Startup;
|
||||
|
||||
public event System.EventHandler Shutdown;
|
||||
|
||||
///
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
|
||||
private void OnStartup() {
|
||||
Globals.ThisApplication = this;
|
||||
}
|
||||
|
||||
///
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
|
||||
protected override void FinishInitialization() {
|
||||
base.FinishInitialization();
|
||||
this.OnStartup();
|
||||
this.InternalStartup();
|
||||
if ((this.Startup != null)) {
|
||||
this.Startup(this, System.EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
|
||||
protected override void OnShutdown() {
|
||||
if ((this.Shutdown != null)) {
|
||||
this.Shutdown(this, System.EventArgs.Empty);
|
||||
}
|
||||
base.OnShutdown();
|
||||
}
|
||||
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Never)]
|
||||
protected override string PrimaryCookie {
|
||||
get {
|
||||
return "ThisApplication";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///
|
||||
public sealed partial class Globals {
|
||||
|
||||
private static ThisApplication _ThisApplication;
|
||||
|
||||
internal static ThisApplication ThisApplication {
|
||||
get {
|
||||
return _ThisApplication;
|
||||
}
|
||||
set {
|
||||
if ((_ThisApplication == null)) {
|
||||
_ThisApplication = value;
|
||||
}
|
||||
else {
|
||||
throw new System.NotSupportedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,24 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
# SharpDevelop 4.2.0.8783
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "GetTimeElapsed_VBNet", "GetTimeElapsed_VBNet\GetTimeElapsed_VBNet.vbproj", "{C1499A1C-B9A0-4C5F-AC2E-E6F7C0B787D9}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
RevitVSTA|Any CPU = RevitVSTA|Any CPU
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{C1499A1C-B9A0-4C5F-AC2E-E6F7C0B787D9}.RevitVSTA|Any CPU.ActiveCfg = RevitVSTA|Any CPU
|
||||
{C1499A1C-B9A0-4C5F-AC2E-E6F7C0B787D9}.RevitVSTA|Any CPU.Build.0 = RevitVSTA|Any CPU
|
||||
{C1499A1C-B9A0-4C5F-AC2E-E6F7C0B787D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C1499A1C-B9A0-4C5F-AC2E-E6F7C0B787D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C1499A1C-B9A0-4C5F-AC2E-E6F7C0B787D9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C1499A1C-B9A0-4C5F-AC2E-E6F7C0B787D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
-156
@@ -1,156 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PropertyGroup>
|
||||
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
None
|
||||
</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
|
||||
</PropertyGroup>
|
||||
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<!-- This section defines project-level properties.
|
||||
|
||||
Project Type Guids - Must include {A860303F-1F3F-4691-B57E-529FC101A107};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} for a VB.NET VSTA project.
|
||||
Configuration - Specifies whether the default configuration is Release or Debug.
|
||||
Platform - Specifies what CPU the output of this project can run on.
|
||||
ProductVersion - The version of Visual Studio.
|
||||
SchemaVersion - The project file schema version.
|
||||
OutputType - Must be "Library" for VSTA.
|
||||
RootNamespace - In C#, this specifies the namespace given to new files.
|
||||
In Visual Basic, all objects are wrapped in this namespace at runtime.
|
||||
AssemblyName - Name of the output assembly.
|
||||
TargetFrameworkVersion - The version of the .NET Framework this project targets.
|
||||
-->
|
||||
<PropertyGroup>
|
||||
<ProjectTypeGuids>{A860303F-1F3F-4691-B57E-529FC101A107};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}</ProjectTypeGuids>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">RevitVSTA</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>GetTimeElapsed_VBNet</RootNamespace>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
<ProjectGuid>{C1499A1C-B9A0-4C5F-AC2E-E6F7C0B787D9}</ProjectGuid>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
</PropertyGroup>
|
||||
<!-- This section defines properties that are set when the "RevitVSTA" configuration is
|
||||
selected.
|
||||
|
||||
DebugType - If full enables a debugger to be attached to a running program.
|
||||
If pdbonly allows source code debugging when the program is started in the debugger but will only
|
||||
display assembler when the running program is attached to the debugger.
|
||||
If none debugging is disabled.
|
||||
DebugSymbols - If true, create symbols (.pdb). If false, do not create symbols.
|
||||
Optimize - If true, optimize the build output. If false, do not optimize.
|
||||
OutputPath - Output path of the project relative to the project file.
|
||||
DefineDebug - If true, defines the DEBUG. If false, DEBUG is not defined.
|
||||
DefineTrace - If true, defines the TRACE. If false, TRACE is not defined.
|
||||
NoWarn - Listed warning numbers will be ignored.
|
||||
-->
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'RevitVSTA|AnyCPU' ">
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' ">
|
||||
<Optimize>True</Optimize>
|
||||
<DebugSymbols>False</DebugSymbols>
|
||||
<DebugType>None</DebugType>
|
||||
<DefineConstants>TRACE=1</DefineConstants>
|
||||
<OutputPath>..\..\Addin\</OutputPath>
|
||||
<AssemblyName>GetTimeElapsed_VBNet</AssemblyName>
|
||||
</PropertyGroup>
|
||||
<!-- This sections specifies references for the project. -->
|
||||
<ItemGroup>
|
||||
<Reference Include="RevitAPIUI, Version=2011.0.0.0, Culture=neutral, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\RevitAPIUI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.AddIn">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="RevitAPI">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\RevitAPI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<!-- Visual Basic supports Importing namespaces (equivalent to using statements in C#).-->
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
</ItemGroup>
|
||||
<!-- This section defines the user source files that are part of the
|
||||
project.
|
||||
|
||||
Compile - Specifies a source file to compile.
|
||||
EmbeddedResource - Specifies a .resx file for embedded resources.
|
||||
None - Specifies a file that is not to be passed to the compiler (for instance,
|
||||
a text file or XML file).
|
||||
-->
|
||||
<ItemGroup>
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="ThisApplication.designer.vb">
|
||||
<DependentUpon>ThisApplication.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ThisApplication.vb">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<!-- Include the build rules for a VB project.-->
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<!-- This section defines VSTA properties that describe the host-changable project properties. -->
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{A860303F-1F3F-4691-B57E-529FC101A107}">
|
||||
<ProjectProperties HostName="VSTAHostName" HostPackage="{C1B21C64-9E6F-4923-A89D-9F958503C1CE}" ApplicationType="usd" Language="vb" TemplatesPath="" />
|
||||
<Host Name="Architecture2011">
|
||||
<HostItem Name="ThisApplication" Code="ThisApplication.vb" CanonicalName="ThisApplication" DisplayName="ThisApplication" Blueprint="ThisApplication.Designer.xml" GeneratedCode="ThisApplication.designer.vb" />
|
||||
</Host>
|
||||
<ProjectClient>
|
||||
<HostIdentifier>MEP2011</HostIdentifier>
|
||||
<InProcHost>{f2d1070d-feff-4610-9403-9476ff28253d}</InProcHost>
|
||||
</ProjectClient>
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' General Information about an assembly is controlled through the following
|
||||
' set of attributes. Change these attribute values to modify the information
|
||||
' associated with an assembly.
|
||||
|
||||
' Review the values of the assembly attributes
|
||||
|
||||
<Assembly: AssemblyTitle("GetTimeElapsed_VBNet")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("Autodesk, Inc.")>
|
||||
<Assembly: AssemblyProduct("GetTimeElapsed_VBNet")>
|
||||
<Assembly: AssemblyCopyright("Copyright @ Autodesk, Inc. 2009")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
<Assembly: CLSCompliant(True)>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
<Assembly: Guid("850d7483-e379-4018-bdb0-612c14540596")>
|
||||
|
||||
' Version information for an assembly consists of the following four values:
|
||||
'
|
||||
' Major Version
|
||||
' Minor Version
|
||||
' Build Number
|
||||
' Revision
|
||||
'
|
||||
' You can specify all the values or you can default the Build and Revision Numbers
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.0.0.0")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.0")>
|
||||
Generated
-61
@@ -1,61 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <autogenerated>
|
||||
' This code was generated by a tool.
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </autogenerated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict Off
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'''<summary>
|
||||
''' A strongly-typed resource class, for looking up localized strings, etc.
|
||||
'''</summary>
|
||||
'This class was auto-generated by the Strongly Typed Resource Builder
|
||||
'class via a tool like ResGen or Visual Studio.NET.
|
||||
'To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
'with the /str option, or rebuild your VS project.
|
||||
Class MyResources
|
||||
|
||||
Private Shared _resMgr As System.Resources.ResourceManager
|
||||
|
||||
Private Shared _resCulture As System.Globalization.CultureInfo
|
||||
|
||||
Friend Sub New()
|
||||
MyBase.New
|
||||
End Sub
|
||||
|
||||
'''<summary>
|
||||
''' Returns the cached ResourceManager instance used by this class.
|
||||
'''</summary>
|
||||
<System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Public Shared ReadOnly Property ResourceManager() As System.Resources.ResourceManager
|
||||
Get
|
||||
If (_resMgr Is Nothing) Then
|
||||
Dim temp As System.Resources.ResourceManager = New System.Resources.ResourceManager("My.Resources.MyResources", GetType(MyResources).Assembly)
|
||||
_resMgr = temp
|
||||
End If
|
||||
Return _resMgr
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Overrides the current thread's CurrentUICulture property for all
|
||||
''' resource lookups using this strongly typed resource class.
|
||||
'''</summary>
|
||||
<System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Public Shared Property Culture() As System.Globalization.CultureInfo
|
||||
Get
|
||||
Return _resCulture
|
||||
End Get
|
||||
Set
|
||||
_resCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
-120
@@ -1,120 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Generated
-38
@@ -1,38 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <autogenerated>
|
||||
' This code was generated by a tool.
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </autogenerated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict Off
|
||||
Option Explicit On
|
||||
|
||||
|
||||
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared m_Value As MySettings
|
||||
|
||||
Private Shared m_SyncObject As Object = New Object
|
||||
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Public Shared ReadOnly Property Value() As MySettings
|
||||
Get
|
||||
If (MySettings.m_Value Is Nothing) Then
|
||||
System.Threading.Monitor.Enter(MySettings.m_SyncObject)
|
||||
If (MySettings.m_Value Is Nothing) Then
|
||||
Try
|
||||
MySettings.m_Value = New MySettings
|
||||
Finally
|
||||
System.Threading.Monitor.Exit(MySettings.m_SyncObject)
|
||||
End Try
|
||||
End If
|
||||
End If
|
||||
Return MySettings.m_Value
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
-7
@@ -1,7 +0,0 @@
|
||||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
Generated
-80
@@ -1,80 +0,0 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:2.0.50727.3603
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict Off
|
||||
Option Explicit On
|
||||
|
||||
|
||||
|
||||
'''
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Tools.Applications.ProgrammingModel.dll", "9.0.0.0"), _
|
||||
Global.System.CLSCompliantAttribute(false)> _
|
||||
Partial Public NotInheritable Class ThisApplication
|
||||
Inherits Autodesk.Revit.UI.Macros.ApplicationEntryPoint
|
||||
|
||||
Public Event Startup As System.EventHandler
|
||||
|
||||
Public Event Shutdown As System.EventHandler
|
||||
|
||||
'''
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
|
||||
Private Sub OnStartup()
|
||||
Globals.ThisApplication = Me
|
||||
End Sub
|
||||
|
||||
'''
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
|
||||
Protected Overrides Sub FinishInitialization()
|
||||
MyBase.FinishInitialization
|
||||
Me.OnStartup
|
||||
If (Not (Me.StartupEvent) Is Nothing) Then
|
||||
RaiseEvent Startup(Me, System.EventArgs.Empty)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
'''
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
|
||||
Protected Overrides Sub OnShutdown()
|
||||
If (Not (Me.ShutdownEvent) Is Nothing) Then
|
||||
RaiseEvent Shutdown(Me, System.EventArgs.Empty)
|
||||
End If
|
||||
MyBase.OnShutdown
|
||||
End Sub
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Never)> _
|
||||
Protected Overrides ReadOnly Property PrimaryCookie() As String
|
||||
Get
|
||||
Return "ThisApplication"
|
||||
End Get
|
||||
End Property
|
||||
End Class
|
||||
|
||||
'''
|
||||
Partial Public NotInheritable Class Globals
|
||||
|
||||
Private Shared _ThisApplication As ThisApplication
|
||||
|
||||
Friend Shared Property ThisApplication() As ThisApplication
|
||||
Get
|
||||
Return _ThisApplication
|
||||
End Get
|
||||
Set
|
||||
If (_ThisApplication Is Nothing) Then
|
||||
_ThisApplication = value
|
||||
Else
|
||||
Throw New System.NotSupportedException
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
-114
@@ -1,114 +0,0 @@
|
||||
Imports System
|
||||
Imports System.IO
|
||||
Imports System.Diagnostics
|
||||
Imports System.Collections.Generic
|
||||
|
||||
Imports Autodesk
|
||||
Imports Autodesk.Revit
|
||||
Imports Autodesk.Revit.DB
|
||||
Imports Autodesk.Revit.DB.Events
|
||||
Imports Autodesk.Revit.UI
|
||||
Imports Autodesk.Revit.UI.Events
|
||||
|
||||
<Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Manual)> _
|
||||
<Autodesk.Revit.DB.Macros.AddInIdAttribute("A2616C96-88D8-4C9D-B4EF-E84147DEE20B")> _
|
||||
Partial Public Class ThisApplication
|
||||
|
||||
Private m_dicLastSaved As New Dictionary(Of Document, DateTime)()
|
||||
|
||||
Private Sub Module_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup
|
||||
InitializeDicLastSaved()
|
||||
AddHandler Me.Application.DocumentSaved, AddressOf ThisApplication_DocumentSaved
|
||||
AddHandler Me.Application.DocumentOpened, AddressOf ThisApplication_DocumentOpened
|
||||
AddHandler Me.Application.DocumentCreated, AddressOf ThisApplication_DocumentCreated
|
||||
AddHandler Me.Application.DocumentClosing, AddressOf ThisApplication_DocumentClosing
|
||||
End Sub
|
||||
|
||||
Private Sub Module_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown
|
||||
RemoveHandler Me.Application.DocumentSaved, AddressOf ThisApplication_DocumentSaved
|
||||
RemoveHandler Me.Application.DocumentOpened, AddressOf ThisApplication_DocumentOpened
|
||||
RemoveHandler Me.Application.DocumentCreated, AddressOf ThisApplication_DocumentCreated
|
||||
RemoveHandler Me.Application.DocumentClosing, AddressOf ThisApplication_DocumentClosing
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Initialize
|
||||
''' </summary>
|
||||
Private Sub InitializeDicLastSaved()
|
||||
For Each document As Document In Me.Application.Documents
|
||||
m_dicLastSaved.Add(document, DateTime.MaxValue)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' DocumentCreated event, add the created document into m_dicLastSaved
|
||||
''' </summary>
|
||||
''' <param name="sender">sender</param>
|
||||
''' <param name="args">DocumentCreatedEventArgs</param>
|
||||
Private Sub ThisApplication_DocumentCreated(ByVal sender As Object, ByVal args As Autodesk.Revit.DB.Events.DocumentCreatedEventArgs)
|
||||
m_dicLastSaved.Add(args.Document, DateTime.MaxValue)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' DocumentClosing event, remove the closing document from m_dicLastSaved
|
||||
''' </summary>
|
||||
''' <param name="sender">sender</param>
|
||||
''' <param name="args">DocumentClosingEventArgs</param>
|
||||
Private Sub ThisApplication_DocumentClosing(ByVal sender As Object, ByVal args As Autodesk.Revit.DB.Events.DocumentClosingEventArgs)
|
||||
m_dicLastSaved.Remove(args.Document)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' DocumentOpened event, add the opened document into m_dicLastSaved
|
||||
''' </summary>
|
||||
''' <param name="sender">sender</param>
|
||||
''' <param name="args">DocumentOpenedEventArgs</param>
|
||||
Private Sub ThisApplication_DocumentOpened(ByVal sender As Object, ByVal args As Autodesk.Revit.DB.Events.DocumentOpenedEventArgs)
|
||||
m_dicLastSaved.Add(args.Document, DateTime.MaxValue)
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' DocumentSaved event, record the current DataTime for the saved document
|
||||
''' </summary>
|
||||
''' <param name="sender">sender</param>
|
||||
''' <param name="args">DocumentSavedEventArgs</param>
|
||||
Private Sub ThisApplication_DocumentSaved(ByVal sender As Object, ByVal args As Autodesk.Revit.DB.Events.DocumentSavedEventArgs)
|
||||
Me.m_dicLastSaved(args.Document) = DateTime.Now
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' FormatTimeSpan
|
||||
''' </summary>
|
||||
''' <param name="elapse">TimeSpan</param>
|
||||
''' <returns>the string of TimeSpan</returns>
|
||||
Private Function FormatTimeSpan(ByVal elapse As TimeSpan) As [String]
|
||||
Dim elapseStr As [String] = elapse.ToString()
|
||||
Dim lastIndexOfDot As Integer = elapseStr.LastIndexOf("."c)
|
||||
Return elapseStr.Substring(0, lastIndexOfDot)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' GetTimeElapsedSinceLastSave
|
||||
''' </summary>
|
||||
Public Sub GetTimeElapsedSinceLastSave()
|
||||
Dim text As [String] = [String].Format("{0,-30}{1,-30}", "Document Full Name", "Elapse Time Since Last Save(day.hh:mm:ss)") & vbLf
|
||||
For Each pair As KeyValuePair(Of Document, DateTime) In m_dicLastSaved
|
||||
Dim strElapsed As [String] = [String].Empty
|
||||
If pair.Value = DateTime.MaxValue Then
|
||||
strElapsed = "Never"
|
||||
Else
|
||||
strElapsed = FormatTimeSpan(DateTime.Now - pair.Value)
|
||||
End If
|
||||
|
||||
Dim fileName As [String] = System.IO.Path.GetFileName(pair.Key.PathName)
|
||||
If [String].IsNullOrEmpty(fileName) Then
|
||||
fileName = "*New*"
|
||||
End If
|
||||
|
||||
text += [String].Format("{0,-30}{1,-30}", fileName, strElapsed) & vbLf
|
||||
Next
|
||||
|
||||
System.Windows.Forms.MessageBox.Show(text, "Macro GetTimeElapsedSinceLastSave")
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user