public KeyCommandLauncherFactory( Utility.Assemblies.ManifestResources resources,
            System.Reflection.Assembly assembly, string prefix, CommandControlSet commandControlSet)
        {
            if( assembly == null )
            {
                throw new ArgumentNullException( "assembly" );
            }
            if( prefix == null )
            {
                throw new ArgumentNullException( "prefix" );
            }
            if( commandControlSet == null )
            {
                throw new ArgumentNullException( "commandControlSet" );
            }
            if( resources == null )
            {
                throw new ArgumentNullException( "resources" );
            }

            _resources = resources;
            _assembly = assembly;
            _prefix = prefix;
            _commandControlSet = commandControlSet;
        }
Ejemplo n.º 2
0
        public CommandMenuStripFactory( Utility.Assemblies.ManifestResources resources,
            System.Reflection.Assembly assembly, string prefix, CommandControlSet commandControlSet)
            : base(resources)
        {
            if( assembly == null )
            {
                throw new ArgumentNullException( "assembly" );
            }
            if( prefix == null )
            {
                throw new ArgumentNullException( "prefix" );
            }
            if( commandControlSet == null )
            {
                throw new ArgumentNullException( "commandControlSet" );
            }

            _assembly = assembly;
            _prefix = prefix;
            _commandControlSet = commandControlSet;
        }
Ejemplo n.º 3
0
 public CommandMenuStripFactory( Utility.Assemblies.ManifestResources resources,
     string prefix, CommandControlSet commandControlSet)
     : this(resources, System.Reflection.Assembly.GetCallingAssembly(), prefix, commandControlSet)
 {
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Combine two DataItem objects (in cross-product fashion)
        /// </summary>
        /// <param name="diL">Left DataItem object</param>
        /// <param name="diR">Right DataItem object</param>
        /// <param name="gdi">GetDataItem function</param>
        /// <returns>a data item which is a pair of the given data items</returns>
        public static DataItem Pair(DataItem diL, DataItem diR, Utility.DataItemPool.GetDataItem gdi)
        {
            //Call the correct constructor to create a DataItem or Punctuation
            DataItem di;
            if (diL is Punctuation && diR is Punctuation)
                di = new Punctuation(diL.Count + diR.Count);
            else
                di = gdi(1)[0];
            for (int i = 0; i < diL.Count; i++)
                di.AddValue(diL[i]);
            for (int i = 0; i < diR.Count; i++)
                di.AddValue(diR[i]);

            return di;
        }
Ejemplo n.º 5
0
 /// <summary>
 /// When an error is encountered, this handler will be called.
 /// </summary>
 static void OnError(object sender, Utility.JobManager.JobCompleteArgs e)
 {
     if (e.ErrorMessage != null)
         Console.WriteLine(e.ErrorMessage);
 }
Ejemplo n.º 6
0
 public static void RemoveGeneratedDocument(ManagedItem sourceManagedItem, string documentID, Utility.DocumentStorageType documentStorageType)
 {
     ILog log = LogManager.GetLogger(sourceManagedItem.GetType());
     try
     {
         Utility.DocumentStorage documentStorageObject = Utility.DocumentStorage.GetDocumentStorageObject(documentStorageType);
         documentStorageObject.DeleteDocument(documentID);
         log.Debug(string.Format("Deleted Generated document {0} from ManagedItem {1} during CreateRetro call", documentID, sourceManagedItem.ItemNumber));
     }
     catch
     {
         //Create a record in the Document table - for later clean up
         Data.Document.DeleteDocument(sourceManagedItem.ManagedItemID, "Generated Document", "Generated Document", documentID, "Generated Document", false, false);
         log.Error(string.Format("Failed to fully delete Generated document {0} from ManagedItem {1} during CreateRetro call", documentID, sourceManagedItem.ItemNumber));
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Creates a new instance of a ManagedItem using the specified template where the system uses the OwningFacility concept
 /// </summary>
 /// <param name="template">The template that this ManagedItem is based on</param>
 /// <param name="facilityIds">One or more facilities that this ManagedItem is associated with</param>
 public static ManagedItem CreateRetro(Template template, bool useAlternateTemplate, Guid sourceManagedItemID, bool hasOwningFacility, Utility.DocumentStorageType documentStorageType, out bool returnToDraft)
 {
     ManagedItem sourceManagedItem = Business.ManagedItem.Get(sourceManagedItemID, true);
     ManagedItem newManagedItem = new ManagedItem(template.ID, sourceManagedItem.ManagedItemID);
     newManagedItem.RetroCopy(template, useAlternateTemplate);
     returnToDraft = newManagedItem.Migrate(sourceManagedItem);
     if (returnToDraft)
     {
         //Changed for Multiple Documents
         foreach (ITATDocument doc in sourceManagedItem.Documents)
         {
             if (!string.IsNullOrEmpty(doc.GeneratedDocumentID))
             {
                 RemoveGeneratedDocument(sourceManagedItem, doc.GeneratedDocumentID, documentStorageType);
                 newManagedItem.GetITATDocument(doc.ITATDocumentID).GeneratedDocumentID = null;
             }
         }
     }
     return newManagedItem;
 }
Ejemplo n.º 8
0
 public MenuStripFactory( Utility.Assemblies.ManifestResources resources )
     : base(resources)
 {
 }
Ejemplo n.º 9
0
        public XmlColorTable( Utility.Assemblies.ManifestResources res, string path )
        {
            XmlDocument xmlDoc = res.GetXmlDocument( path );

            XmlNode ctNode = xmlDoc.SelectSingleNode( "ColorTable" );

            _name = ctNode.Attributes["Name"].Value;
            _description = ctNode.Attributes["Description"].Value;

            foreach( XmlNode cNode in ctNode.ChildNodes )
            {
                string name = cNode.Name;
                string value = cNode.InnerText;

                if( value.Length != 7 || value[0] != '#' )
                {
                    throw new InvalidOperationException( string.Format( "Invalid color '{0}' in '{1}'.", value, name ) );
                }

                int v = int.Parse( value.Substring( 1 ), System.Globalization.NumberStyles.AllowHexSpecifier );

                unchecked
                {
                    Color color = Color.FromArgb( (int) 0xff000000 | v );

                    _colors.Add( name, color );
                }
            }
        }
Ejemplo n.º 10
0
 public RibbonFactory( Utility.Assemblies.ManifestResources resources )
     : base(resources)
 {
 }
Ejemplo n.º 11
0
 public CommandRibbonFactory( Utility.Assemblies.ManifestResources resources,
     string prefix, WinFormsUtility.Commands.CommandControlSet commandControlSet)
     : this(resources, System.Reflection.Assembly.GetCallingAssembly(), prefix, commandControlSet)
 {
 }
Ejemplo n.º 12
0
 public ContextMenuFactory( Utility.Assemblies.ManifestResources resources )
     : base(resources)
 {
 }